Skip to content
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

Use VehicleCommand specified heading for VTOL transition #24040

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JacopoPan
Copy link

Solved Problem

I wanted to use VEHICLE_CMD_NAV_VTOL_TAKEOFF's param2 to specify heading as in the MAVLINK Common Message Set in this example here but, in my understanding, PX4's vtol_takeoff.cpp defaults to the direction of the next waypoint in the mission

self.send_vehicle_command(
                        84, # VEHICLE_CMD_NAV_VTOL_TAKEOFF
                        param2=3.0, # takeoff mode 3: specified (custom PX4 only)
                        param4=yaw, # unused heading https://docs.px4.io/main/en/flight_modes_vtol/mission.html
                        # MAV_CMD_NAV_VTOL_TAKEOFF.param2 is ignored, heading to the next wp is used for the transition heading.
                        # Custom PX4 fix in navigator_main.cpp and vtol_takeoff.cpp circumvents this
                        param5=self.home_lat,
                        param6=self.home_lon,
                        param7=self.home_alt + alt,
                        conf=0
                        )

Solution

I added some naive logic to use the heading specified in param4 if and only if param2 is set to 3, it could be extended to be fully compliant with VTOL_TRANSITION_HEADING

Test coverage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant