gazebosim / gazebo-classic

Gazebo classic. For the latest version, see https://github.com/gazebosim/gz-sim
http://classic.gazebosim.org/
Other
1.17k stars 476 forks source link

Bug in BoudingBox() method of class Model #2964

Open bach05 opened 3 years ago

bach05 commented 3 years ago

Hi,

I think there is a bug in the model::BoundingBox method. In fact it should return an ignition::math::Box described by 2 corners (min and max).

However I noticed that whenever there is a negative value for the "max" corner, it is rounded to 0. Let's see an example:

[Dbg] [AutonomousActorPlugin.cc:224] Collision box: Min[-5 -5.1 0] Max[5 0 2]

In this case the right box would be Min[-5 -5.1 0] Max[5 -4.9 2]. It happens every time I think the max corner should have negative values.

Are there any way to solve the problem? Thank you in advance.

scpeters commented 3 years ago

Thanks for the report. Can you supply an SDFormat file with a concrete example so we can reproduce the error?

bach05 commented 3 years ago

Of course. This is the world I used in my experiments. It comes from PAL Robotics Tiago simulation and it uses a personalized version of AutonomousActorPlugin. I attach it as simple_office_with_people_motion2.txt.

simple_office_with_people_motion2.txt

You should be able to reproduce the effect by using a simpler world like simple_office_with_people_motion.txt.

simple_office_with_people_motion.txt

For example I obtain that wall_3_model has a bounding box Min[-5.1 -5 0] Max[0 10 2] that is weird. Don't hesitate to contact me for further questions. For example, if you need it, I can give you the code of my AutonomousActor.