# Commanding velocity to the arm and lift

**URL:** <https://forum.hello-robot.com/t/commanding-velocity-to-the-arm-and-lift/386>\
**Category:** Knowledge Base\
**Created:** [March 4, 2022, 5:02am UTC](https://forum.hello-robot.com/t/commanding-velocity-to-the-arm-and-lift/386 "2022-03-04T05:02:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sguysc](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@sguysc](https://forum.hello-robot.com/u/sguysc)\
**Post date:** [March 4, 2022, 5:02am UTC](https://forum.hello-robot.com/t/commanding-velocity-to-the-arm-and-lift/386/1 "2022-03-04T05:02:37Z")

</div>

Hello,

Is there a way to send velocity commands to the joints (i.e. not the base) with the python  
library or with ROS ?

Thank you

---

<div class="post-metadata">

**Author:** ![bshah](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.hello-robot.com/bshah/32/55_2.png) [@bshah](https://forum.hello-robot.com/u/bshah)\
**Post date:** [March 4, 2022, 8:32am UTC](https://forum.hello-robot.com/t/commanding-velocity-to-the-arm-and-lift/386/2 "2022-03-04T08:32:08Z")

</div>

Hi @sguysc, welcome to the forum! Yes, you can send velocity commands to the [arm](https://github.com/hello-robot/stretch_body/blob/master/body/stretch_body/arm.py#L121-L152) and [lift](https://github.com/hello-robot/stretch_body/blob/master/body/stretch_body/lift.py#L122-L154) joints using the `set_velocity()` API in Stretch Body. Here’s an example script of what using this API would look like:

```python
import stretch_body.robot

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

# move the arm out at 0.05 m/s
r.arm.set_velocity(0.05)
r.push_command()

[...]

# some time later, move the lift up at 0.05 m/s
r.lift.set_velocity(0.05)
r.push_command()

```

Let me know if you have any questions.

---

<div class="post-metadata">

**Author:** ![sguysc](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@sguysc](https://forum.hello-robot.com/u/sguysc)\
**Post date:** [March 4, 2022, 1:51pm UTC](https://forum.hello-robot.com/t/commanding-velocity-to-the-arm-and-lift/386/3 "2022-03-04T13:51:09Z")

</div>

Ahh, cool. I should’ve checked the code. I based my question on the  
[docs](https://docs.hello-robot.com/stretch_body_api/) where the arm and lift did not specify `set_velocity` while the base did …

---

<div class="post-metadata">

**Author:** ![bshah](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.hello-robot.com/bshah/32/55_2.png) [@bshah](https://forum.hello-robot.com/u/bshah)\
**Post date:** [March 4, 2022, 8:55pm UTC](https://forum.hello-robot.com/t/commanding-velocity-to-the-arm-and-lift/386/4 "2022-03-04T20:55:27Z")

</div>

Thanks for pointing that out. The API ref is relatively new. It was missing methods that are undocumented in the code, but I’ve changed that now. `set_velocity()` now shows in the API ref as a member of the [arm](https://docs.hello-robot.com/stretch_body_api/#stretch_body.arm.Arm.set_velocity) and [lift](https://docs.hello-robot.com/stretch_body_api/#stretch_body.lift.Lift.set_velocity) classes.
