-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minor fixes to light sensor: wrong id bug. #5
base: master
Are you sure you want to change the base?
Conversation
Thanks! Can you explain to me what the problem is? |
When the robot is directly facing the light source, it is reporting the right values, but when the light source is either in the left or right of the robot. The sensor is reporting the wrong values. From what I understood, It is basically associating the wrong sensor beam id, when the light source is either on the right or left. |
I'm sorry, can you be more precise? The changes you made do not fix the issue you mention. More specifically:
|
Okay, the problem is that the sensor rays that are considered for checking during the current step are not right all the time. More precisely, the logic behind the current implementation is that it takes into consideration the rays that are 180 degrees (90 deg before and after) around the point of the incident of the light on the robot (i.e the center ray). The way the center ray for checking is computed (https://github.com/ilpincy/argos3-kheperaiv/blob/master/src/plugins/robots/kheperaiv/simulator/kheperaiv_light_rotzonly_sensor.cpp#L161) results in the wrong set of rays when the light source is either in the right of the robot or left. That is why I did the fix that you are referring to in your first comment. Instead of just checking for a few selections of rays that are relevant based on the current position of the light source, I take into consideration all the rays, since the "ScaleReading" function (https://github.com/ilpincy/argos3-kheperaiv/blob/master/src/plugins/robots/kheperaiv/simulator/kheperaiv_light_rotzonly_sensor.cpp#L177) return zeros for all the rays that are not relevant. If you feel that it has to be fixed in other ways, I don't mind. Please feel free to fix it the right way, it was just my way of fixing it :-) For the second change, I added the half spacing offset because the foot-bot light sensor is using such an offset. I thought the sensors are identical, I just realized it is using different number of rays. So, you can neglect that change and it might not be necessary. |
Dear Carlo,
During our course "Swarm Intelligence", we had an exercise to use the light sensor of the kheperaIV robots. One of the students reported to me that the sensor is reporting false readings. As an approach to fix it, I made some minor changes, kindly look into it and merge them, if they make sense.
Thank you
With best regards,
Vivek