This repository includes the code for our 2022-2023 robot, codename Marvin.
- Clone the Package
- Dependencies
- Set Up Cartographer
- Build the Workspace
- Launch the Simulation
- Launch the Robot
- Control the Robot
Make sure you are in the src
folder of an existing catkin workspace.
git clone https://github.com/umigv/marvin.git
- ROS:
sudo apt install ros-noetic-desktop-full
- Xacro:
sudo apt install ros-noetic-xacro
- Gazebo (for simulation):
sudo apt install ros-noetic-gazebo-ros
- Rviz:
sudo apt-get install ros-noetic-rviz
- Required ROS Packages (clone each into
src
folder of catkin workspace for now, will set up proper dependencies later—there may be some missing dependencies which you will see when you runcatkin build
, just look up how to install them if so)controls_stack
: https://github.com/umigv/controls_stackcv_stack
: https://github.com/umigv/cv_stackros_imu_bno055
(custom): https://github.com/umigv/imu_driverrobot_localization
: https://github.com/cra-ros-pkg/robot_localizationcartographer
: https://github.com/cartographer-project/cartographercartographer_ros
: https://github.com/cartographer-project/cartographer_rosrosserial
: https://github.com/ros-drivers/rosserialvelodyne
: https://github.com/ros-drivers/velodynevelodyne_simulator
: (for simulation) https://bitbucket.org/DataspeedInc/velodyne_simulatorzed_ros_wrapper
(also need to install ZED SDK and CUDA—need an NVIDIA GPU): https://github.com/stereolabs/zed-ros-wrapperjoy
(for teleop): https://github.com/ros-drivers/joystick_driversteleop_twist_joy
(for teleop): https://github.com/ros-teleop/teleop_twist_joy
Comment out line 46 (<!-- <depend>libabsl-dev</depend> -->
) in Cartographer package.xml as per cartographer-project/cartographer_ros#1726.
Run these commands from the catkin workspace base folder (not src
).
# Install prerequisites
sudo apt update
sudo apt install -y python3-wstool python3-rosdep ninja-build
sudo apt install -y liblua5.3-dev python3-sphinx libeigen3-dev
sudo apt install -y stow
# Install Cartographer dependencies
src/cartographer/scripts/install_debs_cmake.sh
src/cartographer/scripts/install_abseil.sh
src/marvin/scripts/install_proto3_fixed.sh
# Install ROS dependencies
sudo rosdep init
rosdep update
rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y
catkin build
source devel/setup.bash # run this command from the catkin workspace base folder (not src)
# Launch just simulation with sensors in RVIZ (no Cartographer)
roslaunch marvin world.launch 2> >(grep -v -E 'TF_REPEATED_DATA|buffer_core|lookupTransform')
# Launch just simulation with no RVIZ (for running with Cartgrapher separately)
roslaunch marvin world_no_rviz.launch 2> >(grep -v -E 'TF_REPEATED_DATA|buffer_core|lookupTransform')
# Launch Cartographer
roslaunch marvin cartographer_sim.launch 2> >(grep -v -E 'TF_REPEATED_DATA|buffer_core|lookupTransform|at line|^$')
# Launch simulation together with Cartographer
roslaunch marvin sim.launch 2> >(grep -v -E 'TF_REPEATED_DATA|buffer_core|lookupTransform|at line|^$')
Make sure to plug in all of the following and check their ports:
- IMU (
/dev/ttyUSB0
) - Encoder Arduino (
/dev/ttyACM0
) - Motor Arduino (
/dev/ttyACM1
) - Velodyne LiDAR (ethernet)
- ZED Camera (USB)
roslaunch marvin marvin.launch
For both simulation and the real robot.
# Control using keyboard
rosrun marvin teleop_twist_keyboard.py
# Control using Dualshock 4 controller
rosrun marvin velocity.py