Open louiseadennis opened 2 months ago
I am willing to have a try at this!
I had a look at the code and I'm not sure if the binary occupancy grid based method could simulate a sound wave bouncing in the corner for example.
I think a ray tracing method could simulate this but I'm not really sure if this is the best approach or not, I know ray tracing can be very computationally expensive so I am willing to experiment with ray tracing.
Happy to assign it to you, and you can see if a ray tracing approach is feasible.
I have made a rough implementation of this, checkout https://github.com/dwoodv2/pirover_simulator/tree/raytrace
Do you have any kind test set - or even just a testing walkthrough I can try?
At the moment I just have print statements that tell you the angle and intensity of each ray, at the moment I am trying to iron out the bug where the ray never reaches the sensor, I probably did something stupid so once that works I'll figure out how to draw the rays
Only problem is that I don't really know how to draw lines while the game is running so if someone can tell me how to do that, that would be great 👍
My ray tracing implementation is now working properly!
Just run SonarAvoider.py
and the pysim.py
and you can see the robot path finding correctly.
The only thing I need to do now is to tweak the absorption coefficients and the other stuff listed in the TODO of sonar.py
This sounds great @dwoodv2 . Are you ready to submit a PR now, so @louiseadennis can try the code out?
All the sensors on the real robots are noisy while in the simulator they return an exact number based on information in the simulator.
In particular the ultrasonic distance sensor also has effects when the sounds bounces off a surface at an angle that aren't represented in the simulator.