Skip to content
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

Fix crash when setting covariance using null quaternion #1180

Closed
wants to merge 1 commit into from

Conversation

dhood
Copy link
Contributor

@dhood dhood commented Jan 3, 2018

This is an alternative fix for #1137. The current fix in place is from #1139 which prevented the crash by rejecting the invalid quaternions.

The root cause of the crash was that, although the null quaternion is set to identity in FrameManager::transform() at this line, it was still using the null quaternion for the covariance display.

This will allow us to not reject null quaternions, which is important given the prevalence of invalid quaternions as uncovered by #1167

@dhood dhood self-assigned this Jan 3, 2018
@dhood dhood requested a review from wjwwood January 3, 2018 02:13
Copy link
Contributor

@rhaschke rhaschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think #1179 solves the issue in a more fundamental fashion.

{
ori.w = 1.0;
}

// Set the orientation of the fixed node. Since this node is attached to the root node, it's orientation will be the
// inverse of pose's orientation.
fixed_orientation_node_->setOrientation(ori.Inverse());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In contrast to #1179, this PR doesn't handle normalization of the quaternion. As ogre and rviz/ros might follow different normalization strategies, this might yield inconsistent results, because the quaternion is once normalized internally by ROS (see #1179 (comment)) before being passed to SceneNode::setOrientation and once (here) not.

@dhood
Copy link
Contributor Author

dhood commented Jan 3, 2018

I think #1179 solves the issue in a more fundamental fashion.

We had been looking to avoid normalising the quaternions (just dealing with the null ones as the bare minimum) but as you pointed out they are being normalised anyway elsewhere. So now I agree and this PR will likely be closed in favour of #1179

@rhaschke
Copy link
Contributor

rhaschke commented Jan 4, 2018

So now I agree and this PR will likely be closed in favour of #1179.

@dhood Why did you then merged #1182 ? This obviously creates conflicts with #1179.
Sorry, didn't yet read the conversation in #1179.

@dhood dhood closed this Jan 4, 2018
@dhood dhood deleted the fix_covar_crash branch January 4, 2018 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants