ROS packages for the Mechatronics and Robotics Society at the University of Virginia.
These packages are installed on the team's robot.
- actions: handles motor routines like raising bucket ladder, digging, etc.
- hero_board: communication between the hero board and the jetson
- navigation: used for autonomous navigation
To run ROS nodes on the robot and connect to them from the control station, navigate to the root directory of this project and run
source start1.sh
in one terminal and source start2.sh
in another. Note that you must run start2.sh
with source
instead of via ./start2.sh
in order to connect to the ROS core on the Jetson after the script runs.
Once these ROS packages are built and sourced, any nodes in them can be run like any other ROS node. However, we recommend using the code via the launch files we have created.
The navigation/launch/malvi_config.launch
launch file is used to start the robot. Refer to the launch file for possible parameters.
roslaunch navigation malvi_config.launch
We have provided several other launch files for running other ROS nodes outside the typical robot-control use case.
Runs nodes to start an RP LiDAR and Intel Realsense Tracking Camera T265 that will be mounted on the robot.
roslaunch navigation lidar-and-tracking.launch
For a consistent production environment, we deploy our ROS code in Docker containers. These containers install ROS, set up required packages, and run one of the aforementioned launch files.
The main Docker image (which can be built using Dockerfile
) runs our main launch file, navigation/launch/malvi_config.launch
.
Build:
docker build . -t mars-ros
Run:
docker run --rm -it --network host mars-ros
Runs the navigation/launch/lidar-and-tracking.launch
launch file.
Build:
docker build . -t mars-lidar-and-tracking -f Docker.lidar_and_tracking
Run:
docker run --rm -it --network host --volume=/dev:/dev --privileged mars-lidar-and-tracking
The USB devices for the camera and LiDAR must be passed through to the container. Due to a quirk of the tracking camera where it is only recognized after its ROS node is started, we must mount /dev on the host to /dev in the container.
Because this repository uses submodules, care must be taken when pulling/pushing. To clone this repository, you need to add the --recursive
flag:
git clone --recursive https://github.com/MARS-UVA/mars-ros.git
If you forgot the --recursive
flag, you need to run submodule init
manually after cloning
git submodule update --init
To pull changes from the remote, you need to run two commands
git pull
git submodule update --init
When developing for specific packages, you do not need to compile all other packages. You can specify the name of the packages you want to build as arguments.
VSCode remote development works well. However, for the Python/C++ language extension to work, you need to tweak some settings.
Microsoft Python Language Server does not support arm64. Therefore, you need to add "python.jediEnabled": true
to the workspace settings
Microsoft C++ extension does not support arm64. You need to install the vscode-clangd
plugin from llvm instead. Follow the plugin README to get started?
If you need to compile all packages, refer to the compile guide
All performed in ~/catkin_ws/
- Generate a dependency list with rosinstall_generator:
rosinstall_generator $(cat ~/mars-ros/packages.txt) --rosdistro noetic --deps --wet-only --tar > wet1.rosinstall
- Install ROS dependencies with wstool
- If it's the first time running wstool, use
wstool init -j4 -t src wet1.rosinstall
- If you're updating the list of packages, use
wstool merge -t src wetX.rosinstall
thenwstool update -j4 -t src
- If it's the first time running wstool, use
- Install system dependencies:
rosdep install -y --from-paths src --ignore-src --rosdistro noetic -r --os=ubuntu:bionic
- Build packages:
sudo src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/noetic -j4 -DPYTHON_EXECUTABLE=/usr/bin/python3
- To build specific packages, add on
--pkg package1 package2
- To build specific packages, add on