Page 1 of 1

Editing Bounding Box

Posted: Mon May 21, 2018 11:28 am
by RoboUser
Hello all,

I am trying to change the bounding box of the foot bot.

I found several bounding box generating functions and changed the bounding box there (tried realistic and also very large bounding boxes) but nothing changed.

Of course, I recompiled and reinstalled everything all the time and changes on the robots visual form were also correctly displayed, but the bounding box always stayed the same.

It would be great if someone could point me to the right function to change.

These are the changes I tried:

Code: Select all

diff --git a/src/plugins/robots/foot-bot/simulator/dynamics2d_footbot_model.cpp b/src/plugins/robots/foot-bot/simulator/dynamics2d_foo tbot_model.cpp index 5cc8392..7d27478 100644 --- a/src/plugins/robots/foot-bot/simulator/dynamics2d_footbot_model.cpp +++ b/src/plugins/robots/foot-bot/simulator/dynamics2d_footbot_model.cpp @@ -200,11 +200,11 @@ namespace argos { /****************************************/ void CDynamics2DFootBotModel::CalculateBoundingBox() { - GetBoundingBox().MinCorner.SetX(m_ptBaseShape->bb.l); + GetBoundingBox().MinCorner.SetX(m_ptBaseShape->bb.l-10.5); GetBoundingBox().MinCorner.SetY(m_ptBaseShape->bb.b); GetBoundingBox().MinCorner.SetZ(GetDynamics2DEngine().GetElevation()); - GetBoundingBox().MaxCorner.SetX(m_ptBaseShape->bb.r); - GetBoundingBox().MaxCorner.SetY(m_ptBaseShape->bb.t); + GetBoundingBox().MaxCorner.SetX(m_ptBaseShape->bb.r+10.0); + GetBoundingBox().MaxCorner.SetY(m_ptBaseShape->bb.t+10.0); GetBoundingBox().MaxCorner.SetZ(GetDynamics2DEngine().GetElevation() + FOOTBOT_HEIGHT); } diff --git a/src/plugins/robots/foot-bot/simulator/pointmass3d_footbot_model.cpp b/src/plugins/robots/foot-bot/simulator/pointmass3d_f ootbot_model.cpp index 4987e5e..5a8ff28 100644 +++ b/src/plugins/robots/foot-bot/simulator/pointmass3d_footbot_model.cpp @@ -67,12 +67,12 @@ GetBoundingBox().MinCorner.Set( - GetEmbodiedEntity().GetOriginAnchor().Position.GetY() - FOOTBOT_RADIUS, + GetEmbodiedEntity().GetOriginAnchor().Position.GetY() - FOOTBOT_RADIUS-10, GetEmbodiedEntity().GetOriginAnchor().Position.GetZ()); GetBoundingBox().MaxCorner.Set( - GetEmbodiedEntity().GetOriginAnchor().Position.GetX() + FOOTBOT_RADIUS, - GetEmbodiedEntity().GetOriginAnchor().Position.GetY() + FOOTBOT_RADIUS, + GetEmbodiedEntity().GetOriginAnchor().Position.GetX() + FOOTBOT_RADIUS+10, + GetEmbodiedEntity().GetOriginAnchor().Position.GetY() + FOOTBOT_RADIUS+10, GetEmbodiedEntity().GetOriginAnchor().Position.GetZ() + FOOTBOT_HEIGHT); }
Thanks a lot,

Andreas

Re: Editing Bounding Box

Posted: Mon May 21, 2018 8:06 pm
by pincy
What are you trying to achieve by changing the foot-bot bounding box?

In other words: what is the problem, what is the expected behavior you want, and what do you observe instead?

Re: Editing Bounding Box

Posted: Mon May 21, 2018 8:30 pm
by RoboUser
I developed a multi-robot motion planner which works really fine with the circular foot bot.
But now I want to give it a more challenging problem in a robot with a non-circular footprint.
So my idea was to modify the existing foot bot to a more elonged rectangular shape.
Or does another premade robot already exist which such a form?

EDIT: I think I found it, I will post a solution when I verified that it works.

PS: Can you show bounding boxes in the GUI? I want to verify that my changes are correct.

Thank you a lot!

Re: Editing Bounding Box

Posted: Tue May 22, 2018 3:35 pm
by pincy
The bounding box is only used to test whether to perform a precise intersection test on the actual robot body. Changing the size of the bounding box simply makes ARGoS perform more tests (larger box) or less tests (smaller box, also a bug).

If you want to have square robots, then the best would be to make a new robot with an actual square body. You can use the e-puck as a starting point, or (even better) the Khepera plugin code.

Another possibility is to use the newly added prototype entity to make a new robot from XML.

Re: Editing Bounding Box

Posted: Tue May 22, 2018 4:05 pm
by allsey87
If you want to get started with the prototype entity you can:

1. Install ARGoS 3.0.0-beta50
2. Run the example in src/testing/examples/dynamics3d_multi_body_test.argos
3. Modify this example to create the robot that you want

Please note, however, that the prototype entity is currently only available for the dynamics 3D engine (also introduced in beta50).