Hi,
I'm testing my Race.py script with the simulator. I use the WaitForWaitpoint(n) call to wait for every waypoint in the race and just after that I have a log.
What I see is that the waipoint log is not written when the robot is at the proper point in the track.
Do we need to keep track on how much zig-zag we are doing to update in some way the waypoint distances? Is it just an approximation and will not be too precise? Is anyone else seeing something similar?
Thanks,
Jorge
You are completely right about the distances being an approximation.
They are based on some calculations using the motor speeds and the position data from the camera.
The calculation is in the
imageProcessor.py
script in theControlLoop
class.The function is called
IncreaseDistance
and it attempts to work out distance based on:We did find that the estimate of speed for this calculation was a bit inaccurate in the simulation.
In
Settings.py
there are two versions of the estimated max speed:yetiSpeed
- this version is used when running an actual racesimulationYetiSpeed
- this version is used in the simulationIt may be that the values here are not quite right.
The best thing to do is assume the waypoints will not be perfect during an actual race, it may be worth trying
WaitForDistance
and figuring out what distances best match the place you wish to make changes.Alternatively you can adjust the exact positions used for the waypoints by changing the
distanceBetweenWaypoints
values inSettings.py
.As for the calculation itself it is not perfect, there are some parts which can be improved:
Improvements to this calculation will likely give more accurate distance reporting.
Ok, thanks for the clarifications. I'll see how I can use that.
Add new comment