| 282 | } |
| 283 | |
| 284 | bool RosBaseDataProvider::parseImuData(ImuData* imu_data, |
| 285 | ImuParams* imu_params) const { |
| 286 | CHECK_NOTNULL(imu_data); |
| 287 | CHECK_NOTNULL(imu_params); |
| 288 | // Parse IMU calibration info (from param server) |
| 289 | double rate = 0.0; |
| 290 | CHECK(nh_private_.getParam("imu_rate_hz", rate)); |
| 291 | double gyro_noise = 0.0; |
| 292 | CHECK(nh_private_.getParam("gyroscope_noise_density", gyro_noise)); |
| 293 | double gyro_walk = 0.0; |
| 294 | CHECK(nh_private_.getParam("gyroscope_random_walk", gyro_walk)); |
| 295 | double acc_noise = 0.0; |
| 296 | CHECK(nh_private_.getParam("accelerometer_noise_density", acc_noise)); |
| 297 | double acc_walk = 0.0; |
| 298 | CHECK(nh_private_.getParam("accelerometer_random_walk", acc_walk)); |
| 299 | double imu_shift = 0.0; // check the actual sign of how it is applied (weird) |
| 300 | CHECK(nh_private_.getParam("imu_shift", imu_shift)); |
| 301 | LOG_IF(WARNING, imu_shift != 0.0) << "Adding/Substracting a timestamp shift to" |
| 302 | " IMU of: " << imu_shift; |
| 303 | CHECK_GT(rate, 0.0); |
| 304 | CHECK_GT(gyro_noise, 0.0); |
| 305 | CHECK_GT(gyro_walk, 0.0); |
| 306 | CHECK_GT(acc_noise, 0.0); |
| 307 | CHECK_GT(acc_walk, 0.0); |
| 308 | |
| 309 | // TODO(Sandro): Do we need these parameters?? |
| 310 | imu_data->nominal_imu_rate_ = 1.0 / rate; |
| 311 | imu_data->imu_rate_ = 1.0 / rate; |
| 312 | imu_data->imu_rate_std_ = 0.00500009; // set to 0 for now |
| 313 | imu_data->imu_rate_maxMismatch_ = 0.00500019; // set to 0 for now |
| 314 | |
| 315 | // Gyroscope and accelerometer noise parameters |
| 316 | // TODO(Toni): why are we not parsing these from .yaml file???? |
| 317 | imu_params->gyro_noise_ = gyro_noise; |
| 318 | imu_params->gyro_walk_ = gyro_walk; |
| 319 | imu_params->acc_noise_ = acc_noise; |
| 320 | imu_params->acc_walk_ = acc_walk; |
| 321 | // imu_shift is defined as t_imu = t_cam + imu_shift (see: Kalibr) |
| 322 | imu_params->imu_shift_ = imu_shift; |
| 323 | |
| 324 | ROS_INFO("Parsed IMU calibration"); |
| 325 | return true; |
| 326 | } |
| 327 | |
| 328 | void RosBaseDataProvider::publishOutput(const SpinOutputPacket& vio_output) { |
| 329 | publishTf(vio_output); |
nothing calls this directly
no outgoing calls
no test coverage detected