Calculate offset for any track #3
Comments
I would like to try to avoid custom compiled Speed Dreams executable and replace the installation. In particular I am not sure if positive coordinates are expected in "track overview" with positions of all cars?? My preference is currently (2). |
Actually, I am most inclined to (4) the adjustment could be done inside the UDP driver dll. The best would be to push it upstream to vadim's repo. So my preference is (4) since I think it is going to be the least amount of work and it has very high likelihood of delivering what we want. I am afraid (2) is the opposite - lots of work, low likelihood. |
OK, I agree with (4) too. The best would be (0,0,0) in the middle of the start line. |
The segment after start line is flagged with
So all segment closer to start line have TR_START set. Let's use
That somewhat corresponds to
in demo.py so I am on right track so to speak |
The final offset for espie circuit is |
In #1 we have a working demo for espie track with hard coded
offset
. When a track is loaded, it has 0,0 at the start line. However, when Speed Dreams loads a track, it offsets its coordinates so that all of them are positive. The issue is further complicated by the fact, that tracks loaded by Speed Dreams are split to subsegments as defined in the track xml file (usually max len 10m).One way to deal with this could be to use custom compiled Speed Dreams where this offseting is disabled. That would mean the 0,0 would be at the start line (actually it would be the left hand corner of the start line).
Another way to deal with it could be to replicate the behavior in the python loader.
Yet another way could be to load the module
trackv1
from Speed Dreams into python with cffi and use their loader directly.I am somewhat inclined to go with option 1. There is already a manual step of unziping the roborace stuff into the installation so including the exe would be no big deal.
The text was updated successfully, but these errors were encountered: