Skip to content

yf-zhou/Caffeine

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Caffeine on ROS

This project runs on ROS noetic for Ubuntu 20.04 LTS. Caffeine is a robot being built to compete in IGVC.

Setting up the ROS Environment

Install Ubuntu 20.04 LTS

This is dependent on what OS and computer is currently used. The wiki has a section on how to dual boot.

Install ROS Noetic

The following instructions are taken from the ROS wiki install noetic page:

# Configure Ubuntu repositories
sudo add-apt-repository universe
sudo add-apt-repository multiverse
sudo add-apt-repository restricted

# Set up sources.list
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'

# Set up keys
sudo apt install curl
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -

# Noetic Desktop-Full Install
sudo apt install ros-noetic-desktop-full

# Environment setup
echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
source ~/.bashrc

# Dependencies for buiding packages
sudo apt install python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential
sudo rosdep init
rosdep update

Install the Navigation Package

Provides the Navigation Stack package which is used for autonomous navigation.

sudo apt-get install ros-noetic-navigation

Install RVIZ Plugins

Provides the RVIZ Sensor Plugins package which is used for RVIZ data visualization

sudo apt-get install ros-noetic-rviz-imu-plugin

Install Robot Localization

Provides the Robot Localization package which is used for localizing the robot.

sudo apt-get install ros-noetic-robot-localization

Install RTAB Map

Provides the rtabmap_ros package which is used for performing RGB-D SLAM.

sudo apt-get install ros-noetic-rtabmap-ros

Install IMU dependencies

Provides the phidgets_imu package dependencies which is used for publishing data from a phidget IMU.

sudo apt-get install ros-noetic-imu-transformer
sudo apt-get install ros-noetic-imu-filter-madgwick

Install Hector Gazebo Plugins

Provides the Hector Gazebo Plugins package for our GPS

sudo apt-get install ros-noetic-hector-gazebo-plugins

Install IGVC World

Custom built world(s) representing the IGVC competition can be found in the /worlds package. To install them for use in the Gazebo simulator, run the ./install_models.sh script found in the /worlds/models folder.

NOTE: The install script copies specific contents of /worlds/models to ~/.gazebo/models

Installing CV dependencies

The cv pipeline has several pip dependencies that need to be installed for both python 2 and python 3. Run the following commands.

pip3 install onnx onnxruntime opencv-python rospkg scikit-learn scipy

Cloning this repository

Before cloning this repository, create a ROS workspace:

mkdir -p caffeine-ws/src
cd caffeine-ws
catkin_make

After, clone this repository into the /src folder.

Cleaning the ROS Workspace

Every once in a while it is necessary to clear unnecesary logs that are saved from tests that have been run. These logs can quickly add up to the GB range, and can slow down ROS. To check how many logs you have run:

rosclean check

This should give you how much memory is consumed by logs. If nothing is returned you have no logs.

To delete logs run:

rosclean purge

Verification

Here are the common commands we run that will verify that your setup is correct (after performing catkin_make in any terminal once and source devel/setup.bash in every terminal you use)

# Terminal 1: Gazebo (World+Robot Simulation With GUI)
roslaunch description simulate.launch use_gui:=true

# Terminal 2: RVIZ (Data Visualization)
roslaunch description view.launch

# Terminal 3: move_base (Navigation Stack)
roslaunch nav_stack move_base.launch

After running all 3 commands, set a 2d Nav Goal in RVIZ, and if your robot moves in both Gazebo and RVIZ, you are good

Other Launch Files

# To launch the CV Pipeline
roslaunch cv pipeline.launch

# To activate auto-navigation 
roslaunch load_waypoints load_waypoints.launch 

# To use teleop to manually control caffeine's movement
roslaunch teleop_twist_keyboard keyboard_teleop.launch

Notes

When running simulate.launch, an error saying that the spawn_model node failed will appear. This occurs because both the gazebo world and the urdf are loaded in the same roslaunch file (IGVC takes too long to load before model is spawned). The spawner will automatically retry and spawn Caffeine properly, so this error can be safely ignored.

A solution is to spawn Caffeine only once the gazebo (IGVC) world has been loaded, but this requires a new roslaunch file and thus a new terminal - which is excessive at this point.


UTRA logo

University of Toronto Robotics Association

Autonomous Rover Team

About

Caffeine on ROS for IGVC

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Makefile 47.9%
  • CMake 14.6%
  • C++ 14.3%
  • Python 11.1%
  • C 10.9%
  • CSS 0.7%
  • Other 0.5%