CommonplaceRobotics / iRC_ROS

ROS2 packages for the igus Robot Control
Apache License 2.0
15 stars 7 forks source link

joint_trajectory_controller takes degrees instead of radians. #78

Closed JHeuverRiwo closed 1 year ago

JHeuverRiwo commented 1 year ago

The joint trajectory controller when using CRI seems to be taking degrees instead of radians as goal positions. This is not in line with REP103 specifying the standard units of measure as radians.

This may cause issues with moveit, considering moveit will expect to control the robot using radians.

We're on the commit "Fix losing LaunchConfigurations with EventHandlers for top level launch files" using CRI with this test; using ros2 humble, and Ubuntu 22.04. I checked the hardware package changelog and this does not seem to be addressed in later commits, assuming this is problem in the hardware interface.

cpr-fer commented 1 year ago

It looks like the conversion between radians and degrees in the hardware interface is only done when reading, not when writing positions, PR is on the way

I'll also check if the velocities are in rad/s while I'm at it, thanks for opening the issue!

cpr-fer commented 1 year ago

@JHeuverRiwo I opened a PR to fix it, but I am not sure when I will be able to test it with CRI myself

JHeuverRiwo commented 1 year ago

Thank you, I tested the changes to the hardware interface, and tried to move the robot to a few positions; this seems to work properly for me.

cpr-fer commented 1 year ago

Thank you for testing! Before merging I'll quickly check how CRI handles joint goals outside of -180 to 180 degrees.

Edit: Turns out CRI itself will throw errors if that happens. As such if those errors occur regularly I would propose to introduce boundary checks, but for now I'll leave it as is and will merge the PR