OS: Ubuntu 20.04.2
If using a Mac or Windows OS its recommended that you install a virtual machine using Linux. One option is parallels ( https://www.parallels.com/au/ ). Just follow the install instructions and it will ask what OS you want to install (choose Ubuntu).
ROS requires a several terminal windows to be open at a time. A terminal window manager like tmux is recommend (sudo apt install tmux
) as it makes it easier to switch between windows.
There are a few things that need to be installed (instructions below):
- ROS - Using Noetic for this project
- Catkin - Workspace / build system for ROS
- ARIA - A ROS package for interfacing with the Pioneer 3 robot
- AMRISim - A virtual simulator for the Pioneer 3 robot
Instructions taken from: noetic/Installation/Ubuntu - ROS Wiki
- Accept packages (apt install ...) from packages.ros.org
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
-
Install cURL
sudo apt install curl
-
Setup apt keys
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
-
Update
sudo apt update
-
Install full version of ROS noetic
sudo apt install ros-noetic-desktop-full
- Add the setup script to .bashrc to run every time a new terminal is opened
echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
- Install dependencies to ROS noetic
sudo apt install python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential
- Install mode dependencies (rosdep)
sudo apt install python3-rosdep
- Initialize rosdep
sudo rosdep init
rosdep update
Instructions taken from: ROS/Tutorials/InstallingandConfiguringROSEnvironment - ROS Wiki
- Create and build catkin workspace
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/
catkin_make
- Source catkin workspace setup.bash script
source ~/catkin_ws/devel/setup.bash
# or (untested but hopefully this works)
echo "source ~/catkin/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc
Instructions from this repository: reedhedges/AriaCoda
-
Install requirements (documentation)
sudo apt install doxygen
-
Install AriaCoda from source
cd ~/Downloads
git clone https://github.com/reedhedges/AriaCoda
cd AriaCoda
make
sudo make install
Instructions from: GitHub - reedhedges/AMRISim)
- Install dependencies
sudo apt install libroscpp-dev libtf-dev libsensor-msgs-dev libgeometry-msgs-dev libstd-msgs-dev libstd-srvs-dev libnav-msgs-dev libnodelet-dev rviz
- Install mode dependencies
sudo apt install python3-roslaunch python3-rostopic ros-geometry-msgs ros-nav-msgs ros-std-msgs ros-sensor-msgs ros-std-srvs
- Install AMRISim from source
cd ~/Downloads
git clone https://github.com/reedhedges/AMRISim
cd AMRISim
# Define path to AriaCoda before running make
export ARIA=/home/<user>/Downloads/AriaCoda
make
sudo make install
- Start ROS (in one terminal window)
cd ~/catkin_ws
source devel/setup.bash # Always required
roscore # Starts a ROS instance (once per machine)
- Start the Simulator (in another terminal window)
cd ~/Downloads/AMRISim # or where you downloaded AMRISim
./AMRISIM # Start AMRISim
# Choose a map within the AMRISim folder (there should be a file workspace.map)
- Start ROSAria (in another terminal window)
cd ~/catkin_ws
rosrun rosaria RosAria
- Send a command to see it things are working (in another terminal window)
# This should move the robot forwards and rotate
rostopic pub -1 /RosAria/cmd_vel geometry_msgs/Twist '[1.0, 0.0, 0.0]' '[0.0, 0.0, 1.0]'
Information sourced from: http://wiki.ros.org/ROS/Tutorials/CreatingPackage
- Enter the source directory of catkin
cd ~/catkin_ws/src
- Create a new project
catkin_create_pkg <package_name> [dependency 1] [dependency 2]
# Example below:
catkin_create_pkg my_package roscpp std_msgs
- Make the project in the catkin workspace
cd ~/catkin_ws
catkin_make
source devel/setup.bash
This will create the following file structure:
catkin_ws/
src/
CMakeLists.txt # Top level Cmake file
<package_name>/
CMakeLists.txt # CMake for package
package.xml # Package manifest
rospack depends1 <package_name> # First order dependencies
rospack depends <package_name> # All dependencies (dependencies of dependencies)
Instructions from: http://wiki.ros.org/ROSARIA/Tutorials/How%20to%20use%20ROSARIA Ideally the robot should just listen to commands from a central machine. This process involves:
- On the robot machine:
export ROS_MASTER_URI=http://<ip_address_of_robot>:11311
export ROS_IP=<ip_address_of_robot>
# Add ip address of host to /etc/hosts
sudo vim /etc/hosts
# Add "<ip_address_of_host> my_workstation" to /etc/hosts
# In a new terminal window
cd ~/catkin_ws
catkin_make
roscore
# In another terminal window
cd ~/catkin_ws
catkin_make
rosrun rosaria RosAria _port:=/dev/ttyS0
- On the host machine (do not run roscore here):
export ROS_MASTER_URI=http://<ip_address_of_robot>:11311
export ROS_HOSTNAME=<ip_address_of_host>
export ROS_IP=<ip_address_of_host>
cd ~/catkin_ws/
catkin_make
rostopic echo /RosAria/pose # Get position from robot