robotika / osgar

Open Source Garden (Autonomous) Robot
MIT License
13 stars 12 forks source link

Add radio follow option for Pam drone #853

Closed m3d closed 3 years ago

m3d commented 3 years ago

This is preparation step towards relay/stafeta optimization. It is rather backbone and this (draft) PR is for confirmation if I am going the right/wrong direction.

The basic naming scheme is as before, including X for "eXtended parameters", so letters and numbers after X are not parsed for basic strategy (XM is reserved for extended mapping). The robot, which should be followed is named (prefixed) after X, i.e. B10W1200EXA will wait 10s and then switch to "exploration" mode for 1200s while following robot A.

The new module RadioFollower queries MTM (multi-trace manager) for known trace of "leader robot" (A in our case) and once a while generates waypoints to main application to be followed (old functionality used in Octomap planning). There is new app.follow_status reporting current status of "following the trace" in particular when the application waits for new trace because the old one is finished.

And that is it. There is a lot to do, in particular speed optimization of following the trace, what to do in case the trace is no longer passable (blocked passage), etc.

Reference run: https://subtchallenge.world/submission/2b4f87ba-3bb1-4d48-bcb4-46eda764c39f (with blocked passage example ;)

m3d commented 3 years ago

some pictures from simulation: follow-local-run (local run following "exactly" drone A to the entry)

FP1 (accidentally selected Left) follow-blocked-passage

FP1 - blocked passage - what to do? (well, give up following, switch to old "follow wall" and optionally reconnect later? follow-what-to-do

m3d commented 3 years ago

The B-drone actually cuts the trajectory but at the moment there is only very small radius in app: FP1-follow-left-mtm (MTM of drone B)

m3d commented 3 years ago

Also note oscillations of the follower (which is slowing it down): follow-oscillations

m3d commented 3 years ago

https://subtchallenge.world/submission/2799499e-74e7-41d6-9ba2-0bb7f2e8847e is now running for the right side with 120s wait before the 2nd drone starts.

m3d commented 3 years ago

For the FP1-right did A-drone all the work, and B-drone was "dancing in circles" FP1-B-mtm-follow

m3d commented 3 years ago

and here is detail of the loops + collision avoidance maneuver of A-drone FP1-follow-loops

m3d commented 3 years ago

Smooth run of two drones in FP1 1) teambase does not see too far: FP1-two-drones-teambase 2) both drones have seen the far drill and both reported it (because the answer was not known yet)

0:11:59.902133 received: ['TYPE_DRILL', [34860, -78631, -4957], 'A600R', None]
0:16:11.897796 received: ['TYPE_DRILL', [34860, -78631, -4957], 'A600R', True]
2:42:30.812082 received: ['TYPE_DRILL', [343345, 22241, -14987], 'A600R', None]
2:42:30.812082 received: ['TYPE_DRILL', [343590, 22247, -14679], 'B120W1200ERXA', None]
2:42:31.046969 received: ['TYPE_DRILL', [343345, 22241, -14987], 'A600R', True]
2:42:31.048064 received: ['TYPE_DRILL', [343590, 22247, -14679], 'B120W1200ERXA', False]

And here is shared info from Teambase MTM: FP1-drone-following-mtm

m3d commented 3 years ago

ver119follow now at least scores 2 points on the left (two drones), where the follower B detects blocked passages, switches to follow left wall and after 600s returns home 98334146-1b86-4c3c-826d-d3d47dd05701 ... so now to make it superior to regular relay/stafeta.

m3d commented 3 years ago

I am going to close this until fully functional use case is available.