-
Notifications
You must be signed in to change notification settings - Fork 475
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
[Gazebo 9] Added test to check collisions equal to zero #2788
[Gazebo 9] Added test to check collisions equal to zero #2788
Conversation
Signed-off-by: ahcorde <ahcorde@gmail.com>
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.
I tried the test, it passes, but it also passes when I reverted to the original code that produced the GUI bug before the change in https://github.com/osrf/gazebo/pull/2768/files .
I reverted Visual.cc lines 814-823 to the original lines 814-815. In GUI, when I do View > Collisions, I get
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.
Aborted (core dumped)
But the test is passing with this original version of code. So it is not exposing the bug.
gazebo/rendering/Visual_TEST.cc
Outdated
@@ -1588,6 +1588,33 @@ TEST_F(Visual_TEST, ConvertVisualType) | |||
rendering::Visual::ConvertVisualType(msgs::Visual::PHYSICS)); | |||
} | |||
|
|||
TEST_F(Visual_TEST, collisionZero) | |||
{ | |||
// This test checks that there isn't a segmentation fault when inserting zero collision geometries |
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.
Code check is saying lines 1593 and 1594 should be < 80 chars long.
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.
I tried the test, it passes, but it also passes when I reverted to the original code
Maybe the failure condition can be triggered by calling scene->ShowCollisions(true)
.
Signed-off-by: ahcorde <ahcorde@gmail.com>
Verified that now the test does fail with the error above when
|
Signed-off-by: ahcorde <ahcorde@gmail.com>
Thank you @mabelzhang ! I got confused with the 100 characters per line in ROS |
Yeah I do that too. I don't even remember if ign-gazebo is 80 or 100. |
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.
CI looks fine. Feel free to merge.
* Added test to check collisions equal to zero Signed-off-by: ahcorde <ahcorde@gmail.com> * Included feedback Signed-off-by: ahcorde <ahcorde@gmail.com> * make linters happy Signed-off-by: ahcorde <ahcorde@gmail.com> * Update Visual_TEST.cc
* Added test to check collisions equal to zero Signed-off-by: ahcorde <ahcorde@gmail.com> * Included feedback Signed-off-by: ahcorde <ahcorde@gmail.com> * make linters happy Signed-off-by: ahcorde <ahcorde@gmail.com> * Update Visual_TEST.cc
* Added test to check collisions equal to zero Signed-off-by: ahcorde <ahcorde@gmail.com> * Included feedback Signed-off-by: ahcorde <ahcorde@gmail.com> * make linters happy Signed-off-by: ahcorde <ahcorde@gmail.com> * Update Visual_TEST.cc
* Fixed crash when collision size is zero Signed-off-by: ahcorde <ahcorde@gmail.com> * Using ignition::math::isnan Signed-off-by: ahcorde <ahcorde@gmail.com> * Improved error message Signed-off-by: ahcorde <ahcorde@gmail.com> * fixed method to get the name of the visual Signed-off-by: ahcorde <ahcorde@gmail.com> * Fixed else brackets Signed-off-by: ahcorde <ahcorde@gmail.com> * [Gazebo 9] Added test to check collisions equal to zero (#2788) * Added test to check collisions equal to zero Signed-off-by: ahcorde <ahcorde@gmail.com> * Included feedback Signed-off-by: ahcorde <ahcorde@gmail.com> * make linters happy Signed-off-by: ahcorde <ahcorde@gmail.com> * Update Visual_TEST.cc
I missed to add tests in this PR #2768.
I added a world with a box, sphere and cylinder with collisions equal to zero. The test will try to load the world, no segmentation fault should happens
Signed-off-by: ahcorde ahcorde@gmail.com