Skip to content

Commit 2c9f395

Browse files
fix(imu_corrector): correct sign of offset in imu_corrector (autowarefoundation#1022)
* fix: change sign of offset in imu_corrector Signed-off-by: kminoda <koji.m.minoda@gmail.com> * add an equation in imu_corrector readme Signed-off-by: kminoda <koji.m.minoda@gmail.com> * update readme in imu_corrector Signed-off-by: kminoda <koji.m.minoda@gmail.com> * update readme in imu_corrector Signed-off-by: kminoda <koji.m.minoda@gmail.com> * ci(pre-commit): autofix Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent da64820 commit 2c9f395

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

sensing/imu_corrector/README.md

+11-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,17 @@
44

55
`imu_corrector_node` is a node that correct imu data.
66

7-
1. Correct yaw rate offset by reading the parameter.
8-
2. Correct yaw rate standard deviation by reading the parameter.
7+
1. Correct yaw rate offset $b$ by reading the parameter.
8+
2. Correct yaw rate standard deviation $\sigma$ by reading the parameter.
9+
10+
Mathematically, we assume the following equation:
11+
12+
$$
13+
\tilde{\omega}(t) = \omega(t) + b(t) + n(t)
14+
$$
15+
16+
where $\tilde{\omega}$ denotes observed angular velocity, $\omega$ denotes true angular velocity, $b$ denotes an offset, and $n$ denotes a gaussian noise.
17+
We also assume that $n\sim\mathcal{N}(0, \sigma^2)$.
918

1019
<!-- TODO(TIER IV): Make this repository public or change the link. -->
1120
<!-- Use the value estimated by [deviation_estimator](https://github.com/tier4/calibration_tools/tree/main/localization/deviation_estimation_tools) as the parameters for this node. -->

sensing/imu_corrector/src/imu_corrector_core.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ void ImuCorrector::callbackImu(const sensor_msgs::msg::Imu::ConstSharedPtr imu_m
3838
sensor_msgs::msg::Imu imu_msg;
3939
imu_msg = *imu_msg_ptr;
4040

41-
imu_msg.angular_velocity.x += angular_velocity_offset_x_;
42-
imu_msg.angular_velocity.y += angular_velocity_offset_y_;
43-
imu_msg.angular_velocity.z += angular_velocity_offset_z_;
41+
imu_msg.angular_velocity.x -= angular_velocity_offset_x_;
42+
imu_msg.angular_velocity.y -= angular_velocity_offset_y_;
43+
imu_msg.angular_velocity.z -= angular_velocity_offset_z_;
4444

4545
imu_msg.angular_velocity_covariance[0 * 3 + 0] =
4646
angular_velocity_stddev_xx_ * angular_velocity_stddev_xx_;

0 commit comments

Comments
 (0)