Get and Set Joint angles using moveit in python

asked 2021-05-25 13:12:31 -0500

meowatthemoon gravatar image

Hello,

I'm using MoveIt!'s python API to control a UR-5 robotic arm simulated in Gazebo. Currently, to move it I know you can specify the end-effector's position using the set_pose(pose) function. Additionally, you specify the goal joint values using set_joint_value_target().

However, these joint values aren't the angles of the joints. I would like to know if there's a function for setting the goal joint angles, and another for getting the current joint angles.

For context, my goal is to train a reinforcement learning policy whose action output will be joint angle changes. I tried training the model using the values returned by get_current_joint_values(). I don't know what type of values this function returns (I've searched the documentation and couldn't find it), but I assume they aren't the radians or degree angles else the model would converge.

In short: 1-What values does "get_current_joint_values()" return? 2-Is there a way to getting and setting the angles (radians or degrees) of the joints using moveit?

Thanks in advance!

edit retag flag offensive close merge delete

Comments

1

I tried training the model using the values returned by get_current_joint_values(). I don't know what type of values this function returns

joint angles in radians (provided no prismatic joints are present).

gvdhoorn gravatar image gvdhoorn  ( 2021-05-25 13:17:46 -0500 )edit

Thank you.

meowatthemoon gravatar image meowatthemoon  ( 2021-05-25 14:05:02 -0500 )edit

What made you believeconclude the values "aren't the angles of the joints"?

gvdhoorn gravatar image gvdhoorn  ( 2021-05-26 04:01:21 -0500 )edit