This ROS 2 workspace (formula_ws) contains the core simulation and physical description packages for the Driveless Formula Student vehicle.
The workspace strictly separates the physical definition of the vehicle from its simulation environment, ensuring modularity and reusability.
This package defines "what the robot is". It handles the kinematics, physical properties, and standalone visualization.
urdf/platform_base.xacro: The core structural file. Defines the main chassis (base_link), the top platform, wheel axles, and the steering mechanisms for the front wheels.urdf/common_properties.xacro: The central configuration hub. Contains all parameterized values (dimensions, masses, inertias, offsets) preventing hardcoded numbers in the main.xacrofile.urdf/gazebo_ros2_control.xacro: Defines the hardware interfaces forros2_control(e.g., velocity controllers for rear wheels, position controllers for steering joints).launch/display.launch.py: A lightweight script to spawn the robot model in RViz. It automatically loads Xacro parameters and injects them into therobot_state_publisher.rviz/display.rviz: The pre-configured 3D workspace for RViz, ensuring correct lighting, grids, and TF tree display upon launch.
This package defines "where the robot lives". It handles the Gazebo physics engine, controllers, and ROS-Gazebo bridges.
launch/platform_gazebo.launch.py: The primary orchestrator. It launches Gazebo, loads theempty.sdfworld, spawns the URDF model, initiatesros_gz_bridge, and activates the Ackermann steering controllers.config/parameters.yaml: Runtime ROS parameters utilized by the controller nodes (e.g., wheel radius, max steering angles) loaded during simulation.config/ros_gz_bridge.yaml: The routing table defining which topics (e.g.,/cmd_vel,/odom) are translated between ROS 2 DDS and Gazebo Transport.models/: Contains environmental 3D assets for the simulation, such asblue_coneandyellow_cone.
Ensure you have the following installed on your ROS 2 machine (tested on Humble/Jazzy):
- ROS 2 (Desktop Install)
- Gazebo Sim (Harmonic or newer)
- ROS 2 Packages:
sudo apt install ros-<version>-xacro sudo apt install ros-<version>-joint-state-publisher-gui sudo apt install ros-<version>-gazebo-ros-pkgs sudo apt install ros-<version>-ros-gz-bridge
To build the workspace, navigate to the root directory and run:
colcon build --symlink-installAfter building, always source the workspace before running commands:
source install/setup.bashUse this command to quickly verify the robot's dimensions, physical structure, and joint movements without launching the heavy Gazebo simulator. Highly recommended after modifying common_properties.xacro.
ros2 launch platform_description display.launch.pyNote: A small GUI window (joint_state_publisher_gui) will appear, allowing you to manipulate steering and wheel joints via sliders.
Use this command to launch the full physics simulation, spawn the robot in an empty world, and load the active controllers.
ros2 launch platform_bringup platform_gazebo.launch.py- Sensor Integration: Mount LiDAR and camera modules on the
platform_linkand configure their Gazebo plugins. - Track Generation: Create a dynamic
.sdfworld generator utilizing theblue_coneandyellow_conemodels. - Odometry Tuning: Fine-tune the
ackermann_steering_controllercovariance matrices for realistic slip and friction modeling.