It is assumed that the workspace is ~/ros2_ws/.
cd ~/ros2_ws/srcgit clone https://github.com/robotverseny/megoldas_sim24sudo apt install ros-humble-rviz-2d-overlay*cd ~/ros2_wscolcon build --packages-select megoldas_sim24 --symlink-installDon't forget to source before ROS commands.
source ~/ros2_ws/install/setup.bashros2 launch megoldas_sim24 megoldas1.launch.py # start simple_pursuitros2 run megoldas_sim24 simple_pursuit.pyros2 launch megoldas_sim24 megoldas2.launch.py # start follow_the_gapros2 run megoldas_sim24 follow_the_gap.pyTip
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:=trueThis 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-joyTo start the joystick teleop node, use the following command:
ros2 launch megoldas_sim24 car_teleop_launch.pyThis 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_testerfor configuring your joystick.
The frame /odom_combined is practically the same as /map, there is a static 0,0,0 transform between them. The only dynamic transform is between /odom_combined and /base_link.
graph TD
%% Root frame
map([ map]):::lightd
odom_combined([ odom_combined]):::light
base_link([ base_link]):::light
chassis([ chassis]):::light
camera_link([ camera_link]):::light
imu_link([ imu_link]):::light
laser([ laser]):::light
%% connections
odom_combined -.->|dynamic| base_link
base_link -->|static| chassis
base_link -->|static| camera_link
base_link -->|static| imu_link
base_link -->|static| laser
map ==>|static - same| odom_combined
classDef light fill:#34aec5,stroke:#152742,stroke-width:2px,color:#152742
classDef lightd fill:#34aec5,stroke:#152742,stroke-width:2px,color:#152742,stroke-dasharray: 5 5
classDef dark fill:#152742,stroke:#34aec5,stroke-width:2px,color:#34aec5
classDef white fill:#ffffff,stroke:#152742,stroke-width:2px,color:#152742
classDef red fill:#ef4638,stroke:#152742,stroke-width:2px,color:#fff
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.