This repository provides all the required tools and utilities for the Machathon 5.00 simulation phase. A gazebo world that contains the competition vehicle and the track. The car navigates in one direction, followed by navigating in the opposite direction. The time taken to complete each run, known as the lap time, is recorded.
After completing the track in both directions, the total lap time is send to the leaderboard if chosen to do so.
-
ROS2 installation using any of the following options
- Using ROS2 humble (Ubuntu 22.04) installation: Install ROS2 humble
- Using ROS2 foxy (Ubuntu 20.04) installation: Install ROS2 foxy
-
Gazebo and ROS-Gazebo packages Installation
sudo apt update
sudo apt -y install gazebo
## if you are using ros2-humble
sudo apt install ros-humble-gazebo-ros-pkgs
sudo apt install ros-humble-xacro
## if you are using ros2-foxy
sudo apt install ros-foxy-gazebo-ros-pkgs
sudo apt install ros-foxy-xacro
- Python version 3.10 (humble) or 3.8 (foxy)
## check python version in terminal
python3 --version
- keyboard package
sudo apt install pip
sudo pip install keyboard
mkdir workspace_name
cd workspace_name
mkdir src
cd src
git clone https://github.com/Apolo151/machathon5.00.git --depth=1
cd ..
colcon build --symlink-install
- Open two terminal windows
cd workspace_name
sudo su
source ~/.bashrc
source install/setup.bash
ros2 launch car_demo demo.launch.py
sudo su
source ~/.bashrc
source install/setup.bash
ros2 launch car_demo machathon.launch.py
- open another terminal and run the following commands
sudo su
source ~/.bashrc
source install/setup.bash
ros2 run car_demo prius_teleop_keyboard.py
machathon5.00-judge
├── car_demo
│ ├── car_demo
│ ├── CMakeLists.txt
│ ├── env-hooks
│ ├── launch
│ │ ├── demo.launch.py # launches gazebo and track scene
│ │ ├── machathon.launch.py # launches judge and solution nodes
│ │ └── spawn_prius.launch.py
│ ├── models
│ ├── package.xml
│ ├── plugins
│ ├── scripts
│ │ ├── data.py # teams data config
│ │ ├── despawn_prius.py
│ │ ├── judge.py # judge node
│ │ ├── prius_teleop_keyboard.py # keyboard telep node
│ │ ├── solution.py # your solution file
│ │ └── spawn_prius.py
│ └── worlds
│ └── MachathonTrack.world # The Gazebo track scene
├── prius_description # car's description
├── prius_msgs
└── README.md
This code was heavily based on osrf car_demo and NovoG93 car_demo, we wholeheartedly thank them for their invaluable contributions and open source code.