# Move arm and base at the same time

**URL:** <https://forum.hello-robot.com/t/move-arm-and-base-at-the-same-time/696>\
**Category:** Ask\
**Created:** [May 2, 2023, 6:46am UTC](https://forum.hello-robot.com/t/move-arm-and-base-at-the-same-time/696 "2023-05-02T06:46:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![arjung](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.hello-robot.com/arjung/32/410_2.png) [@arjung](https://forum.hello-robot.com/u/arjung)\
**Post date:** [May 2, 2023, 6:46am UTC](https://forum.hello-robot.com/t/move-arm-and-base-at-the-same-time/696/1 "2023-05-02T06:46:01Z")

</div>

Hello,

I’m able to move the arm to specific arm joints using the tutorial [here](https://docs.hello-robot.com/0.2/stretch-tutorials/getting_started/quick_start_guide_re2/) in the following way:

```auto
import stretch_body.robot

robot=stretch_body.robot.Robot()
robot.startup()

robot.lift.move_to(args.lift_height)
robot.arm.move_to(args.arm_length)
robot.end_of_arm.move_to('wrist_yaw', args.wrist_yaw)

robot.push_command()
robot.stop()

```

I am also able to control the base rotation as described [here](https://docs.hello-robot.com/0.2/stretch-tutorials/stretch_body/tutorial_stretch_body_api/#stretch_body.end_of_arm.EndOfArm.move_to):

```auto
import stretch_body.base

b = stretch_body.base.Base()
b.left_wheel.disable_sync_mode()
b.right_wheel.disable_sync_mode()
if not b.startup():
    exit() # failed to start base!

b.rotate_by(args.rotate_by)
b.push_command()

```

While these scripts work well separately, I am not able to run them concurrently in the same script as this results in an error. I tried splitting up the overall motion into smaller steps and alternated between the arm motion and the base motion but this leads to a very un-smooth trajectory. I would like to move the arm joints and the rotate the base at the same time – is this possible?

Any help will be much appreciated, thanks in advance!

---

<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:** [May 2, 2023, 9:33pm UTC](https://forum.hello-robot.com/t/move-arm-and-base-at-the-same-time/696/2 "2023-05-02T21:33:25Z")

</div>

Hi @arjung, yes, it is possible to move the arm joints and rotate the base simultaneously. In the first snippet, a instance of `stretch_body.robot.Robot()` is created. Through that `robot` variable, you can send commands to the arm and base simultaneously:

```python
import stretch_body.robot

robot = stretch_body.robot.Robot()
robot.startup()

robot.lift.move_to(args.lift_height)
robot.arm.move_to(args.arm_length)
robot.end_of_arm.move_to('wrist_yaw', args.wrist_yaw)
robot.base.rotate_by(args.rotate_by)

robot.push_command()
robot.stop()

```

Notice here that if you were to print out the type of `robot.base`, it would actually be the same `stretch_body.base.Base` class that you manually instantiated in the second snippet. It’s just easier to interact with the base through `robot.base`.

---

<div class="post-metadata">

**Author:** ![arjung](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.hello-robot.com/arjung/32/410_2.png) [@arjung](https://forum.hello-robot.com/u/arjung)\
**Post date:** [May 4, 2023, 7:57pm UTC](https://forum.hello-robot.com/t/move-arm-and-base-at-the-same-time/696/3 "2023-05-04T19:57:11Z")

</div>

This was exactly what I was looking for. Thanks so much for all your help!
