NVIDIA Jetson Setup
Setup routine and scripts for the ATMOS free-flyers’ onboard computers (OBC).
Jetson Setup
To make sure that these instructions can be followed by anyone, we will assume that the Jetson is running Ubuntu 22.04 on Jetpack 6. Then, install ROS2 Humble:
-
Follow installation instructions at https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html
-
Source ROS2 by default
echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc
Lastly, clone:
git clone https://github.com/DISCOWER/FF_OBC_Setup.git $HOME/FF_OBC_Setup
Set the hostname
- Change the hostname by replacing
<hostname>
with the desired name.sudo hostnamectl set-hostname <hostname>
- Edit the /etc/hosts file.
sudo vim /etc/hosts
Find the line that starts with 127.0.0.1 or 127.0.1.1 followed by the old hostname (probably discower) and change it to the new hostname. Save and close the file.
Set up ROS2 Workspace
Here we provide an example of a workspace setup for the PX4 communication and the vehicle’s odometry. Note that our interface was tested on a Qualisys motion capture setup using the repository in https://github.com/DISCOWER/motion_capture_system
. For motion capture systems with different coordinates, you may need to adjust the srl_vehicle_mocap_odom
package.
- Set up workspace. Clone and build required ros2 packages.
mkdir -p ~/discower_ws/src/ cd ~/discower_ws/src/ git clone git@github.com:DISCOWER/px4_msgs.git git clone git@github.com:DISCOWER/srl_vehicle_mocap_odom.git cd ~/discower_ws colcon build
Install Micro-XRCE-DDS-Agent
Install with snap-store
sudo snap install micro-xrce-dds-agent --edge
Add PX4 Rules for USB Mavlink interface
sudo cp $HOME/FF_OBC_Setup/rules/* /etc/udev/rules.d/
sudo udevadm control --reload-rules
sudo udevadm trigger
Add MAVProxy and Mavlink Router
Follow these instructions to install the mavlink-router:
sudo apt install git meson ninja-build pkg-config gcc g++ systemd
sudo pip3 install meson
git clone git@github.com:mavlink-router/mavlink-router.git ~/mavlink_router
cd ~/mavlink_router
git submodule update --init --recursive
meson setup build .
sudo ninja -C build install
sudo mkdir -p /etc/mavlink-router/
sudo cp $HOME/FF_OBC_Setup/mavlink.conf/* /etc/mavlink-router/
Add the startup service
sudo cp $HOME/FF_OBC_Setup/services/* /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable px4_comm
sudo systemctl start px4_comm
sudo systemctl enable vehicle_mocap_odom
sudo systemctl start vehicle_mocap_odom
sudo systemctl enable mavlink_router
sudo systemctl start mavlink_router
Add a Static IP for the PX4 Ethernet
Set a static IP-address for the PX4 ethernet connection. This is done via NetworkManager on the onboard computer. We are using 192.168.0.1
.
-
Open a terminal and check existing network connections:
nmcli connection show
Identify the connection used for the PX4.
-
Open the connection’s configuration file in a text editor:
sudo vim /etc/NetworkManager/system-connections/<your-wired-connection>.nmconnection
Replace
<your-wired-connection>
with the actual connection name. -
Modify the configuration file to set a static IP. The settings should include:
[connection] id=<your-wired-connection> uuid=<generated-uuid> type=ethernet [ipv4] address1=192.168.0.1/24,192.168.0.254 method=manual [ipv6] addr-gen-mode=stable-privacy method=auto
-
Save the file and restart NetworkManager:
sudo systemctl restart NetworkManager
All set!
At this point, you can reboot the system and the services should start automatically. You can check if all ROS2 topics are available with:
ros2 topic list
The FMU topics should be populated. You can check if the communication is successful by subscribing to vehicle_attitude:
ros2 topic echo /fmu/out/vehicle_attitude
Lastly, on the Ground Control Station (a personal laptop, for instance), open QGC, add a TCP Comm Link to the IP of the vehicle (leave the port as default) and check for connection. QGC should report the vehicle status.