Skip to content

Commit 7f5d2ac

Browse files
committed
added gps to imu extrinsics
1 parent e0e3c58 commit 7f5d2ac

File tree

6 files changed

+25
-8
lines changed

6 files changed

+25
-8
lines changed

glider/config/example-params.yaml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,18 @@ integration_covariance: 0.001
44
bias_covariance: 0.001
55
use_second_order: 0.0
66
gravity: 9.81
7-
bias_num_measurements: 100
7+
bias_num_measurements: 100 # number for imu measurements to use for imu bias calc
88
gps_noise: 2.0
9-
odom_noise: 0.5
10-
heading_noise: 0.1
9+
odom_noise: 0.1 ## dep??
10+
heading_noise: 0.1 # dep??
1111
odom_orientation_noise: 0.1
1212
odom_translation_noise: 1.0
13-
odom_scale_noise: 50.0
14-
lag_time: 10.0
15-
imu_frame: "enu"
16-
scale_odom: true
17-
correct_imu: true
13+
odom_scale_noise: 1.0
14+
lag_time: 10.0 # amount of time for fixed lag smoother to look at
15+
imu_frame: "enu" # frame the imu outputs
16+
scale_odom: false # if you adding odom, does it need to be scaled?
17+
correct_imu: true # use mag to correct imu orienation
18+
gps_to_imu: # gps to imu extrinsics
19+
X: 0.0
20+
y: 0.0
21+
z: 0.0

glider/config/vectornav-vn100t.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,7 @@ lag_time: 10.0
1515
imu_frame: "enu"
1616
scale_odom: true
1717
correct_imu: true
18+
gps_to_imu:
19+
X: 0.0
20+
y: 0.0
21+
z: 0.0

glider/include/glider/core/glider.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class Glider
4242
bool set_initial_heading_;
4343
bool correct_imu_;
4444
std::string frame_;
45+
Eigen::Vector3d t_imu_gps_;
4546

4647
Eigen::Matrix3d ned_to_enu_rot_;
4748
Eigen::Quaterniond ned_to_enu_quat_;

glider/include/glider/utils/parameters.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* glider-mono parameters loaded from a yaml file.
66
*/
77

8+
#include <Eigen/Dense>
89
#include <yaml-cpp/yaml.h>
910
#include <string>
1011

@@ -37,5 +38,6 @@ struct Parameters
3738

3839
bool scale_odom;
3940
bool correct_imu;
41+
Eigen::Vector3d t_imu_gps;
4042
};
4143
}

glider/src/glider.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Glider::Glider(const std::string& path)
1818

1919
frame_ = params.frame;
2020
correct_imu_ = params.correct_imu;
21+
t_imu_gps_ = params.t_imu_gps;
2122

2223
// IMU transformations
2324
ned_to_enu_rot_ << 0.0, 1.0, 0.0,
@@ -75,6 +76,8 @@ void Glider::addGPS(int64_t timestamp, Eigen::Vector3d& gps)
7576
meas.head(2) << easting, northing;
7677
meas(2) = gps(2);
7778

79+
meas = meas + t_imu_gps_;
80+
7881
factor_manager_.addGpsFactor(timestamp, meas);
7982
}
8083

glider/src/parameters.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ Glider::Parameters::Parameters(const std::string& path)
3333

3434
frame = config["imu_frame"].as<std::string>();
3535
scale_odom = config["scale_odom"].as<bool>();
36+
t_imu_gps(0) = config["gps_to_imu"]["x"].as<double>();
37+
t_imu_gps(1) = config["gps_to_imu"]["y"].as<double>();
38+
t_imu_gps(2) = config["gps_to_imu"]["z"].as<double>();
3639
}
3740
catch (const YAML::Exception& e)
3841
{

0 commit comments

Comments
 (0)