Welcome to Jetson AGX Thor repository
2.ROS2 install Jazzy
2. Installing ROS 2 Jazzy
- The corresponding Ubuntu system for ROS 2 Jazzy is version 24.04.
- If you need to install a different version of ROS 2, simply replace the Jazzy version identifier within the relevant installation commands with the specific version you require. This approach applies to all software specific to other ROS versions covered throughout this ROS 2 tutorial series; these instructions will not be repeated in subsequent tutorials. ## 1. Set Locale
Please first check whether your local environment supports UTF-8 encoding. You can use the following commands to check for and set UTF-8 encoding:
xxxxxxxxxxlocale # Check if UTF-8 is supportedsudo 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-8locale # Verify if the setting was successfulNote: The specific locale settings may vary, but they must support UTF-8 encoding.
2. Set Up Software Sources
Enable the Ubuntu universe repository:
xxxxxxxxxxsudo apt install software-properties-commonsudo add-apt-repository universeAdd the ROS 2 APT repository to your system and authorize our GPG key using APT:
xxxxxxxxxxsudo apt update && sudo apt install curl gnupg lsb-release -ysudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpgAdd the repository to your source list:
xxxxxxxxxxecho "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(source /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
3. Install Jazzy
First, update your APT repository cache:
xxxxxxxxxxsudo apt updateThen, upgrade your installed software (ROS 2 packages are built upon a frequently updated Ubuntu system; please ensure your system is up-to-date before installing new packages):
xxxxxxxxxxsudo apt upgradeInstall the Desktop version of ROS 2 (recommended). This includes: ROS, RViz, examples, and tutorials. The installation command is as follows; if you need to install a different version, replace jazzy in the command below with the corresponding version name:
xxxxxxxxxxsudo apt install ros-jazzy-desktop python3-argcompleteInstall the colcon build tools
xxxxxxxxxxsudo apt install python3-colcon-common-extensions
4. Configure the Environment
- If you are using a different version of ROS 2, replace the
jazzyversion identifier with the corresponding version—for example, for thehumbleversion, replacejazzywithhumblein the commands.
When executing ROS 2 programs in the terminal, you need to run the following command to configure the environment:
xxxxxxxxxxsource /opt/ros/jazzy/setup.bashYou must run the command above every time you open a new terminal. Alternatively, you can execute the following command to write the environment configuration instruction to the ~/.bashrc file; this way, you will no longer need to manually configure the environment every time you launch a new terminal.
xxxxxxxxxxecho "source /opt/ros/jazzy/setup.bash" >> ~/.bashrcAt this point, ROS 2 has been successfully installed and configured.
5. Running Publisher and Subscriber Example Nodes
The ROS 2 Desktop installation comes pre-integrated with several example nodes. We can run these examples to verify whether ROS 2 has been successfully installed.
- Run the publisher node:
xxxxxxxxxxros2 run demo_nodes_cpp talker- Run the subscriber node:
xxxxxxxxxxros2 run demo_nodes_cpp listener
6. Running the Turtlesim Demo
The turtle simulator, turtlesim, is a classic educational tool in ROS. Through turtlesim, users can quickly grasp core concepts within ROS.
- Run the turtle simulator:
xxxxxxxxxxros2 run turtlesim turtlesim_node- Run the keyboard teleoperation node:
xxxxxxxxxxros2 run turtlesim turtle_teleop_key- View velocity topic data:
xxxxxxxxxxros2 topic echo /turtle1/cmd_vel
7. Uninstallation
Once ROS 2 has been installed, if you wish to uninstall it, you can execute the following command:
xxxxxxxxxxsudo apt remove ~nros-jazzy-* && sudo apt autoremoveYou may also remove the corresponding ROS 2 repositories:
xxxxxxxxxxsudo rm /etc/apt/sources.list.d/ros2.listsudo apt updatesudo apt autoremove