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

Auto Startup Services
---------------------

The B2W uses ``robot_upstart`` to manage ROS 2 nodes as systemd services.

Service Overview
^^^^^^^^^^^^^^^^

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

   * - Service Name
     - Description
   * - b2-hardware
     - Core hardware interface (driver, camera, LiDAR, Dynamixel)
   * - b2-webserver
     - Web interface for remote control

Checking Service Status
^^^^^^^^^^^^^^^^^^^^^^^

.. code-block:: bash

   # Check service status
   systemctl status b2-hardware
   systemctl status b2-webserver

   # View logs
   journalctl -u b2-hardware -f

Managing Services
^^^^^^^^^^^^^^^^^

.. code-block:: bash

   # Stop service
   sudo systemctl stop b2-hardware

   # Start service
   sudo systemctl start b2-hardware

   # Restart service
   sudo systemctl restart b2-hardware

   # Disable auto-start
   sudo systemctl disable b2-hardware

   # Enable auto-start
   sudo systemctl enable b2-hardware

Creating New Services
^^^^^^^^^^^^^^^^^^^^^

Use the ``robot_upstart`` package:

.. code-block:: bash

   ros2 run robot_upstart install b2_bringup/launch/hardware.launch.py \
     --job b2-hardware \
     --rmw rmw_cyclonedds_cpp \
     --symlink

Uninstalling Services
^^^^^^^^^^^^^^^^^^^^^

.. code-block:: bash

   ros2 run robot_upstart uninstall b2-hardware
