Fira-Autonomous-Cars / FIRA-Autonomous-Cars-Simulator

FIRA Autonomous Cars Simulator
Creative Commons Zero v1.0 Universal
23 stars 10 forks source link
autonomous-car autonomous-driving machine-learning robotics-competition

FIRA Autonomous Cars Simulator

FIRA Autonomous Cars Simulator for FIRA RoboWorld Cup Competition. The instructions necessary to get started are available below.

Changelog

1.1.2

1.1.1

1.1.0

1.0.4

Tested Minimum Local Hardware Requirements

CPU: Intel® Core™ i5-5257U CPU @ 2.70GHz
GPU: Intel® Iris 6100
RAM: 8 GB

Software Requirements

Ubuntu 20.04 and ROS Noetic are used exclusively. Other versions are not officially supported. Prior to installing our software make sure to have ROS and Catkin tools installed: http://wiki.ros.org/noetic/Installation/Ubuntu

sudo apt-get install python3-catkin-tools python3-catkin-pkg python3-osrf-pycommon

sudo apt install ros-noetic-can-msgs ros-noetic-velocity-controllers ros-noetic-velodyne-pointcloud ros-noetic-teleop-twist-keyboard ros-noetic-gazebo-ros ros-noetic-gazebo-ros-control ros-noetic-gazebo-ros-pkgs ros-noetic-hector-gazebo-plugins ros-noetic-hector-gazebo-worlds ros-noetic-hector-gazebo ros-noetic-ros-controllers

Installation

mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src

git clone https://github.com/Fira-Autonomous-Cars/FIRA-Autonomous-Cars-Simulator.git

catkin_init_workspace
cd ..
catkin_make

echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc

# For ZSH users
echo 'source ~/catkin_ws/devel/setup.zsh' >> ~/.zshrc
source ~/.zshrc

The installation process is done.

Usage

After successfully finishing the installation process, everything is ready to run.

Race Track

Launching the following command will start the gazebo simulator in the race track.

roslaunch avisengine_environment track_race_simple.launch 

Urban Track

Launching the following command will start the gazebo simulator in the urban track.

roslaunch avisengine_environment track_urban_simple.launch 

Topics

You can get the front camera image from /catvehicle/camera_front/image_raw_front/compressed topic and can send control commands using a Twist message to /catvehicle/cmd_vel.

Get a list of topics by running the following command:

rostopic list

Manual Control Mode

The car can also be driven manually by launching the following command:

roslaunch catvehicle_tests cmdvel_unsafetest.launch 
Use your keyboard to drive the car manually:
Key Action
i Move Forward
, Move Backward
u Turn Left and Forward
o Turn Right and Forward
m Turn Left and Backward
. Turn Right and Backward
k Center and stop
q, z Increase or decrease speed

Usage of the example package

The example package in /example_pkg demonstrates a basic usage of the simulator written in python. /example_pkg/src/drive.py is used to drive the vehicle and /example_pkg/src/imageReceive.py is used to receive image from the vehicle. The drive node uses the Twist message to control the vehicle through the /catvehicle/cmd_vel topic. You can easily plug your code and use the basic topics in the simulator.

Customizing the Tracks

Race Track Model

Urban Track Model

Blender files locations

Name Path
Race Track Model avisengine_environment/meshes/mesh_road.blend
Urban Track Model avisengine_environment/meshes/mesh_road_urban.blend

You can customize both the race track and urban track (base) by modifying the 3D files using Blender which is a free and open-source 3D computer graphics software. The instructions on how to modify this file are written in the blender file.

Modify Urban Signs and Tags

Modifying the signs and AprilTags in the urban track can be done by modifying the urban world file, or by just simply adding other tags from the gazebo model library, since all the signs and tags are also added to the library and are ready to use.