
This section covers the installation procedures for the B2W system.

.. note::
   This should already be configured by the MYBOTSHOP team.

B2 Nvidia (Robot)
-----------------

1. Create workspace:

.. code-block:: bash

   sudo hostnamectl set-hostname b2-unit-366
   sudo mkdir /opt/mybotshop
   sudo chown -R unitree:unitree /opt/mybotshop

2. Set timezone:

.. code-block:: bash

   sudo timedatectl set-timezone Europe/Berlin
   sudo date -s "$(wget --method=HEAD -qSO- \
     --max-redirect=0 google.com 2>&1 | \
     sed -n 's/^ *Date: *//p')"

3. Run installer:

.. code-block:: bash

   cd /opt/mybotshop/src/mybotshop
   ./b2_install.bash

4. Build workspace:

.. code-block:: bash

   cd /opt/mybotshop
   colcon build --symlink-install
   source install/setup.bash

5. Add to ``.bashrc``:

.. code-block:: bash

   source /opt/ros/humble/setup.bash
   source /opt/mybotshop/src/mybotshop/b2_bringup/config/setup.bash

6. Install services:

.. code-block:: bash

   ros2 run b2_bringup startup_installer.py

7. Configure secondary IP for camera stream:

.. code-block:: bash

   sudo nano /etc/netplan/01-network-manager-all.yaml

Add the following configuration:

.. code-block:: yaml

   network:
     version: 2
     renderer: NetworkManager
     ethernets:
       eth0:
         dhcp4: false
         addresses: [192.168.123.164/24,192.168.123.170/24]
         nameservers:
           addresses: [114.114.114.114,8.8.8.8]

Apply the configuration:

.. code-block:: bash

   sudo netplan apply

Host PC
-------

1. Source ROS and build:

.. code-block:: bash

   source /opt/ros/humble/setup.bash
   colcon build --symlink-install

2. Configure network:

Connect to 192.168.123.x network with static IP:

- **Address:** 192.168.123.51
- **Netmask:** 24

3. Source setup:

.. code-block:: bash

   source /opt/mybotshop/src/mybotshop/b2_bringup/config/setup.bash

4. Verify connection:

.. code-block:: bash

   ping 192.168.123.164
   ssh -X unitree@192.168.123.164
   # Password: Unitree0408

Sync Host Computer to Robot
---------------------------

To sync your development workspace to the robot:

.. code-block:: bash

   rsync -avP -t --delete -e ssh src \
     unitree@192.168.123.164:/opt/mybotshop
