Comments (5)
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.pngAs 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.
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.
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.
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.
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.
Fixed in commit e81c753
from argos3.
Related Issues (20)
- argos3_simulator.pc no longer generated ? HOT 8
- Compiling the e-puck plugin for argos3 59 HOT 5
- No package 'argos3_simulator' found HOT 2
- ARGoS Checkpointing
- enh/actuator-enable-disable-interface
- Issue in building the doc in installation with Eclipse HOT 1
- gl.h not found in Mac OSX 11.4 Big Sur HOT 1
- Increasing the # cameras in ARGoS HOT 5
- EmodiedEntity init is called before successful place HOT 2
- Bugs in ARGoS cmdline HOT 8
- bugfix/34/stderr-redirect
- Black screen HOT 3
- Physics of gripping with the foot-bot
- Install MacOS glut not found HOT 9
- Not using threads on WSL2 (Windows 11) HOT 2
- Bugs and usability of ARGoS drone HOT 3
- footbot_encoder can not be reading. HOT 3
- include could not find requested file: ARGoSCheckQTOpenGL HOT 1
- argos visualization error when running CPFA: cannot find CPFA_qt_user_functions on Ubuntu 22.04 LTS HOT 1
- [Fatal] Can't load library "/usr/lib/argos3/libargos3plugin_simulator_media.so"...undefined symbol HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from argos3.