.. rubric:: G1 Arm ROS2 Control

.. rubric:: Start the arms (Mandatory)

.. code-block:: bash

    ROS_DOMAIN_ID=10 ros2 service call /g1_unit_001/hardware/control/arm_dof7/start std_srvs/srv/Trigger {}

.. rubric:: Stop the arms (Mandatory)

.. code-block:: bash

    ROS_DOMAIN_ID=10 ros2 service call /g1_unit_001/hardware/control/arm_dof7/stop std_srvs/srv/Trigger {}

.. rubric:: Move dual arms

Will wave on spot — clear the area around the G1.

.. code-block:: bash

    ROS_DOMAIN_ID=10 ros2 action send_goal /g1_unit_001/dual_arm/follow_joint_trajectory control_msgs/action/FollowJointTrajectory "{
      trajectory: {
        joint_names: [
          \"left_shoulder_pitch\",\"left_shoulder_roll\",\"left_shoulder_yaw\",
          \"left_elbow\",\"left_wrist_roll\",\"left_wrist_pitch\",\"left_wrist_yaw\",
          \"right_shoulder_pitch\",\"right_shoulder_roll\",\"right_shoulder_yaw\",
          \"right_elbow\",\"right_wrist_roll\",\"right_wrist_pitch\",\"right_wrist_yaw\"
        ],
        points: [
          { positions: [0.0, 0.2, 0.0, 1.57, 0.0, 0.0, 0.0,   0.0, -0.2, 0.0, 1.57, 0.0, 0.0, 0.0],
            time_from_start: {sec: 2, nanosec: 0} },
          { positions: [0.0, 1.57, 1.57, -1.57, 0.0, 0.0, 0.0,   0.0, -1.57, -1.57, -1.57, 0.0, 0.0, 0.0],
            time_from_start: {sec: 4} },
          { positions: [0.0, 1.57, 1.57, -1.0, 0.0, 0.0, 0.0,   0.0, -1.57, -1.57, -1.0, 0.0, 0.0, 0.0],
            time_from_start: {sec: 6} },
          { positions: [0.0, 1.57, 1.57, -1.57, 0.0, 0.0, 0.0,   0.0, -1.57, -1.57, -1.57, 0.0, 0.0, 0.0],
            time_from_start: {sec: 8} },
          { positions: [0.0, 1.57, 1.57, -1.0, 0.0, 0.0, 0.0,   0.0, -1.57, -1.57, -1.0, 0.0, 0.0, 0.0],
            time_from_start: {sec: 10} },
          { positions: [0.0, 1.57, 1.57, -1.57, 0.0, 0.0, 0.0,   0.0, -1.57, -1.57, -1.57, 0.0, 0.0, 0.0],
            time_from_start: {sec: 12} },
          { positions: [0.0, 1.57, 1.57, -1.0, 0.0, 0.0, 0.0,   0.0, -1.57, -1.57, -1.0, 0.0, 0.0, 0.0],
            time_from_start: {sec: 14} },
          { positions: [0.0, 0.2, 0.0, 1.57, 0.0, 0.0, 0.0,   0.0, -0.2, 0.0, 1.57, 0.0, 0.0, 0.0],
            time_from_start: {sec: 16, nanosec: 0} }
        ]
      }
    }"

.. rubric:: Move left arm

.. code-block:: bash

    ROS_DOMAIN_ID=10 ros2 action send_goal /g1_unit_001/left_arm/follow_joint_trajectory \
      control_msgs/action/FollowJointTrajectory \
      "{trajectory: {
          joint_names: [
            left_shoulder_pitch, left_shoulder_roll, left_shoulder_yaw,
            left_elbow, left_wrist_roll, left_wrist_pitch, left_wrist_yaw
          ],
          points: [
            {positions: [0.0, 0.2, 0.0, 1.57, 0.0, 0.0, 0.0],
             time_from_start: {sec: 2, nanosec: 0} }
          ]}}"

.. rubric:: Move right arm

.. code-block:: bash

    ROS_DOMAIN_ID=10 ros2 action send_goal /g1_unit_001/right_arm/follow_joint_trajectory \
      control_msgs/action/FollowJointTrajectory \
      "{trajectory: {
          joint_names: [
            right_shoulder_pitch, right_shoulder_roll, right_shoulder_yaw,
            right_elbow, right_wrist_roll, right_wrist_pitch, right_wrist_yaw
          ],
          points: [
            {positions: [0.0, -0.2, 0.0, 1.57, 0.0, 0.0, 0.0],
             time_from_start: {sec: 2, nanosec: 0}}
          ]}}"