rosRoboCar: Installation
Roadmap
- Installation
- Calibration and Setup
- How it works
Introduction
In Berlin we had a meetup group Autonomous Robots Berlin. Now it is not active, but earlier this group held a competition. The rules were simple:
- Every car must make at least 3 loops in a row without human intervention.
- Fastest of these loops counts (so you can gradually increase speed on the track;).
- There are two paths available with the same starting point: a long loop for lane holding and an obstacle avoidance loop. The obstacle avoidance loop is shorter than just lane holding, but for each cone hit 2 seconds are added to your total score. Each participant is free to choose which loop to take.
- The vehicle can leave the track if it comes back and it did not take a shortcut.
The race took place at The Drivery’s Gravity Gym track
Software setup
I was given a DonkeyCar which had only:
- 1GB RAM RaspberryPi
- two motors, which recieved only PWM signals
- throttle
- steering
- RaspberryPi camera
It is a very basic setup, because no sensors for obstacle detection, or just for odometry to get some localization.
Robocar uses ROS1 Noetic. For testing and training purposes it can be run across multiple machines, when a car sends camera images and on computer I can visualize and work with them.
Installation
On PC
- Windows users
- You will need to be on Windows 11 Build 22000 or later.
- Install driver for vGPU to run Linux GUI apps
- Install WSL2. Open
Microsoft Store
and install Ubuntu 20.04. - Download and install VcXsrv Windows X Server. Open and set:
- check multiple windows and set display number to 0;
- in next window check start no client;
- finally check all extra settings;
- enable Outgoing Connection from Windows Firewall
- Run Ubuntu 20.04
- In WSL run
export DISPLAY=127.0.0.1:0.0 # you can also add it to ~/.bashrc
- Create a .xsession file in the user home directory e.g.
echo xfce4-session > ~/.xsession
- Install ROS1 Noetic
- Update/Install Git and Python3
- Install Gazebo for simulation
- Install gazebo-ros-pkgs and gazebo-ros-control
- Source ROS1
- Download and build my repository
On a car
- A DonkeyCar has RaspberryPi, so first make it work. If there are problems check resolve connectivity problems
- Install ROS1 Noetic from sources. In the
catkin_make_isolated
step add-j2
flag, so it will not stuck. - Download this repository.
- Unfortunately dependencies can not be resolved, as there are no binary packages. So download in
~/ros_catkin_ws/src
following repositories: image_transport, replace image_common, image_pipeline, replace vision_opencv. - Install
compressed_image_transport
,image_transport_plugins
,camera_calibration_parsers
,camera_info_manager
,image_geometry
,image_proc
with a command
- Install libs for i2cpwm_board node:
- install
libi2c-dev
- add
target_link_libraries(i2cpwm_board i2c)
toCMakeLists.txt
- add to
i2cpwm_controller.cpp
- install
Code of this package was copied from this tutorial, because original was deleted(?). That tutorial was made when
libi2c-dev
was version 3. Now it is version 4 and some big changes were made.
Running ROS across multiple machines
Connect your car and PC. Don’t forget to export ROS_IP
and ROS_MASTER_URI
Now a car can be launched with
On PC: