Robot Interface
===============

Instructions for interfacing with the robot using **Ubuntu 22.04** and **ROS2 Humble**.

.. important::

    This procedure should be followed after reading the manuals for the Clearpath Husky
    as well as the Universal Robots UR5e. Furthermore, all of the Husky’s functionality can be verified
    via the tutorials by Clearpath. Instructions for set up can be found at `Husky Docs <https://docs.clearpathrobotics.com/docs/ros/>`__ .
    

.. figure:: media/pictures/husky_be/interface.png
   :width: 100%
   :align: center
   :class: mbsrounded 

   The Ethernet port at the back of the Husky can be utilized for setting up communication via LAN.

Static Network Connection
-------------------------

For the first time, one needs to connect through a **LAN** cable to configure the robot’s network. To create a static connection in your PC (not the robots), in 
Ubuntu go to Settings → **Network** then click on **+** and create a new connection.

1. Change the connection to **Manual** in the **IPv4** settings.
2. Set the **Address** IP as **192.168.131.51** and the **Netmask** as 24.
3. Click save and restart your network.

After a successful connection, check the host’s local IP by typing in the Host PC’s terminal:

.. code:: bash

    ifconfig

Now, ping the robot:

.. code:: bash

    ping 192.168.131.1

Access the robot via SSH:

.. code:: bash

    ssh -X administrator@192.168.131.1

The default password is:

mybotshop

Husky IP Addresses
------------------

+------------------+-----------------------+------------+
| Device           | IP Address            | Password   |
+==================+=======================+============+
| Husky MCU        | 192.168.131.1         | mybotshop  |
+------------------+-----------------------+------------+
| Husky Nvidia     | 192.168.131.4         | mybotshop  |
+------------------+-----------------------+------------+
| Router           | 192.168.131.100       | mybotshop  |
+------------------+-----------------------+------------+
| UR5e             | 192.168.131.5         |     X      |
+------------------+-----------------------+------------+
| Husky Hokuyo     | 192.168.131.21        |     X      |
+------------------+-----------------------+------------+

.. note:: 

    Sometimes other networks can cause disruptions when connecting to the Husky. It is best to have only your connection to the robot active and all others inactive.