This repository provides the tools and instructions necessary to simulate and control an AWS Deepracer using ROS2 on Ubuntu 20.04. It includes integration with PyBullet for physics-based simulations.
- Object models sourced from ChenEating716/pybullet-URDF-models.
- AWS Deepracer models and details from aws-deepracer.
This guide will help you set up the necessary environment for working with ROS2 Foxy.
-
Update your package list:
sudo apt update
-
Install ROS2 Foxy Base and other necessary packages:
sudo apt install ros-foxy-ros-base python3-argcomplete
-
Install
colcon, a command line tool to build ROS2 packages:sudo apt install python3-colcon-common-extensions
-
Install build essential tools:
sudo apt install build-essential
-
Install Gazebo, a robust simulator for robotic applications:
sudo apt install gazebo11 libgazebo11-dev
-
Install ROS packages for Gazebo:
sudo apt install ros-foxy-gazebo-ros-pkgs
-
Install Python pip:
sudo apt install python3-pip
-
Open your
.bashrcfile for editing:nano ~/.bashrc -
Add Gazebo and ROS2 to your environment setup:
echo "source /usr/share/gazebo/setup.sh" >> ~/.bashrc echo "source /opt/ros/foxy/setup.bash" >> ~/.bashrc
-
Set the ROS Domain ID (useful for running multiple ROS2 applications within the same network):
echo "export ROS_DOMAIN_ID=0" >> ~/.bashrc
-
Reload your
.bashrcto apply the changes:source ~/.bashrc
Install necessary Python libraries for running simulations:
-
Install PyBullet, a Python module for physics simulation in robotics, games, and animations:
pip3 install pybullet
-
Upgrade NumPy, a fundamental package needed for scientific computing with Python:
pip3 install --upgrade numpy
-
Install transforms3d, a library to manage three-dimensional geometric transformations:
pip3 install transforms3d
-
Install Matplotlib, a plotting library for Python and its numerical extension NumPy:
pip3 install matplotlib
After completing these steps, your system should be ready to run ROS2 Foxy simulations in conjunction with Gazebo and other necessary Python libraries.
- To start a simulation with the AWS Deepracer:
ros2 run deepracer_nodes bullet_one_camera
- To control the Deepracer using the keyboard, execute:
ros2 run teleop_twist_keyboard teleop_twist_keyboard
-
List all active ROS topics with:
ros2 topic list
-
To view the output of a specific topic in real-time:
ros2 topic echo <topic name>
