-
Notifications
You must be signed in to change notification settings - Fork 809
feat(vehicle): new package of generic_value converter and generic_value calibrator #11630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat(vehicle): new package of generic_value converter and generic_value calibrator #11630
Conversation
Signed-off-by: YuxuanLiuTier4Desktop <[email protected]>
|
Thank you for contributing to the Autoware project! 🚧 If your pull request is in progress, switch it to draft mode. Please ensure:
|
Signed-off-by: YuxuanLiuTier4Desktop <[email protected]>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #11630 +/- ##
==========================================
- Coverage 17.84% 17.76% -0.08%
==========================================
Files 1744 1757 +13
Lines 121738 123118 +1380
Branches 42774 43066 +292
==========================================
+ Hits 21721 21877 +156
- Misses 81812 83026 +1214
- Partials 18205 18215 +10
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: YuxuanLiuTier4Desktop <[email protected]>
Additional Note to reviewers
Additional Note to users before PR merge.These two packages are rather independent, so we can simply grasp the two package folders and build/install them in our local autoware environment. |
Description
This PR introduces two new packages for generic value calibration and conversion, enabling calibration and control of arbitrary float64 actuators beyond traditional throttle/brake pedal systems.
New Packages
autoware_generic_value_calibrator: Generic calibration node that learns the mapping between arbitrary float64 input values and vehicle acceleration using Recursive Least Squares (RLS) algorithm.autoware_generic_value_converter: Generic conversion node that converts acceleration commands to arbitrary float64 output values using bilinear interpolation on a calibrated velocity-acceleration mapping table.Key Features
tier4_debug_msgs::msg::Float64Stampedinstead of vehicle-specific messagesArchitecture Overview
graph TB subgraph "Calibration Phase" A[Control Command] -->|topic_converter.py| B[Float64Stamped] B --> C[Generic Value Calibrator] D[Velocity Report] --> C E[Steering Report] --> C C -->|RLS Algorithm| F[Calibrated Map CSV] end subgraph "Runtime Phase" G[Control Command] --> H[Generic Value Converter] I[Odometry] --> H F --> H H --> J[Float64Stamped Output] J --> K[Custom Actuator] end style C fill:#e1f5ff style H fill:#e1f5ff style F fill:#fff4e1Data Flow
sequenceDiagram participant Controller participant Converter participant Actuator participant Vehicle Controller->>Converter: Control Command<br/>(acceleration) Converter->>Converter: Load CSV Map Converter->>Converter: Bilinear Interpolation<br/>(acc, vel) → value Converter->>Actuator: Float64Stamped<br/>(output value) Actuator->>Vehicle: Custom Control Signal Vehicle->>Converter: Odometry (velocity)Calibration Workflow
flowchart TD A[Start Calibration] --> B[Load Default Map] B --> C[Collect Data] C --> D{Data Valid?} D -->|No| E[Filter Out] D -->|Yes| F[Calculate Acceleration] F --> G[Apply Pitch Compensation] G --> H[RLS Update] H --> I{Update Method?} I -->|Per Cell| J[Update Cell Offset] I -->|Global| K[Update Global Offset] J --> L[Maintain Consistency] K --> L L --> M[Calculate RMSE] M --> N{Error Improved?} N -->|Yes| O[Save CSV Map] N -->|No| C O --> P[End] E --> CComparison with Existing Packages
accel_brake_map_calibratorgeneric_value_calibratorActuationCommandStampedFloat64Stampedraw_vehicle_cmd_convertergeneric_value_converterActuationCommandStampedFloat64StampedRelated links
Parent Issue:
How was this PR tested?
Unit Tests
Converter Package:
test_csv_loader.cpp)test_value_map.cpp)Calibrator Package:
test_calibrator_utils.cpp)test_calc_utils.py)Integration Testing
Manual Testing
Notes for reviewers
Key Design Decisions
Generic Float64Stamped Interface: Chose
Float64Stampedover vehicle-specific messages to maximize flexibility for custom actuators.Two Update Methods:
update_offset_each_cell: Higher accuracy, requires more dataupdate_offset_total: Faster convergence, works with limited dataTopic Converter: Python script for easy integration without code changes, supporting common Autoware message types.
Default Map Generation: Simple linear relationship (
accel = value) as starting point, updated by RLS during calibration.Code Structure
Potential Future Enhancements
Interface changes
Topic changes
Additions
/generic_value_converter/input/control_cmdautoware_control_msgs::msg::Control/generic_value_converter/input/odometrynav_msgs::msg::Odometry/generic_value_converter/output/valuetier4_debug_msgs::msg::Float64Stamped/generic_value_calibrator/input/valuetier4_debug_msgs::msg::Float64Stamped/generic_value_calibrator/input/velocityautoware_vehicle_msgs::msg::VelocityReport/generic_value_calibrator/input/steerautoware_vehicle_msgs::msg::SteeringReport/generic_value_calibrator/output/update_suggeststd_msgs::msg::Bool/generic_value_calibrator/output/current_map_errortier4_debug_msgs::msg::Float64Stamped/generic_value_calibrator/output/updated_map_errortier4_debug_msgs::msg::Float64Stamped/generic_value_calibrator/output/map_error_ratiotier4_debug_msgs::msg::Float64Stamped/generic_value_calibrator/debug/original_occ_mapnav_msgs::msg::OccupancyGrid/generic_value_calibrator/debug/update_occ_mapnav_msgs::msg::OccupancyGrid/generic_value_calibrator/debug/data_count_occ_mapnav_msgs::msg::OccupancyGrid/generic_value_calibrator/debug/data_count_self_pose_occ_mapnav_msgs::msg::OccupancyGrid/generic_value_calibrator/debug/data_average_occ_mapnav_msgs::msg::OccupancyGrid/generic_value_calibrator/debug/data_std_dev_occ_mapnav_msgs::msg::OccupancyGrid/generic_value_calibrator/debug/occ_indexvisualization_msgs::msg::MarkerArrayROS Parameter Changes
Additions - Generic Value Converter
csv_path_value_mapstring$(find-pkg-share autoware_generic_value_converter)/data/value_map.csvmax_valuedouble3.0min_valuedouble-5.0convert_value_cmdbooltrueuse_value_ffbooltrueAdditions - Generic Value Calibrator
update_hzdouble10.0update_methodstring"update_offset_each_cell"get_pitch_methodstring"tf"progress_file_outputboolfalsecsv_default_map_dirstring""csv_calibrated_map_dirstring"$(env HOME)/autoware_map_calibration"output_log_filestring""precisionint3value_mindouble-5.0value_maxdouble3.0value_numint11velocity_mindouble0.0velocity_maxdouble20.0velocity_numint11initial_covariancedouble0.05velocity_min_thresholddouble0.1velocity_diff_thresholddouble0.556value_diff_thresholddouble0.03max_steer_thresholddouble0.3max_pitch_thresholddouble0.02max_jerk_thresholddouble1.0value_velocity_threshdouble20.0max_acceldouble5.0min_acceldouble-5.0value_to_accel_delaydouble0.3update_suggest_threshdouble0.7max_data_countint200Effects on system behavior
New Capabilities
Custom Actuator Support: Enables calibration and control of non-standard actuators (electric motors, hydraulic systems, etc.) without modifying core Autoware code.
Flexible Calibration: Supports arbitrary input value ranges, not limited to traditional throttle/brake pedal values.
Easy Integration: Topic converter allows using existing Autoware messages (Control, Odometry) without code changes.
No Breaking Changes
Integration Points