-
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
MAV_CMD_NAV_LOITER_TIME: add Heading Required field #1383
MAV_CMD_NAV_LOITER_TIME: add Heading Required field #1383
Conversation
…ption Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
de6f006
to
6d9aa73
Compare
@sfuhrer Do you mean MAV_CMD_NAV_LOITER_TO_ALT? This and other loiter commands specify an Xtrack location, which I interpret to mean an "exit track" location. That sounds a bit like the heading. On LOITER_TO_ALT
What I think that means is that the system will leave the loiter:
So it sounds like this is setting the exit heading, and probably you want either 1 or NaN. The thing it is missing is just "head off whenever you have reached the altitude]. I'd like to clarify what Xtrack does, because if we want to be consistent, then we need to adopt the same terminology. Does this make sense? |
message_definitions/v1.0/common.xml
Outdated
<param index="2">Empty</param> | ||
<description>Loiter at the specified Latitude, Longitude and Altitude for a certain amount of time. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint.</description> | ||
<param index="1" label="Time" units="s" minValue="0">Loiter time (only starts once Lat, Lon and Alt is reached).</param> | ||
<param index="2" label="Heading Required" minValue="0" maxValue="1" increment="1">Heading Required (0 = False)</param> | ||
<param index="3" label="Radius" units="m">Radius around waypoint. If positive loiter clockwise, else counter-clockwise.</param> | ||
<param index="4">Forward moving aircraft this sets exit xtrack location: 0 for center of loiter wp, 1 for exit location. Else, this is desired yaw angle. NaN to use the current system yaw heading mode (e.g. yaw towards next waypoint, yaw to home, etc.).</param> |
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.
Why not use the index 4 for this? It already has an effect for forward moving vehicles, just add the descrition for what it should do for "non-forward moving vehicles". Something like:
<param index="4" label="xtrack location/heading">For forward moving vehicles, this sets exit xtrack location: 0 for center of loiter, 1 for exit location. Else, this is desired yaw angle. NaN to use the current system yaw heading mode (e.g. yaw towards next waypoint, yaw to home, etc.). For other vehicles: 0 or NaN means do not change current Yaw behaviour, 1 means Yaw to next WP before leaving this point, other values (2.. 361) are a direct Yaw command before leaving this location.</param>
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.
This doesn't support case of leaving when heading is reached but then go back to the center line.
@hamishwillee here the promised screen shot of a mission containing MAV_CMD_NAV_LOITER_ALT with different configuration (at least that's how PX4 is interpreting it atm): |
@sfuhrer I got carried away and tried to tidy up the MC vs FW story on this. Would be good if you could sanity check this. Decided NOT to change comment about existing on tanjent of loiter to the center of the next waypoint. That isn't helpful because a system might well want to exit on the tanjent of one waypoint to the tanjent of the loiter circle of the next waypoint - and we shouldn't prohibit it. |
@hamishwillee your changes sound good yes, it's much better defined like this. Only one thing: For param4, isn't there a "For" missing, so "For forward moving aircraft..."? |
The current text also talks about wp instead of the lat/lon of this message |
In the context of a mission this means the same thing (though I would have referred to it as a "loiter waypoint". The Dev call are OK with the message as is. I'm going to look again tomorrow. I THINK this is OK, and that the change allows some things which cannot be done purely with X-track. Note, I will go through all these messages and update them consistently at some point. |
@sfuhrer I'm merging this now as agreed with the dev call. There have been general improvements to text which will roll out later. |
@sfuhrer I did not make the Xtrack change yet. The current definition of Xtrack is:
I interpret the exit xtrack to be the path that the vehicle will trend towards after exiting the loiter. So the values are.
Can you confirm, in particular for the yaw angle cases how it works? |
@hamishwillee I first want to point out that I'm much more familiar with the fixed-wing use case than the rotary-wing one, and I actually think that the second and third sentence are actually referring to MC use cases
For MC this seems to make sense, as you there can fly with arbitrary yaw. For FW it doesn't, an thus if you set anything beside exactly 1 it should do the default ("0") behavior. About the 3rd pic you posted, about the weird exit and then going to the tangent path of the opposite side of the circle: that seems to be a bug of PX4. I though want to point out that this setting (no heading wait but then xtrack=1) really makes no sense and should even be prevented (only allow xtrack=1 with also heading wait =1). Not sure if a re-write of this mavlink command though is necessary, or if it is rather for the ground station to disable setting anything other than heading wait =1 if xtrack=1 (resp. prevent xtrack=1 if heading wait =0). |
@sfuhrer Thank you.
@auturgy Xtrack defines the path that a fixed-wing vehicle will converge towards upon leaving loiter. I've put some examples above - #1383 (comment) The first two options above make sense - a tanjential path from the loiter to the center of the next waypoint, or a path from the tanjent that convergest to the direct line between the two points. The other two xpath settings are not clear, but I think they define "an angle of entry to the next waypoint relative to the center line between the waypoints". The angle being either explicit (degrees) or NaN ("system yaw"). In particular the system yaw option makes little sense since the behavour would be very unpredictable. Does ArduPilot use those, and if so, what for/when do you want to do this? My proposal is that we simply remove xtrack options other than 0 and 1. |
@auturgy When you get a chance, can you please look at my last post above |
Other then for the MAV_CMD_NAV_LOITER_ALT, for MAV_CMD_NAV_LOITER_TIME there was no possibility to add a "heading wait" requirement. In my opinion this field should be consistent for both of these loiter types.