How eth-pbl/map-controller works
The project at hand is an autonomous racing controller package that implements both Model- and Acceleration-based Pursuit (MAP) and Pure Pursuit algorithms. It not only provides the controller algorithms and lookup table generation for steering dynamics but also includes a simulator for evaluating controller performance. The project’s purpose is to generate steering commands for a racecar using both geometric (Pure Pursuit) and more dynamic (MAP) strategies, with an emphasis on accurately converting acceleration to steering values via a lookup table derived from vehicle dynamics and tire models.
Main Components
• Simulator Environment: Represented by the F110_ROS_Simulator directory. This includes ROS launch files, maps, the car’s kinematic models (e.g., ackermann_kinematics.hpp, st_kinematics.hpp, etc.), and visualization (RViz).
• Controllers: There are at least two controllers included:
• Controller (Model- and Acceleration-based Pursuit) – provided in the “map_controller” package.
• Pure Pursuit Controller – also provided in the “map_controller” package.
• Lookup Table Generation: Located in the “steering_lookup” folder. This is a crucial preprocessing component that creates steering lookup tables based on tire dynamics and vehicle parameters.
• ROS Message Definitions: The “f110_msgs” package defines the messages (e.g., Wpnt.msg, WpntArray.msg) used for communicating the car state and waypoints.
• ROS Nodes: Found in various directories (node in F110_ROS_Simulator and Python nodes in map_controller) that publish or subscribe to essential topics such as vehicle pose, waypoints, and control commands.
• Configuration Files: The YAML files in “map_controller/cfg” and “steering_lookup/cfg” and other parameter-related files which are central for tuning the controllers and lookup table generation.
Relationships and Interactions
• Data Flow: Position and waypoint data are published on the ROS topics (e.g., /car_state/pose and /global_waypoints), which are then used by the controllers.
• Controllers: Both controllers receive data, compute steering commands, and output “AckermannDriveStamped” messages on a dedicated topic (/ackermann_cmd_mux/input/teleop).
• Lookup Table Integration: The steering_lookup module generates the lookup tables (via simulate_model.py) that are used by the MAP controller for converting calculated acceleration into refined steering angle commands.
• Simulation Interaction: The simulator launches and visualizes the vehicle’s movement using various launch files (e.g., racecar_model.launch, simulator.rviz) and integrates with the map data provided under “maps”.
Architectural Patterns and Design Principles
• ROS Node Architecture: The system is modularly built using ROS nodes for each major function (simulation, control, lookup table generation), allowing for clear separation of concerns.
• Layered Architecture: The system can be seen as layered – from data acquisition (via sensor and state messages), through processing (controllers, lookup table generation), to actuation (control command publication to the vehicle simulator).
• Configuration-driven Setup: Several parameters and behavior adjustments are externalized in YAML and configuration files, supporting tuning and flexibility.
Detail and Component Separation
• More details (like specific file names from the include/ or src/ directories) may be added if needed, but focus on the logical separation rather than individual file details.
• Keep inter-component interfaces (ROS topics and message types) explicit, as these are fundamental to understanding the system’s flow.