-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
common: extend MISSION_CURRENT #1869
Conversation
a91915e
to
96180dc
Compare
The message MISSION_CURRENT is a bit limited as it sends the current mission item sequence but no context. My proposition would be to include the total as well as the status of an ongoing mission.
96180dc
to
f726ca0
Compare
@peterbarker Would appreciate your comment on this. At the moment you can infer some of the states of the mission from the mode (particularly in ArduPilot where pause is a sub mode of auto). This is not so easy in PX4 where "pause = hold mode" (except after an "autocontinue" pause). I don't think it is easy in either case to know if a mission has actually completed. So this adds state information to the MISSION_CURRENT, along with the total number of mission items, so a user doesn't need to separately query the mission for that. |
Mission states are a little complex and we may need to rethink this to make sure that we're sending the right information. What that information depends on who/how this is consumed. In summary though Summary, IMO
This is a change from having an option "Paused not in auto". There is a difference between saying "Pausing a mission mission moves it into hold mode" and "PX4 implements pause as hold". I THINK we are the former - certainly the mode is advertised as Hold in QGC. Make sense? There is some useful info about what the systems do below. TLDR; The "reality" is that we have a mission state machine that might have states "like[+]":
[+]: I say "like" because some implementations use the same "state" mission stopped for mission not yet started and complete. Further, plane does not support paused, even in theory. Then on top of this we have the case where a mission may be suspended - i.e. you're in another mode like "Hold". In this case. The mission is not running at all but the state still exists and might be re-entered. ArduCopter matches those states precisely (as sub modes).
ArduPlane does not implement the mission paused state; you cannot pause mission, you can only suspend it by changing mode.
PX4 does a mix of these two, implementing both pause sub modes and emulating pause-as-switch to mode:
So:
|
message_definitions/v1.0/common.xml
Outdated
<extensions/> | ||
<field type="uint16_t" name="total" invalid="UINT16_MAX">Total number of mission items. 0: Not supported, UINT16_MAX if no mission is present on the vehicle.</field> | ||
<field type="uint8_t" name="status" enum="MISSION_FSM_STATE" invalid="0">Mission finite state machine state. MISSION_FSM_STATE_UNKNOWN if state reporting not supported.</field> | ||
<field type="uint8_t" name="mission mode" minValue="0" maxValue="2" increment="1" invalid="0">Vehicle is in a mode that can execute mission items (not suspended). 0: Unknown, 1: Mission mode, 2: Not in mission mode (suspended).</field> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@julianoes Do you think this needs to be an enum?
@julianoes @tridge I updated so all fields are 0 for the default "not supported" case. In addition, have modified the reporting of state in line with the notes above. It now reports state using two fields. The first is the state of the mission state machine. The second is whether or not the mission is suspended (worded as whether it is in mission mode or not). That allows a recipient to absolutely know the what the mission state is. Is it worth considering also reporting on whether jump counters are reset? If so, would making the last byte into an set of flags that includes suspended and jump counters be a better implementation? |
@hamishwillee thanks for the changes, looks much better |
I removed the finite state machine reference as I would consider that the implementation rather than what should be in the spec. I also renamed the field from status to mission_state while at it. Also, I fixed the mission mode field name adding an underscore.
As discussed in dev call, this has been reviewed by ArduPilot and PX4 and can be merged. Note that this:
Thanks for this @julianoes , and @tridge for helping me understand how ArduPlane works with missions. |
FYI @TSC21 |
The message MISSION_CURRENT is a bit limited as it sends the current mission item sequence but no context.
My proposition would be to include the total as well as the status of an ongoing mission.
Related to #1868.