-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Use VehicleCommand specified heading for VTOL transition #24040
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
base: main
Are you sure you want to change the base?
Conversation
f18e33e to
e916400
Compare
|
@sfuhrer I've assigned to you as "in your area of interest". |
sfuhrer
left a comment
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.
That overall doesn't look like a bad idea, and thanks for the clean write up!
vtol_takeff.cpp is not used as part of a mission, but is intended to be used as a standalone command. You can set the transition altitude and the loiter point it should go to after the transition, and it does the transition already in direction of this point. I guess you then do not pass along a loiter point, or what's the motivation behind setting the transition direction independently?
|
@JacopoPan If this goes in, it will require documentation. I am assuming that this will work in both mission and via a mavlink command, and if so, the places to update would be:
@sfuhrer I think we're missing a VTOL takeoff page in https://docs.px4.io/main/en/frames_vtol/ - right? Can you help with that. I would expect that to note behaviour of MAV_CMD_NAV_VTOL_TAKEOFF when sent as a command. My understanding is that VTOL always take off in MC mode and then transition. Currently they will ignore param4 (yaw angle) but will respect the other parameters. After this change, they will respect param4 and yaw to face the specified direction after taking off (to what height). Is that right? |
Yes, my use case was indeed to climb in quad mode to a given altitude, transition towards a specified heading and then send a new loiter point (with a different altitude and specified radius) as soon as the transition is completed. The motivation was being able to do parallel transitions but with different target loiters for multiple vehicles as well as being slightly more compliant to the definition of https://mavlink.io/en/messages/common.html#MAV_CMD_NAV_VTOL_TAKEOFF It has been a while since I implemented this (originally on 1.14), so I'll also run a few more tests in the next few days |
|
I have done a few SITL experiments. The current implementation of VehicleCommand 84 specifies altitude (of the transition) and lat/lon of the loiter point sent immediately after transition. From what I see in simulation, radius and altitude of the loiter are NAV_LOITER_RAD and VTO_LOITER_ALT. The proposed modification should not affect any of the behaviors currently possible but would add the ability to explicitly specify a transition direction. |
sfuhrer
left a comment
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.
Thanks, looks clean and should not interfere with anything existing.
@hamishwillee it doesn't affect Mission, only the VTOL_Takeoff mode. That one doesn't have a button to be triggered in QGC, only in proprietary ground stations or over companion computer.
sfuhrer
left a comment
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.
@JacopoPan there is a CI failure - can you run make format and push the change?
@sfuhrer Thanks, but just to be clear,
|
done, sorry about that |
If the will/desire is to add docs through this same PR, I can certainly start a draft |
@JacopoPan IMO the only thing that you really should update in this PR would be the docs in https://github.com/PX4/PX4-Autopilot/blob/main/msg/versioned/VehicleCommand.msg - since I think that indicates the parameter is unused. At least check it. Any other docs don't have to be in this PR but it should happen in a relatively timely manner. They would also include an update to the release note Thanks! |
Solved Problem
I wanted to use
VEHICLE_CMD_NAV_VTOL_TAKEOFF'sparam2to specify heading as in the MAVLINK Common Message Set but, in my understanding, PX4'svtol_takeoff.cppdefaults to the direction of the next waypoint in the missionThis issue was also pointed out here: Auterion/px4-ros2-interface-lib#50
Solution
I added some naive logic to use the heading specified in
param4if and only ifparam2is set to 3, it could be extended to be more thoroughly compliant with MAVLink'sVTOL_TRANSITION_HEADINGTest coverage