hello-robot / stretch_ros

ROS packages for the Stretch mobile manipulators from Hello Robot Inc.
https://docs.hello-robot.com/0.2/stretch-tutorials/ros1/
174 stars 86 forks source link

Velocity Control #109

Open hello-binit opened 1 year ago

hello-binit commented 1 year ago

This PR introduces a velocity mode in Stretch Core that enables velocity control of every joint except the gripper, which remains in position control. Mobile base velocity control happens via the cmd_vel topic, and velocity control of the remaining joints happens through the FollowJointTrajectory action server. A move_at_speed() method is added to the HelloNode class to make it easy to use velocity mode.

Limitations:

TODO:

How to test

Install Stretch Body locally and checkout feature/dxl_vel_improvements. In your Catkin workspace, in the stretch_ros repo, change the branch to feature/velocity_control.

Launch the driver:

roslaunch stretch_core stretch_driver.launch mode:=velocity

Open ipython to use the HelloNode.move_at_speed() method:

In [1]: import hello_helpers.hello_misc as hm
   ...: temp = hm.HelloNode.quick_create('temp')
[INFO] [1691143231.379349]: /temp started
[INFO] [1691143231.457786]: Node /temp connected to robot services.

In [2]: temp.move_at_speed({'joint_head_pan': 0.05})

In [3]: temp.move_at_speed({'joint_head_pan': 0.0})

Valid joints are joint_head_pan, joint_head_tilt, joint_lift, joint_arm, joint_wrist_yaw.