Skip to content

Comments

Add IMU calibration tool and publish corrected IMU data#223

Merged
708yamaguchi merged 1 commit intoiory:mainfrom
708yamaguchi:calib-imu
Jan 31, 2026
Merged

Add IMU calibration tool and publish corrected IMU data#223
708yamaguchi merged 1 commit intoiory:mainfrom
708yamaguchi:calib-imu

Conversation

@708yamaguchi
Copy link
Collaborator

@708yamaguchi 708yamaguchi commented Jan 30, 2026

Summary

Added a GUI tool for calibrating the IMU accelerometer and implemented a feature to publish corrected IMU data using the calculated parameters.

Changes

  • Add Calibration Tool (imu_calibrator.py):

    • Implemented a Matplotlib-based GUI tool. Users can collect acceleration data by rotating the robot, and the tool calculates bias and scale parameters by fitting the data to a sphere using the least squares method.
    • The results are saved to a specified path in YAML format.
  • Add Calculation Logic (rcb4/imu_utils.py):

    • Added fit_sphere_to_imu_data function to calculate bias and scale factors.
  • Update ROS Bridge (rcb4_ros_bridge.py):

    • Added functionality to load the calibration YAML file.
    • Modified the node to publish a new topic /imu_corrected with the calibration parameters applied, in addition to the existing /imu topic.
  • Update Launch File (kxr_controller.launch):

    • Added imu_config_path argument to specify the calibration file path.

Usage

  1. Run Calibration

Run the following command to start the tool. Follow the GUI instructions to collect data and calculate the parameters. The result will be saved to the specified YAML file.

rosrun kxr_controller imu_calibrator.py -o ~/calibration_result.yaml
  1. Launch with Calibration Data
    Launch the controller with the generated YAML file. By setting publish_imu:=true, the corrected data will be published to /imu_corrected.
roslaunch kxr_controller kxr_controller.launch publish_imu:=true imu_config_path:=~/calibration_result.yaml
image

@github-actions
Copy link

github-actions bot commented Jan 30, 2026

🎬️ Watch Hardware CI Test Video

@708yamaguchi 708yamaguchi force-pushed the calib-imu branch 3 times, most recently from a4ca654 to 8197e83 Compare January 30, 2026 15:11
@708yamaguchi 708yamaguchi merged commit ba2de62 into iory:main Jan 31, 2026
6 checks passed
@708yamaguchi 708yamaguchi deleted the calib-imu branch February 8, 2026 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant