@@ -127,6 +127,9 @@ namespace arise_slam {
127127 this ->declare_parameter <bool >(" use_imu_roll_pitch" ,true );
128128 this ->declare_parameter <bool >(" lidar_flip" ,false );
129129 this ->declare_parameter <std::string>(" sensor" );
130+ this ->declare_parameter <double >(" imu_acc_x_offset" , 0.0 );
131+ this ->declare_parameter <double >(" imu_acc_y_offset" , 0.0 );
132+ this ->declare_parameter <double >(" imu_acc_z_offset" , 0.0 );
130133 this ->declare_parameter <double >(" imu_acc_x_limit" , 1.0 );
131134 this ->declare_parameter <double >(" imu_acc_y_limit" , 1.0 );
132135 this ->declare_parameter <double >(" imu_acc_z_limit" , 1.0 );
@@ -140,6 +143,9 @@ namespace arise_slam {
140143 config_.smooth_factor = this ->get_parameter (" smooth_factor" ).as_double ();
141144 config_.use_imu_roll_pitch = this ->get_parameter (" use_imu_roll_pitch" ).as_bool ();
142145 config_.lidar_flip = this ->get_parameter (" lidar_flip" ).as_bool ();
146+ config_.imu_acc_x_offset = this ->get_parameter (" imu_acc_x_offset" ).as_double ();
147+ config_.imu_acc_y_offset = this ->get_parameter (" imu_acc_y_offset" ).as_double ();
148+ config_.imu_acc_z_offset = this ->get_parameter (" imu_acc_z_offset" ).as_double ();
143149 config_.imu_acc_x_limit = this ->get_parameter (" imu_acc_x_limit" ).as_double ();
144150 config_.imu_acc_y_limit = this ->get_parameter (" imu_acc_y_limit" ).as_double ();
145151 config_.imu_acc_z_limit = this ->get_parameter (" imu_acc_z_limit" ).as_double ();
@@ -851,6 +857,10 @@ namespace arise_slam {
851857 imu_raw->angular_velocity .y *= -1.0 ;
852858 imu_raw->angular_velocity .z *= -1.0 ;
853859 }
860+
861+ imu_raw->linear_acceleration .x += config_.imu_acc_x_offset ;
862+ imu_raw->linear_acceleration .y += config_.imu_acc_y_offset ;
863+ imu_raw->linear_acceleration .z += config_.imu_acc_z_offset ;
854864
855865 std::lock_guard<std::mutex> lock (mBuf );
856866
0 commit comments