[fix][ROS2] Fix pose integration and calibration
Goal
This MR brings changes from ROS1 to fix the external pose integration (mostly the calibration part) from !362 (merged)
This MR contains various fixes about external sensors and calibration.
- Add lever arm constraint in calibration estimation. This new constraint allows to fix the translation norm between the tracked frame (i.e. base -> often the Lidar frame) and the external sensor frame.
- Add a window on trajectory during calibration upon two trajectories. This moving window allows to get rid of the drift in both trajectories and to only use local relative motion.
- Refact the calibration interface in PV to be able to set parameters
It also contains style and refact minor changes.
Changes
- Reset calibration in main Reset function (SLAM manager)
- Update PoseManager in ExternalSensorManager file to add constraint options. Add a ceres constraint for the lever arm
- Update SLAM interface to set the new parameters (trajectory window size and lerver arm distance)
- Update PV interface with new parameters
- Refact PV interface to better display advanced parameters
- Add missing calibration for wheel encoder and gravity manager in PV wrapper
- Add check when loading calibration from file
- A calibrate button is added in PV interface to calibrate when the parameters for calibration matrix is set
Results
Reproduce
Data
Any velodyne data
Build
colcon build --symlink-install --base-paths src/slam/ros2_wrapping src/ouster --cmake-args -DCMAKE_BUILD_TYPE=Release
Parameters
To test:
lever_arm:= 1.
Run
ros2 launch lidar_slam slam_velodyne.py
ros2 bag play --clock -d 2 path/to/velodyne_data
- Run a first shot and save the trajectory as CSV file.
- Run a second time approximately the same number of frames
- Click on "Calibrate button"
- Choose the CSV file
Output
You should see a calibration matrix set to approx identity when lever_arm is kept to -1 and a calibration translation that tries to adapt when increasing the lever_arm.
/!\ Warning the saturation threshold is 0.5 by default so if the lever arm is too big the constraint won't be taken into account in the optimization
Checklist
-
Camel case everywhere except for ROS variables/parameters -
Lower case for local variables and lambda functions -
Upper case for pour members, methods and tool functions (in Utils) -
Precise namespace when calling a function (or this->X or classe.X) -
Align code (for multiline if and while, "&&" or "||" go in upper line to ensure alignement) -
Space between if, while, for and parenthesis -
Space between operators and variables: e.g. a + b -
Space after "," -
Mind your commit titles/desc (plurals, he/she + "s", correct tags, title should begin by a verb...) -
Function names should start with a verb, variable names should start with a name -
Macros should be between {} -
Do not use negative boolean (i.e. noJoe) -
Check minimal size of the types (double -> float -> int -> uint) -
Check const and ref in functions arguments -
References should be written "type& name", not "type &name" -
Update documentation if needed -
Add MR labels [ROS]/[ROS2]/[PV] -
If ros/ros2, update task table here -
Add a comment over each non trivial function in header files -
Add a header to each new file