Installation and Setup

This page will walk you through the required steps to get the UiAbot set up with the correct software and settings.

Warning

It is important to follow each step carefully to avoid compatability problems later, and to understand the commands.

NVIDIA Jetson SBC

Operating System

The operating system utilized on the Jetson Nano is a standard JetPack image installed via NVIDIA’s SDK Manager. This installation includes Ubuntu 22.04 along with the comprehensive NVIDIA development toolkit and essential packages for computer vision, machine learning, and artificial intelligence applications.

Setting up Wi-Fi

  1. Turn the UiAbot on, and connect to keyboard, mouse, and monitor.

  2. On the jetson log in to the desired wi-fi, and check if your internet connection.

    ping google.com
    

    If you do not get this response, you are not connected to the internet.

    jetson@jetson:~$ ping google.com
    PING google.com (142.250.74.110) 56(84) bytes of data.
    64 bytes from arn11s10-in-f14.1e100.net (142.250.74.110): icmp_seq=1 ttl=54 time=28.6 ms
    64 bytes from arn11s10-in-f14.1e100.net (142.250.74.110): icmp_seq=2 ttl=54 time=33.5 ms
    64 bytes from arn11s10-in-f14.1e100.net (142.250.74.110): icmp_seq=3 ttl=54 time=32.8 ms
    
  3. Print your ip-address, and write it down. It will be needed later.

    ip -br a
    

    It should return something like this.

    jetson@jetson:~$ ip -br a
    lo               UNKNOWN        127.0.0.1/8 ::1/128
    enp2s0f0         DOWN
    enp5s0           DOWN
    wlp3s0           UP             <ip_address>/24 fe80::f9d3:4190:d73:2118/64
    
  4. Now, unplug the keyboard, mouse, and monitor.

Remote PC

Its recomended to use a Ubuntu 22.04 operating system with ROS 2 Humble installed. The installation guide can be found here.

Connecting to UiAbot (SSH)

  1. On your pc, make sure you are on the same wi-fi as the UiAbot from the previous section.

  2. Connect to the UiAbot with SSH.

    ssh jetson@<ip_address>
    
  3. Use these credentials to log in.

    Username: jetson
    Password: jetson

Automatic Sourcing

Set up .bashrc on UiAbot

  1. Add usb access.

    echo "sudo chmod 666 /dev/ttyUSB0" >> /home/jetson/.bashrc
    
  2. Add ROS_DOMAIN_ID. Change 5 to your uiabot number,

    echo "export ROS_DOMAIN_ID=5" >> /home/jetson/.bashrc # Or use the uiabot # you have!
    
  3. Install and add sl.

    sudo apt install sl -y && echo "sl" >> /home/jetson/.bashrc
    
  4. Automatic Sourcing:

    echo "source /home/jetson/uiabot_ws/install/local_setup.bash" >> ~/.bashrc
    echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc
    
  5. Source to update changes.

    source /home/jetson/.bashrc
    

Set up .bashrc on Remote PC

Automatic Sourcing: To make the process of sourcing the ROS 2 and workspace setup files easier, you can add the commands to your shell configuration file. This will ensure that the required environments are sourced automatically.

echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc
echo "source ~/uiabot_ws/install/setup.bash" >> ~/.bashrc
echo "export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp" >> ~/.bashrc
echo "export ROS_DOMAIN_ID=5" >> ~/.bashrc # Or use the uiabot # you have!
source ~/.bashrc

Install third-party software

  1. Install the following third-party software:

    On UiAbot:
    On Remote PC:
  2. Install the following third-party ROS 2 packages.

    • rplidar_ros (src)

      sudo apt install ros-humble-rplidar-ros -y
      
    • robot_localization (src)

      sudo apt install ros-humble-robot-localization -y
      
    • slam_toolbox (src)

      sudo apt install ros-humble-slam-toolbox -y
      
    • nav2 (src)

      sudo apt install ros-humble-navigation2 -y
      sudo apt install ros-humble-nav2-bringup -y
      
    • Other dependencies

      sudo apt install ros-humble-xacro
      sudo apt install ros-humble-teleop-twist-joy ros-humble-joy
      

ROS 2 configuration

Create workspace

  1. Create a workspace in the home folder and call it uiabot_ws.

    cd /home/jetson
    mkdir -p uiabot_ws/src
    

The jetson directory should now look like this.

jetson
├── Desktop
├── Documents
├── Downloads
├── Pictures
└── uiabot_ws <-- this is our workspace
    └── src   <-- all our ROS 2 packages goes here

Install developed software

  1. Enter the workspace src directory.

    cd /home/jetson/uiabot_ws/src
    
  2. Download the following packages.

    • bno055_i2c_ros2 (src)

      git clone https://github.com/DrDanielh/bno055-i2c-ros2.git -b v1.0.0
      
    • odrive_ros2 (src)

      git clone https://github.com/DrDanielh/odrive-ros2.git -b v1.0.0
      
    • odrive_interfaces (src)

      git clone https://github.com/DrDanielh/odrive-interfaces.git -b v1.0.0
      
    • uiabot (src)

      git clone https://github.com/DrDanielh/uiabot-ros2.git -b v1.0.0
      cp -r /path/to/cloned/repo/config ~/.rviz2/
      

The src directory should now look like this.

src
├── bno055-i2c-ros2
├── odrive-interfaces
├── odrive-ros2
└── uiabot-ros2

Build the workspace

  1. Return to the workspace root.

    cd /home/jetson/uiabot_ws
    
  2. Source the ROS 2 installation.

    source /opt/ros/humble/setup.bash
    
  3. Build workspace.

    colcon build
    

Configuring ODrive

Configuration

  1. Launch odrivetool

    odrivetool
    
  2. Current limit

    odrv0.axis0.motor.config.current_lim = 10
    odrv0.axis1.motor.config.current_lim = 10
    
  3. Velocity limit

    odrv0.axis0.controller.config.vel_limit = 5
    odrv0.axis1.controller.config.vel_limit = 5
    
  1. Enable brake resistor

    odrv0.config.enable_brake_resistor = True
    
  2. Brake restance value

    odrv0.config.brake_resistance = 0.05
    
  3. Pole pairs

    odrv0.axis0.motor.config.pole_pairs = 7
    odrv0.axis1.motor.config.pole_pairs = 7
    
  4. Torque constant

    odrv0.axis0.motor.config.torque_constant = 8.27/270
    odrv0.axis1.motor.config.torque_constant = 8.27/270
    
  1. Calibrate motors

    odrv0.axis0.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE
    odrv0.axis1.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE
    
  2. Velocity control

    odrv0.axis0.controller.config.control_mode = CONTROL_MODE_VELOCITY_CONTROL
    odrv0.axis1.controller.config.control_mode = CONTROL_MODE_VELOCITY_CONTROL
    
  3. Save configuration

    odrv0.save_configuration()
    

Testing and Troubleshooting

  1. Request closed-loop control

    odrv0.axis0.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL
    odrv0.axis1.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL
    
    odrv0.axis0.controller.input_vel = 1
    odrv0.axis1.controller.input_vel = 1
    
  2. Dump errors

    dump_errors(odrv0)
    

3.Clear errors

odrv0.clear_errors()