It is assumed that the workspace is ~/ros2_ws/
.
cd ~/ros2_ws/src
git clone https://github.com/robotverseny/megoldas_sim24
sudo apt install ros-humble-rviz-2d-overlay*
cd ~/ros2_ws
colcon build --packages-select megoldas_sim24 --symlink-install
Don't forget to source before ROS commands.
source ~/ros2_ws/install/setup.bash
ros2 launch megoldas_sim24 megoldas1.launch.py
ros2 run megoldas_sim24 simple_pursuit.py
ros2 launch megoldas_sim24 megoldas2.launch.py
ros2 run megoldas_sim24 follow_the_gap.py
Tip
Use the megoldas_sim24
package with the robotverseny_gazebo24
simulator.
Build and run instructions of the simulator is described in the robotverseny_gazebo24
package.
After the simulaton packages are built and sourced, you can start the simulator, e.g. with the following command:
ros2 launch robotverseny_bringup roboworks.launch.py rviz:=true
This section explains how to use the joystick
teleop to control your car using a joystick
.
Ensure that the joy
package is installed:
sudo apt-get install ros-humble-joy
To start the joystick teleop node
, use the following command:
ros2 launch megoldas_sim24 car_teleop_launch.py
This will launch the joystick_teleop_node
and joy_node
nodes, allowing you to control your car using a joystick
.
- Left Stick Vertical Axis: Controls the linear speed of the car.
- Left Stick Horizontal Axis: Controls the angular speed of the car.
Adjust the parameters in the joystick_teleop.py
file as needed based on your joystick configuration and desired control behavior.
Tip: Check out
joy_tester
for configuring your joystick.
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.