How pvandervelde/zinger_swerve_controller works
This package provides the Zinger robot’s ROS 2 swerve controller. The principal runtime path accepts body-motion commands, derives wheel-module targets, profiles their motion, and publishes joint commands; measured joint states also support body-state estimation and odometry. Its implementation separates command types, kinematics, motion profiles, module geometry/state, and the ROS node. The README documents configuration and odometry capabilities; sampled excerpts do not show all callback wiring, so some links are omitted rather than inferred.
Main entry points: swerve_controller.py Swerve Node · steering_controller.py Steering Planner · control_model.py Swerve Kinematics · drive_module.py Drive Modules
Components 17
ROS Integration
- Swerve Node
zinger_swerve_controller/swerve_controller.py - Controller Config
config/swerve.yaml - Controller Launch
launch/swerve_controller.launch.py
Motion Planning
- Steering Planner
zinger_swerve_controller/steering_controller.py - Motion Commands
zinger_swerve_controller/control.py - Swerve Kinematics
zinger_swerve_controller/control_model.py
Robot Model
- Drive Modules
zinger_swerve_controller/drive_module.py - Motion States
zinger_swerve_controller/states.py - Geometry Types
zinger_swerve_controller/geometry.py
Motion Profiles
- Body Profiles
zinger_swerve_controller/control_profile.py - Module Profiles
zinger_swerve_controller/control_profile.py - Variable Profiles
zinger_swerve_controller/profile.py - Trajectory Errors
zinger_swerve_controller/errors.py
Other components
- Motion Commands
- Joint State Publisher
- ROS Joint Controllers
- Odometry Consumer
Connections 23
- Controller Launch → Swerve Node: launches
launch/swerve_controller.launch.py - Controller Launch → Controller Config: loads
launch/swerve_controller.launch.py - Motion Commands → Swerve Node: publishes commands
- Joint State Publisher → Swerve Node: publishes states
zinger_swerve_controller/swerve_controller.py - Swerve Node → ROS Joint Controllers: publishes joint commands
README.md - Swerve Node → Odometry Consumer: publishes odometry
README.md - Swerve Node → Steering Planner: delegates planning
zinger_swerve_controller/swerve_controller.py - Swerve Node → Drive Modules: creates modules
zinger_swerve_controller/swerve_controller.py - Swerve Node → Motion States: reads joint states
zinger_swerve_controller/swerve_controller.py - Motion Commands → Swerve Kinematics: converts commands
zinger_swerve_controller/control.py - Steering Planner → Motion Commands: accepts commands
zinger_swerve_controller/steering_controller.py - Steering Planner → Swerve Kinematics: calculates module states
zinger_swerve_controller/steering_controller.py - Steering Planner → Body Profiles: profiles body motion
zinger_swerve_controller/steering_controller.py - Steering Planner → Module Profiles: profiles module motion
zinger_swerve_controller/steering_controller.py - Body Profiles → Variable Profiles: uses profiles
zinger_swerve_controller/control_profile.py - Module Profiles → Variable Profiles: uses profiles
zinger_swerve_controller/control_profile.py - Module Profiles → Trajectory Errors: raises errors
zinger_swerve_controller/control_profile.py - Swerve Kinematics → Drive Modules: uses geometry
zinger_swerve_controller/control_model.py - Swerve Kinematics → Motion States: returns states
zinger_swerve_controller/control_model.py - Steering Planner → Drive Modules: uses modules
zinger_swerve_controller/steering_controller.py - Steering Planner → Motion States: updates states
zinger_swerve_controller/steering_controller.py - Drive Modules → Geometry Types: stores position
zinger_swerve_controller/drive_module.py - Motion States → Geometry Types: uses types
zinger_swerve_controller/states.py