Skip to content

Commit

Permalink
Merge branch 'master' of github.com:HKUST-Aerial-Robotics/VINS-PC
Browse files Browse the repository at this point in the history
  • Loading branch information
qintonguav committed Jan 24, 2018
2 parents 799412b + 6b9760e commit 5d30745
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
13 changes: 9 additions & 4 deletions benchmark_publisher/src/benchmark_publisher_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@ struct Data
{
Data(FILE *f)
{
fscanf(f, " %lf,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f", &t,
if (fscanf(f, " %lf,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f", &t,
&px, &py, &pz,
&qw, &qx, &qy, &qz,
&vx, &vy, &vz,
&wx, &wy, &wz,
&ax, &ay, &az);
t /= 1e9;
&ax, &ay, &az) != EOF)
{
t /= 1e9;
}
}
double t;
float px, py, pz;
Expand Down Expand Up @@ -138,7 +140,10 @@ int main(int argc, char **argv)
return 0;
}
char tmp[10000];
fgets(tmp, 10000, f);
if (fgets(tmp, 10000, f) == NULL)
{
ROS_WARN("can't load ground truth; no data available");
}
while (!feof(f))
benchmark.emplace_back(f);
fclose(f);
Expand Down
7 changes: 7 additions & 0 deletions vins_estimator/src/estimator_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,17 @@ Eigen::Vector3d tmp_Bg;
Eigen::Vector3d acc_0;
Eigen::Vector3d gyr_0;
bool init_feature = 0;
bool init_imu = 1;

void predict(const sensor_msgs::ImuConstPtr &imu_msg)
{
double t = imu_msg->header.stamp.toSec();
if (init_imu)
{
latest_time = t;
init_imu = 0;
return;
}
double dt = t - latest_time;
latest_time = t;

Expand Down

0 comments on commit 5d30745

Please sign in to comment.