-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevention of (0,0,0) Gps Odometry Due To Failed Transform #40
Prevention of (0,0,0) Gps Odometry Due To Failed Transform #40
Conversation
simple merge into noetic
Merge Noetic-Devel Into Noetic
Update Noetic to match noetic-devel for HOTFIX release
Merge noetic-devel into noetic
Merging Noetic-Devel to Noetic
This pull request has been linked to Shortcut Story #32541: Initial Prevention of (0,0,0) gps odometry during time jump. |
// Rotate the covariance as well | ||
tf2::Matrix3x3 rot(cartesian_world_transform_.getRotation()); | ||
Eigen::MatrixXd rot_6d(POSE_SIZE, POSE_SIZE); | ||
rot_6d.setIdentity(); | ||
|
||
// Rotate the covariance | ||
latest_cartesian_covariance_ = rot_6d * latest_cartesian_covariance_.eval() * rot_6d.transpose(); | ||
for (size_t rInd = 0; rInd < POSITION_SIZE; ++rInd) | ||
{ | ||
rot_6d(rInd, 0) = rot.getRow(rInd).getX(); | ||
rot_6d(rInd, 1) = rot.getRow(rInd).getY(); | ||
rot_6d(rInd, 2) = rot.getRow(rInd).getZ(); | ||
rot_6d(rInd+POSITION_SIZE, 3) = rot.getRow(rInd).getX(); | ||
rot_6d(rInd+POSITION_SIZE, 4) = rot.getRow(rInd).getY(); | ||
rot_6d(rInd+POSITION_SIZE, 5) = rot.getRow(rInd).getZ(); | ||
} | ||
|
||
// Now fill out the message. Set the orientation to the identity. | ||
tf2::toMsg(transformed_cartesian_robot, gps_odom.pose.pose); | ||
gps_odom.pose.pose.position.z = (zero_altitude_ ? 0.0 : gps_odom.pose.pose.position.z); | ||
// Rotate the covariance | ||
latest_cartesian_covariance_ = rot_6d * latest_cartesian_covariance_.eval() * rot_6d.transpose(); | ||
|
||
// Copy the measurement's covariance matrix so that we can rotate it later | ||
for (size_t i = 0; i < POSE_SIZE; i++) | ||
{ | ||
for (size_t j = 0; j < POSE_SIZE; j++) | ||
// Now fill out the message. Set the orientation to the identity. | ||
tf2::toMsg(transformed_cartesian_robot, gps_odom.pose.pose); | ||
gps_odom.pose.pose.position.z = (zero_altitude_ ? 0.0 : gps_odom.pose.pose.position.z); | ||
|
||
// Copy the measurement's covariance matrix so that we can rotate it later | ||
for (size_t i = 0; i < POSE_SIZE; i++) | ||
{ | ||
gps_odom.pose.covariance[POSE_SIZE * i + j] = latest_cartesian_covariance_(i, j); | ||
for (size_t j = 0; j < POSE_SIZE; j++) | ||
{ | ||
gps_odom.pose.covariance[POSE_SIZE * i + j] = latest_cartesian_covariance_(i, j); | ||
} | ||
} | ||
} | ||
|
||
// Mark this GPS as used | ||
gps_updated_ = false; | ||
new_data = true; | ||
// Mark this GPS as used | ||
gps_updated_ = false; | ||
new_data = true; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That code was only indented. not changed.
gps_updated_ = false; | ||
new_data = true; | ||
// Mark this GPS as used | ||
gps_updated_ = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to do something with this class-member variable in an else
condition? If gps_updated_
remains true, what consequence does that have?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If gps_updated_ remains true, what consequence does that have?
The only consequence is that next time the prepareGpsOdometry(..)
is called , then it would use the latest latest_cartesian_pose_
( made from the latest time a gps fix message was received.) . We'd also be using that latest gps fix header time as well.
Overview
Impact
Description
Changes
Testing:
NEWTIME=$(date -d "$(date '+%F %T.%N Z') - 0.5 second" '+%F %T.%N') ; timedatectl set-time "$NEWTIME"
after making sure set-ntp was set to false.NEWTIME=$(date -d "$(date '+%F %T.%N Z') - 30.5 second" '+%F %T.%N') ; timedatectl set-time "$NEWTIME"
after making sure set-ntp was set to false.Checklist:
CHANGELOG.rst