Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ROS Bridge to not call the argument a "Radians" or "RadiansPerSecond" when not applicable (should instead be a float) #682

Open
tabiosg opened this issue Apr 9, 2024 · 2 comments

Comments

@tabiosg
Copy link
Contributor

tabiosg commented Apr 9, 2024

Currently, we have Velocity or Position commands that we used to assume were always in Radians.
However, now, sometimes, they may be in terms of meters. In this case, we set the value "mAvoidConversionToRevolutions" to true.

Currently, we have the functions "setDesiredPosition" and "setDesiredVelocity" but they take in the arguments Radians. It might make more sense to have these functions be just raw dimensionless/float values and then convert them inside later.

For example,

function_name (float argument_velocity)

argument_velocity = std::clamp (argument_velocity, minvel, maxvel);
Revolutions moteus_input_command; 

if (mAvoidConversionToRevolutions) {
    moteus_input_command = Revolutions{argument_velocity};  // This treats it as the raw value.
}
else {
   moteus_input_command = Radians{argument_velocity};
}

Note that this needs to catkin build so this needs to work for the Brushed Controller as well.

@tabiosg tabiosg changed the title Update ROS Bridge to not call define "Radians" or "RadiansPerSecond" when not applicable Update ROS Bridge to not call the argument a "Radians" or "RadiansPerSecond" when not applicable (should instead be a float) Apr 9, 2024
@qhdwight
Copy link
Collaborator

qhdwight commented Apr 9, 2024

I think it makes sense for these functions to accept any templated unit type actually

@qhdwight
Copy link
Collaborator

qhdwight commented Apr 9, 2024

This may be kind of advanced metaprogramming I'll take a stab at it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants