Autonomous Motorsports Purdue's software stack for the go-kart which will race in the Autonomous Karting Series. It is built on top of ROS2 Foxy as it is the latest, and last, ROS2 distro that can run natively on the team's NVIDIA Xavier NX computer running Ubuntu 20.04, which is limited by the distro packaged with Jetpack: JetPack SDK 5.0.2.
NOTE: This repository is a ROS workspace.
Make sure ROS2 Foxy is installed in your system and you have the proper environment setup.
NOTE: Laptops without an NVIDIA GPU or a compatible CUDA version you will not be able to install the ZED SDK, which is required to interact with the ZED stereo camera.
Clone the repo (change the link to an SSH link if you have SSH keys setup):
git clone https://github.com/Autonomous-Motorsports-Purdue/AMP_ASSV3.git
cd AMP_ASSV3
Initialize the submodules:
# Clone the submodule to get micro-ros
git submodule update --init src/micro-ros-setup/
# Clone the submodule to get the ZED ROS2 wrapper, do not install if you
# do not have the ZED SDK installed.
git submodule update --init src/zed-ros2-wrapper/
Setting up pre-commit
The project has a pre-commit setup to allow consistent code formatting and good practices throughout the repo. Code reviews via pull requests will still be used to make sure that the changes being made are proper.
Follow installation instructions for pre-commit
here.
Then, run:
pre-commit install --install-hooks
Now whenever you commit changes, pre-commit
will run formatters and clean up
your code. Remember to add the changes made by it when you commit!
rosdep update
rosdep install --from-paths src -iry
colcon build --symlink-install
Run the setup-micro-ros-agent.sh
script to install and build the
micro-ros-agent
:
./scripts/setup-micro-ros-agent.sh
To setup the environment, source the local_setup
script, and run the launch
file.
source install/local_setup.bash
export TURTLEBOT3_MODEL=waffle
export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:/opt/ros/foxy/share/turtlebot3_gazebo/models
ros2 launch amp_kart_simulate purdue_gp_simulation.launch.py
Under src
, on clone, there should be 7 modules (8 when micro-ros-agent is setup):
src/amp_kart_bringup
src/amp_kart_bt_navigator
src/amp_kart_description
src/amp_kart_simulate
src/amp_launch_tests
src/micro-ros-setup
src/patchwork-plusplus-ros
src/zed-ros2-wrapper
Design docs for the major components under construction.