Velocity Control using ROS

Is there an easy way to do velocity control of the arm/wrist using ROS?

For the base, I’m currently publishing twists to \cmd_vel which is extremely straightforward. Is there a similar topic for the arm and wrist or do I need to do something similar to this tutorial: Follow Joint Trajectory Commands - Stretch Documentation?

As a followup, seems like it might make sense to just use the Stretch Body set velocity commands?

Hey @akhilp, our ROS driver doesn’t have velocity control for the bounded joints, so if you’re able to use Stretch Body, I’d recommend going that route. You cannot use Stretch ROS and Stretch Body simultaneously. There’s an example script for the arm/lift joints in this topic:

If you think it would be useful to have velocity control at the ROS level, I can definitely explain how to make that happen.

Thanks Binit!

For the gripper and wrist dynamixels, is it possible to do velocity control also?

I saw the following code from this post (Watchdog on joint velocity):

motor = stretch_body.stepper.Stepper('/dev/hello-motor-right-wheel')


However, when I try to do:
motor = stretch_body.stepper.Stepper('/dev/hello-dynamixel-wrist')

I get the error: [ERROR] [hello-dynamixel-wrist]: Parameters for device hello-dynamixel-wrist not found. Check parameter YAML and device name. Exiting...

I also don’t see the address for the gripper dynamixel in the /dev/ folder.

Thanks again!

Yup, all the dynamixels have velocity control as well. The dynamixels aren’t Stepper joints, so interacting with them looks like this:

import stretch_body.robot

r = stretch_body.robot.Robot()
assert(r.is_calibrated()) # the robot must be homed

# move the wrist_yaw counter clockwise at 0.1 rad/s


# move the head clockwise at 0.2 rad/s
1 Like

@bshah The dynamixels don’t move when I use the above code. I made sure the robot was homed and also tried putting the two move commands into a while loop.

Hey @akhilp, I edited my post above to show how to use the new set_velocity() API, which is part of this PR. You’ll see the Dynamixels move correctly with this new API, and the PR fixes a few other bugs related to velocity controlling Dxl joints. You’ll need Stretch Body version 0.5.1 or greater. You can upgrade Stretch Body using:

pip3 install -U hello-robot-stretch-body