Welcome to Jetson Orin NANO Developer Kit repository
2.ROS2 install Jazzy
2. Installing ROS 2 Jazzy
ROS 2 Jazzy corresponds to Ubuntu 24.04. This tutorial uses Ubuntu 24.04 to install ROS 2 Jazzy.
The software sources, packages, and interfaces of different Ubuntu and ROS 2 versions may differ. Use the ROS 2 version that matches your system; do not simply replace the version name and run the commands directly.
The factory system already comes with the Jazzy ROS environment configured. This tutorial applies to a clean system.
1. Set the Locale
First check whether the local locale supports UTF-8 encoding. You can run the following command to check and set the UTF-8 encoding.
xlocale # Check whether UTF-8 is supported
sudo apt update && sudo apt install localessudo locale-gen en_US en_US.UTF-8sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8export LANG=en_US.UTF-8
locale # Verify that the setting is successfulNote: The locale can be different, but it must support UTF-8 encoding.
2. Set the Software Source
Start the Ubuntu universe repository.
xxxxxxxxxxsudo apt install software-properties-commonsudo add-apt-repository universeInstall the ROS 2 software source configuration package. This method automatically configures the GPG key and the software source matching the current Ubuntu version:
xxxxxxxxxxsudo apt update && sudo apt install curl -yexport ROS_APT_SOURCE_VERSION=$(curl -s https://api.github.com/repos/ros-infrastructure/ros-apt-source/releases/latest | grep -F 'tag_name' | awk -F\" '{print $4}')curl -L -o /tmp/ros2-apt-source.deb "https://github.com/ros-infrastructure/ros-apt-source/releases/download/${ROS_APT_SOURCE_VERSION}/ros2-apt-source_${ROS_APT_SOURCE_VERSION}.$(. /etc/os-release && echo ${VERSION_CODENAME})_all.deb"sudo dpkg -i /tmp/ros2-apt-source.debrm -f /tmp/ros2-apt-source.deb3. Install Jazzy
First, update the apt repository cache:
xxxxxxxxxxsudo apt updateThen upgrade the installed software (ROS 2 packages are built on the frequently updated Ubuntu system; make sure your system is up to date before installing new packages):
xxxxxxxxxxsudo apt upgradeInstall the desktop version of ROS 2 (recommended), which includes ROS, RViz2, examples, and tutorials:
xxxxxxxxxxsudo apt install ros-jazzy-desktop python3-argcompleteInstall the colcon build tool.
xxxxxxxxxxsudo apt install python3-colcon-common-extensions4. Configure the Environment
In a terminal, before running ROS 2 programs, you need to run the following command to configure the environment:
xxxxxxxxxxsource /opt/ros/jazzy/setup.bashYou have to run the above command every time you open a new terminal. Alternatively, you can run the following command to write the environment configuration command into the "~/.bashrc" file, so that you do not need to configure the environment manually each time you start a new terminal.
xxxxxxxxxxecho '[ -f /opt/ros/jazzy/setup.bash ] && source /opt/ros/jazzy/setup.bash' >> ~/.bashrcAfter reopening the terminal, use the following commands to check the environment:
xxxxxxxxxxecho $ROS_DISTROcommand -v ros2You should see jazzy and /opt/ros/jazzy/bin/ros2 respectively. If you also set PYTHONPATH, do not overwrite the ROS 2 Python package search path; appending is recommended, for example:
xxxxxxxxxxexport PYTHONPATH="/home/jetson/jetcam${PYTHONPATH:+:$PYTHONPATH}"At this point, ROS 2 has been installed and configured.
5. Run the Publisher and Subscriber Example Nodes
The ROS 2 desktop version has integrated some example nodes. You can test whether ROS 2 is installed successfully by running the example nodes.
Run the publisher node
xxxxxxxxxxros2 run demo_nodes_cpp talkerRun the subscriber node
xxxxxxxxxxros2 run demo_nodes_cpp listener6. Run and Experience the Turtle Case
The turtle simulator turtlesim is a classic teaching tool in ROS. Through turtlesim, you can quickly understand the core concepts in ROS.
Run the turtle simulator
xxxxxxxxxxros2 run turtlesim turtlesim_nodeRun the keyboard control node
xxxxxxxxxxros2 run turtlesim turtle_teleop_keyView the velocity topic data
xxxxxxxxxxros2 topic echo /turtle1/cmd_vel