Git Product home page Git Product logo

Comments (5)

ilpincy avatar ilpincy commented on August 18, 2024

Hi Ewout,

Thanks for spotting this bug! Yes, it looks like the check is missing. Are
you able to come up with a patch that fixes this issue? If so, thanks! :-)
Otherwise I'll work on it during the week.

Cheers,
Carlo

On Tue, May 17, 2016 at 10:29 AM, Ewout Merckx [email protected]
wrote:

Dear @ilpincy https://github.com/ilpincy,

I have noticed a bug while simulating an experiment with an eye-bot. In
this experiment, I have placed an eye-bot (containing a proximity sensor)
in front of a box entity.

[image: frame_00002]
https://cloud.githubusercontent.com/assets/5154631/15324996/1171d32a-1c49-11e6-97fb-c32379470b75.png

As you can see in the picture, some rays of the proximity sensor that
aren't intersecting with the entity, are marked in magenta. But the correct
color of those rays should be cyan, which means: not intersecting with an
entity.

I think this issue is caused by the mathematical model of the box
https://github.com/ilpincy/argos3/blob/master/src/core/utility/math/box.cpp.
More precisely, I think there is a check missing in the intersection
method: if the intersection point is behind the start point of the ray, no
intersection occurs.

Does this seem like a possible solution for the problem to you?

Sincerely yours,
Ewout Merckx


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#22

Carlo Pinciroli, Ph.D.
http://carlo.pinciroli.net/

from argos3.

EMerckx avatar EMerckx commented on August 18, 2024

I've had a quick look and the following line seems to have done the trick. It tells us that there is no intersection when the distance is negative (if I understand the code correctly).

if(fTMin < 0.0f) return false;

This can be inserted into this line. If it seems like a good solution to you, I'll generate a pull request for it.

from argos3.

ilpincy avatar ilpincy commented on August 18, 2024

I'm not sure without testing :-) Please try it, and if it works make a pull
request. Thank you very much! :-)

On Tue, May 17, 2016 at 12:19 PM, Ewout Merckx [email protected]
wrote:

I've had a quick look and the following line seems to have done the trick.
It tells us that there is no intersection when the distance is negative (if
I understand the code correctly).

if(fTMin < 0.0f) return false;

This can be inserted into this line
https://github.com/ilpincy/argos3/blob/master/src/core/utility/math/box.cpp#L41.
If it seems like a good solution to you, I'll generate a pull request for
it.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#22 (comment)

Carlo Pinciroli, Ph.D.
http://carlo.pinciroli.net/

from argos3.

EMerckx avatar EMerckx commented on August 18, 2024

The fix that I've mentioned above worked only when the eye-bot was in front of the box. I've implemented and tested another approach, which seems to work in all cases. You can view the code below.

/* Direction of the ray */
CVector3 cRayDir;
c_ray.GetDirection(cRayDir);
/* Vector between the ray origin and box center */
CVector3 cRayOrig2BoxCenter = cBoxCenter - cRayStart;
/* Scalar distance between the ray origin and point in box
 * No intersection if the ray intersects in the opposite direction */
if( cRayOrig2BoxCenter.DotProduct(cRayDir) < 0.0f ){
    return false;
}

However, I've noticed that there are still some other bugs in the intersection method of the box. It would be great if you could take a look at it, since I don't fully understand the code. In the picture below, you can see an example of a bug.

frame_00024

To make testing easier, I've attached the argos configuration file for the specific experiment to this comment. Here, the controller of the argos-circle experiment is used.
eyebot_box.zip

from argos3.

ilpincy avatar ilpincy commented on August 18, 2024

Fixed in commit e81c753

from argos3.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.