TauLabs / TauLabs

taulabs.org
Other
454 stars 393 forks source link

Vtol Path Follower extension #1012

Closed peabody124 closed 10 years ago

peabody124 commented 10 years ago

So I was discussing useful failsafe RTH behavior with some guys today and have a few thoughts on the vtol path follower.

Goals:

  1. be able to execute a sequence of actions to achieve a goals
  2. commonly desired compact enough goals should fit within vtol path follower module to keep the memory usage reasonable, if possible
  3. some of the goals I am envisioning:
    • hold position - done
    • fly to position - done
    • fly path (vector path including curved ones) - done
    • land at location - done
    • RTH and land (e.g. hover for X seconds, hit altitude, fly to location, hover for X seconds, and decend)

The last option isn't really possible with our architecture. We could try and create a module between PathFollower and PathPlanner to execute these multi-step goals, but I'd prefer to keep the memory usage down if possible.

So my plan (baring alternative suggestions) is to implement a state machine within the path follower so the high level goal can be decomposed into a sequence of sub-goals. This is a bit of a different FSM than any that we currently have in place. For example some of the sub-goal sequences might share some sub goals. E.g. fly path has one sub-goal (fly path) which is reused by other sub-goals (the full landing sequence).

I'm thinking the way to implement this is to have a FSM structure for each goal and initialize it whenever the goal changes. Then the actually entry_fn can be shared amongst goals.

@solidgoldbomb - if you have a chance could you briefly comment if this seems like a reasonable approach or if there is a standard C approach for this type of problem.

peabody124 commented 10 years ago

This was fixed by #1054