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
Turn the UiAbot on, and connect to keyboard, mouse, and monitor.
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
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
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)
On your pc, make sure you are on the same wi-fi as the UiAbot from the previous section.
Connect to the UiAbot with SSH.
ssh jetson@<ip_address>
Use these credentials to log in.
Username: jetsonPassword: jetson
Automatic Sourcing
Set up .bashrc
on UiAbot
Add usb access.
echo "sudo chmod 666 /dev/ttyUSB0" >> /home/jetson/.bashrc
Add
ROS_DOMAIN_ID
. Change5
to your uiabot number,echo "export ROS_DOMAIN_ID=5" >> /home/jetson/.bashrc # Or use the uiabot # you have!
Install and add
sl
.sudo apt install sl -y && echo "sl" >> /home/jetson/.bashrc
Automatic Sourcing:
echo "source /home/jetson/uiabot_ws/install/local_setup.bash" >> ~/.bashrc echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc
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
Install the following third-party software:
- On UiAbot:
ROS 2 Humble: Installation Guide
odrivetool: Installation Guide
- On Remote PC:
ROS 2 Humble: Installation Guide (Ubuntu 22.04 PC)
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
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
Enter the workspace
src
directory.cd /home/jetson/uiabot_ws/src
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
Return to the workspace root.
cd /home/jetson/uiabot_ws
Source the ROS 2 installation.
source /opt/ros/humble/setup.bash
Build workspace.
colcon build
Configuring ODrive
Configuration
Launch odrivetool
odrivetool
Current limit
odrv0.axis0.motor.config.current_lim = 10 odrv0.axis1.motor.config.current_lim = 10
Velocity limit
odrv0.axis0.controller.config.vel_limit = 5 odrv0.axis1.controller.config.vel_limit = 5
Enable brake resistor
odrv0.config.enable_brake_resistor = True
Brake restance value
odrv0.config.brake_resistance = 0.05
Pole pairs
odrv0.axis0.motor.config.pole_pairs = 7 odrv0.axis1.motor.config.pole_pairs = 7
Torque constant
odrv0.axis0.motor.config.torque_constant = 8.27/270 odrv0.axis1.motor.config.torque_constant = 8.27/270
Calibrate motors
odrv0.axis0.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE odrv0.axis1.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE
Velocity control
odrv0.axis0.controller.config.control_mode = CONTROL_MODE_VELOCITY_CONTROL odrv0.axis1.controller.config.control_mode = CONTROL_MODE_VELOCITY_CONTROL
Save configuration
odrv0.save_configuration()
Testing and Troubleshooting
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
Dump errors
dump_errors(odrv0)
3.Clear errors
odrv0.clear_errors()