> For the complete documentation index, see [llms.txt](https://docs-origin.anvil.bot/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-origin.anvil.bot/reference/technical-reference/commanding-robot-movement.md).

# Commanding Robot Movement

The list of ROS2 topics you can publish on to manipulate the system

{% hint style="danger" %}
In order to provide customers with maximum control over their robots, Anvil imposes minimal safety constraints over robot movement when the system is being controlled programmatically. We advise that you exercise caution when using these methods of robot control.\
\
A good practice is to, in your control scripts, continuously query robot state and use that to check that subsequent commands are safe and reasonable before sending them (ie. no large jumps, out-of-limit angles, huge torques, etc).
{% endhint %}

## Joint Space Commands

**Topic Name:** `/follower_{l/r}_forward_position_controller/commands`

**Message Type:** [Float64MultiArray](https://docs.ros2.org/latest/api/std_msgs/msg/Float64MultiArray.html)

This topic is used in many different control modes, including Quest teleoperation, to control the robot by commanding joints to certain angles/positions. Publishing on this topic will move all joints to the given positions. This topic is not active when using Leader/Follower control.\
\
The finger joints (grippers) need to be specified in metric linear space, and range from -0.003 (fully closed, with squeeze force) to 0.05 (fully open).

{% hint style="danger" %}
Please note that the order of joints used when sending commands starts at the first joint (J1 aka `joint1`) and follows the arm naturally, ending with the gripper (J8 for OpenARM, J7 for OpenYAM, aka `finger_joint1` in both cases).\
\
This is **different** from the order in which joint state is received when querying the [Querying Robot State](https://docs-origin.anvil.bot/reference/technical-reference/querying-robot-state.md#joint-states) topic. Please keep this in mind and inspect both topics carefully before commanding the robot.
{% endhint %}

## End Effector Cartesian Space Commands

**Topic Name:** `/commanded_ee_{left/right}`

**Message Type:** [Custom Message Types](https://docs-origin.anvil.bot/reference/technical-reference/custom-message-types.md#commandedeepose)

{% hint style="warning" %}
To use this control mode, you need to [set your config](https://docs-origin.anvil.bot/user-guides/starting-robot-operation.md#confirm-the-hardware-config) to `openarm_quest_teleop_commanded_ee.yaml`
{% endhint %}

Publishing on this topic will invoke Anvil's IK engine to determine the desired joint angles that drive the end effector to the given position. These angles will in turn be published onto the [#joint-space-commands](#joint-space-commands "mention") topics and move the robot into the desired configuration.\
\
In the transform tree of the robot, the end effector we reference here is the `follower_{l/r}_hand_tcp` frame. To issue these commands, you need to understand the coordinate space of the robot. See the reference images below to better understand these:

<figure><img src="https://4223670213-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT8swLPls6cg6zxcYD7sj%2Fuploads%2F9snQX7a6pvfHrMqVLt6z%2Farms_with_hand_frames.png?alt=media&amp;token=f608fb99-3e49-444a-8f5f-adb526cffcbe" alt=""><figcaption></figcaption></figure>

<figure><img src="https://4223670213-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT8swLPls6cg6zxcYD7sj%2Fuploads%2FSwSByWEhfFs5m489Wcf6%2Fhand_frames_and_world_frame.png?alt=media&amp;token=91844e83-0ecb-4693-87a2-7262bbce7fdb" alt=""><figcaption></figcaption></figure>
