
.. warning::
   ROS 2 Foxy Fitzroy reached end-of-life in June 2023. We recommend upgrading to ROS 2 Humble for continued support.

Teleoperation
-------------

The B2W supports multiple teleoperation methods.

Gamepad Control
^^^^^^^^^^^^^^^

The default controller is mapped for Xbox-compatible gamepads:

.. list-table::
   :header-rows: 1
   :widths: 30 50

   * - Input
     - Action
   * - Left Stick
     - Linear velocity (forward/backward, strafe)
   * - Right Stick
     - Angular velocity (rotation)
   * - A Button
     - Stand up
   * - B Button
     - Sit down
   * - X Button
     - Recovery mode
   * - Y Button
     - Toggle gait mode

Launch teleop node:

.. code-block:: bash

   ros2 launch b2_bringup teleop.launch.py

Keyboard Control
^^^^^^^^^^^^^^^^

For keyboard teleoperation:

.. code-block:: bash

   ros2 run teleop_twist_keyboard teleop_twist_keyboard \
     --ros-args --remap cmd_vel:=/b2_unit_001/cmd_vel

Webserver Control
^^^^^^^^^^^^^^^^^

Use the built-in webserver joystick at:

.. code-block:: text

   http://192.168.123.164:8080

Velocity Commands
^^^^^^^^^^^^^^^^^

The B2W accepts standard Twist messages:

.. code-block:: bash

   ros2 topic pub /b2_unit_001/cmd_vel geometry_msgs/msg/Twist \
     "{linear: {x: 0.5, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0, z: 0.3}}"
