Skip to content

Users' guide to Software installation

Andre edited this page Jun 14, 2023 · 6 revisions

Software Requirements

Table of Contents

  1. Operating System
  2. ROS
  3. ROS Packages
  4. Simulation Environment
  5. Pytorch
  6. Xbox Controller

Operating System

Our repository is known to work in the Ubuntu 20.04 operating system. To install it, refer to this tutorial if you want a standalone installation, or to this tutorial if you want a dual boot installation with Windows 10.

ROS

As our packages are ROS based, ROS installation is a crucial step. Our packages are developed using ROS Noetic.

To install ROS Noetic refer to this tutorial.

Follow the steps 1 and 2 by installing the Desktop-Full Install.

On the 1.5 step, if you are unsure which command to take, if have not changed the default shell for the terminal, use the Bash option.

ROS workspace

Nextly, in order to operate ROS correctly, you would need to create a ROS workspace. Please follow the step 3 of this tutorial. In addition to the steps named in the tutorial, you need to change your terminal configuration file. If you use bash (default in ubuntu), you would need to change the file .bashrc, and if you use zsh, change .zshrc. Please add:

source ~/catkin_ws/devel/setup.bash

for bash, and for zshell:

source ~/catkin_ws/devel/setup.zsh

Another useful command to place in this file is an alias for the ROS compilation tool catkin_make.

Please place:

alias cm="catkin_make --directory ~/catkin_ws -j *insert number of your CPU threads*"

on .bashrc/.zshrc. When you want to compile, simply place the cm command in the command line.

Other ROS packages

Our code is dependent of other ROS packages.

Odometry Packages

These packages are responsible for the odometry. Please install using this command:

sudo apt-get install ros-noetic-ros-controllers ros-noetic-ackermann-msgs ros-noetic-navigation

And please clone this repository to your ROS workspace (default is ~/catkin_ws/src). Change the git branch to the melodic-devel branch. This process can be done with the following commands:

cd ~/catkin_ws/src
git clone https://github.com/manuelgitgomes/steer_drive_ros.git
cd steer_drive_ros
git switch melodic-devel

Sensor Packages

RGB camera

To use the RGB cameras, please install the following packages:

sudo apt-get install ros-noetic-usb-cam

RGBD camera

Kinect Image

A crucial instrument for every autonomous vehicle is a RGBD (Red Green Blue Depth) Camera. One of the most accessible and affordable ones is the Kinect. To use it, a wide array of drivers and packages are needed. The one mostly used here is the open source libfreenect. The setup will be described here. It is known to be compatible with Ubuntu 20.04 and ROS Noetic.

Firstly, install all the dependecies needed:

sudo apt-get install git-core cmake freeglut3-dev pkg-config build-essential libxmu-dev libxi-dev libusb-1.0-0-dev ros-noetic-rgbd-launch

With that out of the way, download the libfreenect repository to the directory of your liking:

git clone https://github.com/OpenKinect/libfreenect.git

After that, make and install the code:

cd libfreenect
mkdir build
cd build
cmake -L ..
make
sudo make install
sudo ldconfig /usr/local/lib64/

To run the kinect use:

freenect-glview

Now, if you already have your catkin workspace directory created, you just need to download the required ROS package to work with freenect. So, for that you must run:

cd ~/catkin_ws/src
git clone https://github.com/ros-drivers/freenect_stack.git

In order to ROS recognize the examples from freenect you must use a make command:

cd ..
catkin_make

Now ROS need to find where the files are going to, so for that:

source devel/setup.sh

Finally, you just need to launch the freenect example to have the topics sent from Kinect.

roslaunch freenect_launch freenect.launch depth_registration:=true

Simulation environment

In order to correctly run the simulation environment inside Gazebo, it is needed to write inside your .bashrc/.zshrc the following lines:

export GAZEBO_MODEL_PATH="`rospack find prometheus_gazebo`/models:${GAZEBO_MODEL_PATH}"
export GAZEBO_MODEL_PATH="`rospack find prometheus_gazebo`/models/VerticalSignals/circular_signals:${GAZEBO_MODEL_PATH}"
export GAZEBO_MODEL_PATH="`rospack find prometheus_gazebo`/models/VerticalSignals/quadrangular_signals:${GAZEBO_MODEL_PATH}"
export GAZEBO_MODEL_PATH="`rospack find prometheus_gazebo`/models/VerticalSignals/triangular_signals:${GAZEBO_MODEL_PATH}"

After restart the terminar or source the file typing:

source ~/.bashrc
or 
source ~/.zshrc

Other Packages

To install the other packages needed, please run the following command:

roscd prometheus_bringup
cd ..
pip install -r requirements.txt

Some scripts related with neural networks require to select a folder where Datasets, Models and Results are stored. Please define where you want by adding the following line to .bashrc/.zshrc:

export AUTOMEC_DATASETS=${HOME}/Automec

Pytorch

Our code is dependent of Pytorch to drive the car and to perform semantic segmentation. Please install it using this tutorial. Please install the CUDA version if you have a GPU that appears in the beginning of the page by choosing the appropriate options to your needs.

Xbox Controller

In order to control the car it's necessary to install and configure the Xbox Controller, and the required ROS package.

Xbox Controller Drivers

First it's necessary to install the Xbox Controller drivers:

First install the drivers:

sudo apt-get install xboxdrv

After installing the xboxdrv driver it's necessary to enable some services:

ROS Joy Package

First it's necessary to install the required ROS package, tutorial taken from here:

sudo apt-get install ros-noetic-joy

Connect your joystick to your computer. Now let's see if Linux recognized your joystick.

ls /dev/input/

You should see something like this:

by-id  event0  event1  event2  event3  event4  event5  js0  mice  mouse0

Now let's see if the joystick is working:

sudo jstest /dev/input/jsX

Where X is the number of your joystick. You should see something values changing when you move the joystick.

After it's important to allow the joystick to be used by the ROS Joy package:

ls -l /dev/input/jsX

You should see something like this:

crw-rw-XX- 1 root root 13, 0 2011-11-26 21:46 /dev/input/js0

If XX is rw: the js device is configured properly. If XX is --: the js device is not configured properly, you need to:

sudo chmod a+rw /dev/input/jsX

Now if everything went well the controller and the required package should be working.

Testing the controller

In case you want to test the controller you can use the following command:

roscore

If needed you can change the default device used by the joy package. In another terminal:

rosparam set joy_node/dev "/dev/input/jsX"

Then launch the joy node:

rosrun joy joy_node

Now you can see the output of the controller:

rostopic echo joy

Troubleshooting

If the controller connects to the computer but the light keeps blinking try going to windows connecting to the controller, restarting in ubuntu and it should be working.