-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
Enable loiter type offboard position setpoint for Fixedwing vehicles #13199
Conversation
@hamishwillee The types of position setpoints are in general UNDOCUMENTED. I realized this is a thing by going through the code. Now that it works would it make sense to add this to the documentation? |
@Jaeyoung-Lim Upshot, I can't answer this yet, because I don't understand where these come from and how they are used. |
@hamishwillee Exactly. It seems to be coming from #3405 and the type definitions didn't make it through the mavlink spec. The definitions just use raw bitfields so it is hard to track where it is coming from. I do like the fact that we can use the In my opinion, this should either be pushed to the mavlink standard or at least be documented somewhere. |
@Jaeyoung-Lim Thanks for the clarification. I don't know if this should be public or not, but if it is then IMO it has been done incorrectly. I have created mavlink/mavlink#1250 to discuss whether it should be public or not. Depending on how that falls out will define how this is documented. Can you tell me the difference between the idle and loiter setpoints, and why knowing the setpoint type is useful (as an answer to the linked PR?) |
@hamishwillee Specifying the position of the setpoint does not always fully define the expected behavior of the vehicle.
All three types use the same position setpoint, but the behavior is handled differently in the fixed wing position controller. |
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.
Looks reasonable to me. Haven't tested it in offboard, but tested it a bit in VTOL, doesn't seem to break anything in the other modes.
@Jaeyoung-Lim What do the setpoints do on other vehicle types? |
@hamishwillee I have replied in the user guide! |
@sfuhrer Can we get this merged? |
Yes! |
This really makes me think that loiter radius should be a FW parameter rather than navigator. |
Describe problem solved by this pull request
This PR Fixes #13180 , where sending the loiter type offboard position setpoint on a fixed wing vehicle will result in a fly away. Loiter setpoints can be useful for fixed wing offboard mode as normal position setpoints are passed as a reference to the l1 controller so there are no explicit constraints on the radius of the vehicle while keeping close to the position setpoint.
The reason the it wasn't working was
SET_POSITION_TARGET_LOCAL_NED
messages, therefore the vehicle is able to switch to offboard mode.loiter_radius
andloiter_direction
is not set fromSET_POSITION_TARGET_LOCAL_NED
, it is left as zero.Describe your solution
Set the
loiter_radius
andlotier_direction
ifloiter_radius<=0
it is invalid (which probabiliy means it is in offboard mode following position setpoints). It uses the defaultNAV_LOTIER_RAD
parameter as default loiter radiusTest data / coverage
This log shows a flight which is being sent a offboard local position setpoint at [0.0m, 0.0m, 20.0m] and being switched between mission mode and offboard mode