Ask Your Question
0

How to send raw velocity commands to joints of pr2

asked 2017-04-20 10:28:07 -0500

JollyGood gravatar image

I want to send raw velocity commands to joints of pr2 instead of high level joint action commands. I want to apply a reinforcement learning to pr2 arm manipulation. So I need to send raw velocities to pr2 gazebo simulator.

I googled and found that I can use robot_mechanism_controllers/JointVelocityController

But I don't know how to use it to send a velocity command to /r_shoulder_pan_joint. Could anyone provide me with a simple command line example to publish a such command?

I am testing this on pr2_gazebo for now. I hope a solution would work on gazebo, too.

And are there better ways to send raw velocities rather than robot_mechanism_controllers/JointVelocityController?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-05-02 18:37:26 -0500

JollyGood gravatar image

updated 2017-05-02 18:38:03 -0500

I could finally publish raw joint velocity command to a joint. Here are what I did:

  • create a parameter yaml file as follows; e.g. l_shoulder_pan_velocity_controller.yaml

l_shoulder_pan_velocity_controller:
type: robot_mechanism_controllers/JointVelocityController
joint: l_shoulder_pan_joint
pid:
p: 5.0
i: 20.0
i_clamp: 100.0

  • Then load the file on the parameter server

$ rosparam load l_shoulder_pan_velocity_controller.yaml

  • Load the joint velocity controller

rosrun pr2_controller_manager pr2_controller_manger load l_shoulder_pan_velocity_controller

  • Stop the l_arm_controller which is running

rosrun pr2_controller_manager pr2_controller_manager stop l_arm_controller - Start the joint velocity controller for l_shoulder_pan_joint

rosrun pr2_controller_manager pr2_controller_manager start l_shoulder_pan_velocity_controller - Publish joint velocity command topic

rostopic pub -1 l_shoulder_pan_velocity_controller/commad std_msgs/Float64 1.0

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2017-04-20 10:28:07 -0500

Seen: 446 times

Last updated: May 02 '17