This repository contains the implementation of the ROSbot reactive planner. Code is written using Python, C++ and ROS. Later stages of this repository describe, in detail, how to rebuild the environment which was used for testing the system. For performance evaluation, the Gazebo simulator environment was used. The goal of this project was to autonomously drive from starting line, to finishing, as fast as possible.
Reactive planner design illustration. Specifically, this is a finite state machine model.
Sensor data points outlined in RVis. Lidar data represented as yellow points and infra-red, as grey cones (two front and two rear).
Discretisation of Lidar data method illustrated below.
Examples of dithering presented below (where ROSbot gets stuck moving between two points).
Examples of four routes which the ROSbot would take (those of which varied based on the starting position of the ROSbot).
- rosrun rosbot_bath run_rosbot.sh
- rosrun rosbot_oah33 run_all.sh
This repository contains all the relevant configurations which a user will need for successfully setting up ROS, C++ and Python (with debugging) on Visual Studio Code. VS Code provides users with debugging and syntax suggestions/ support as well as github and ROS environment making it a powerful and effective tool for robotics software development. Before going throught the VS Code configuration steps, the user should install the following versions of the below (or similar, read documentation if unclear).
- ROS Noetic (see 'Setting Up Ubuntu and ROS')
- Python 3.8.10
- cmake version 3.16.3
- gcc 9.3.0
- Ubuntu 20.04 (see 'Setting Up Ubuntu and ROS')
- C/C++
- C++ Intellisense
- catkin-tools
- CMake
- Github Pull Requests
- Python
- ROS (see 'Setting Up Ubuntu and ROS')
- Command Variable
Follow these tutorials:
Follow this tutorial:
- http://wiki.ros.org/noetic/Installation/Ubuntu
- Run the following commands
# add to bashrc to add workspace to source
sudo nano ~/.bashrc
# add the below to the bottom of your bashrc
source <PATH TO YOUR ROS WORKSPACE>/devel/setup.bash
Now install the following packages:
sudo apt-get update
# Install Additional ROS Packages
sudo apt-get install -y ros-noetic-slam-gmapping ros-noetic-
controller-manager ros-noetic-joint-state-controller ros-noetic-
gazebo-ros*
# monitoring keyboard package
sudo apt install ros-noetic-teleop-twist-keyboard
# catkin dependencies
sudo apt install python3-rosdep
# install catkin
sudo apt-get install python3-catkin-tools
# reminder that the below is the command to source to workspace
source <PATH TO YOUR ROS WORKSPACE>/devel/setup.bash
IMPORTANT!! Note that your ROS workspace (where you call the source command to) is the directory which you should open in VS Code. For example, my workspace is called 'ros_workspace' so I use the command 'source ros_workspace/devel/setup.bash' to point ROS to my 'setup.bash' file. Note that this file will not be visible until you build the directory yourself using catkin_init_workspace and catkin_make.
- Follow instructions till last step here: https://mac.getutm.app/gallery/ubuntu-20-04
- Find Shared Directory in UTM navigator, choose your directory to share (make sure Ubuntu instance is shut off)
- Boot up Ubuntu and run the following commands:
# make directories
cd Documents && mkdir VMShare && cd VMShare
# install docking package, then mount
sudo apt-get install davfs2
sudo apt install spice-vdagent spice-webdavd
sudo mount -t http://127.0.0.1:9843/ davfs ~/Documents/VMShare (now you should see your shared folder)
# add command to bashrc file
sudo nano ~/.bashrc
echo <Ubuntu Password> | sudo -S mount -t davfs http://127.0.0.1:9843/ ~/Documents/VMShare -o username=<Host Machine Username>
Follow the following commands and then reboot. User should have the choice to boot into xmonad during login.
# start by updating your apt package database:
sudo apt-get update
# to install Gnome:
sudo apt install ubuntu-gnome-desktop
# next install the xmonad window manager:
sudo apt install xmonad
This step simply ensures you have up to date versions of the Ubuntu and ROS Noetic distributions. This will take some time:
sudo apt-get update
sudo apt-get dist-upgrade -y
rosdep update
sudo apt-get install -y ros-noetic-slam-gmapping ros-noetic-controller-manager ros-noetic-joint-state-controller ros-noetic-gazebo-ros*
sudo apt-get install ros-noetic-teleop-twist-keyboard
cd ~/ros_workspace
catkin_make
source ~/ros_workspace/devel/setup.sh
Change the following section of your json file to account your relevant directories:
"includePath": [
"/home/heilmao/ros_workspace/devel/include/**",
"/opt/ros/noetic/include/**",
"/usr/include/**",
"/home/heilmao/ros_workspace/**",
"${workspaceFolder}/**"
],
Simply use the launch file provided. Note that the python version referenced in the script my have a warning associated with it. This is a bug with the current version of VS Code- simply ignore it and the debugging will run as normal.
Replace with relevant paths to your equivalent files.
Copy and paste the contents of the task.json file into your '.vscode' directory as shown in this code repository if it does not already appear.
You can now run CTRL+SHIFT+P, search for "Tasks: Run Task" and select the "ROS: catkinmake" task we configured. Since we set it to be the default build task with the group option you can also run that task with the shortcut CTRL+SHIFT+B. The build type is set to "Debug", so that the ROS nodes can be debugged later on.
Before running your ROS project, users should start roscore. Do this by pressing Ctrl+Shift+p and then selecting the ROS:Start option.
Program in Python and C++ as normal using VS Code. Running these projects should be done with the ROS launch files and/or shell scripts. See the 'Useful Commands
When users wish to debug their code, they should navigate to the 'Run and Debug' tab on the left of the window. At the top, you will see two options in a dropdown box; select between Python and C++ depending on your requirement.
Ctrl + Shift + p # run task
Ctrl + Shift + b # build project
source ~/ros_workspace/devel/setup.sh
catkin_init_workspace
catkin_make
- https://mac.getutm.app
- https://mac.getutm.app/gallery/ubuntu-20-04
- http://www.lib4dev.in/info/MrGnomes/VS_Code_ROS/i19793
- https://vitux.com/how-to-use-gdb-to-debug-programs-in-ubuntu/
- https://code.visualstudio.com/download
- https://github.com/ms-iot/vscode-ros/blob/master/doc/spec/debug-ros-nodes.md
- https://code.visualstudio.com/docs/editor/variables-reference
- http://wiki.ros.org/noetic/Installation/Ubuntu
- https://answers.ros.org/question/122021/xacro-problem-invalid-param-tag-cannot-load-command-parameter-robot_description/
- richardw05/mybot_ws#4
- https://askubuntu.com/questions/942930/usr-bin-env-python-no-such-file-or-directory