-
Notifications
You must be signed in to change notification settings - Fork 495
Fixed crash when collision size is zero #2768
Fixed crash when collision size is zero #2768
Conversation
Signed-off-by: ahcorde <[email protected]>
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.
The fix works for me. Looks like the CI doesn't like isnan
. I think std::isnan
would fix it.
Steps to reproduce the original GUI crash:
Create an SDF that has a link with collision sized 0 0 0
, e.g.:
...
<link name="link">
<collision name="collision">
<geometry>
<box>
<size>0 0 0</size>
</box>
</geometry>
...
Run Gazebo with GUI,
$ gazebo file.world
Go to menu View > Collisions, and GUI will crash with this error
gzclient: /build/ogre-1.9-B6QkmW/ogre-1.9-1.9.0+dfsg1/OgreMain/src/OgreNode.cpp:630: virtual void Ogre::Node::setScale(const Ogre::Vector3&): Assertion `!inScale.isNaN() && "Invalid vector supplied as parameter"' failed.
With this PR, the crash no longer happens.
Signed-off-by: ahcorde <[email protected]>
Signed-off-by: ahcorde <[email protected]>
Signed-off-by: ahcorde <[email protected]>
Thanks for the feedback @mabelzhang. I solved the compilation error but there are several unrelated test failures. I also improved the error message. I will backport and forwardport to gazebo 7 and 11 when this is ready to merge. |
Signed-off-by: ahcorde <[email protected]>
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.
Looks good. I was going to say approval on green CI, but the buildfarm status board CI page isn't loading for me, so I can't compare to tell if the tests normally failed... Are these known flaky tests?
PhysicsEngines/JointTest.SpringDamperTest
PluginTest.ModelExceptionConstructor
PluginTest.ModelExceptionInit
PluginTest.ModelExceptionLoad
PluginInterface.LoadParams
Issue1208Test.Reset
Okay buildfarm is back up. I can see the Linux failures are not new, and Windows looks fine, Mac for some reason didn't run the tests? |
Ouch there was a cut in the connection of the Mac machine:
|
I don't see any regressions caused by this PR, but it would be nice to have a test that reproduces this problem. I wasn't able to reproduce on my mac, so maybe it's based on a difference between the Ubuntu and homebrew ogre 1.9 packages. |
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.
Approving as it's not breaking CI.
I don't have permissions to merge in the repository. Feel free to merge it |
I like @scpeters 's idea of adding a test, we should always try to add tests that are broken before a fix, and pass after the fix. @ahcorde , do you think you could add a test similar to this one that exercises the bug being fixed? I think you could add a test world with a model that has I think it would be enough to add the test to #2769 and then we can merge the test forward to |
Sure, I will add the test 👍 |
Ah sorry I misunderstood and merged early. I thought Steve was talking about reproducing the error in Jenkins... :X |
Signed-off-by: ahcorde <[email protected]>
Signed-off-by: ahcorde <[email protected]>
This PR fixed an issue when the collision size of a link is
0 0 0
.Signed-off-by: ahcorde [email protected]