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

Enable offboard position setpoints for Fixedwing position control #12532

Merged
merged 4 commits into from
Aug 21, 2019

Conversation

Jaeyoung-Lim
Copy link
Member

@Jaeyoung-Lim Jaeyoung-Lim commented Jul 22, 2019

Describe problem solved by the proposed pull request
When streaming offboard position setpoint messages (SET_POSITION_TARGET_LOCAL_NED) for fixed wing, it is able to enter offboard mode (as offboard position setpoints are streamed) but unable to follow any setpoint and results in a flyaway. (#12517 ). Part of the reason is that fixed wing position control is based on global coordinates, while px4 does not support global position setpoints.

This PR enables local position setpoints to be consumed by the fixedwing position controller in offboard mode as a L1 reference position. This PR depends on PX4/PX4-ECL#624

Test data / coverage
This has been tested in SITL by sending a position setpoint at [200.0, 200.0, 30.0]m
https://review.px4.io/plot_app?log=98d07b9f-bfd2-4bb7-9daf-66cb68893ec1
To reproduce,

  1. Stream offboard position setpoints to the vehicle using mavros
  2. Set a mission with take off and loiter position, and start the mission
  3. Once the vehicle starts loitering the first waypoint trigger offboard mode with
commander mode offboard

Describe your preferred solution
Local position setpoints are converted into global setpoints that can be consumed from the fixedwing position controller.

Additional context
Recently offboard attitude setpoints have been started to work in fixed wing. #12311 #12149
Having able to control a fixed wing vehicle with highlevel setpoints such as position, whill greatly enhance the autonomy of fixed wing vehicle missions in offboard mode

@Jaeyoung-Lim Jaeyoung-Lim requested a review from RomanBapst July 22, 2019 07:47
@Jaeyoung-Lim Jaeyoung-Lim changed the title Pr fw offboard pos sp Enable offboard position setpoints for Fixedwing position control Jul 22, 2019
@Jaeyoung-Lim Jaeyoung-Lim requested a review from dagar July 24, 2019 14:35
@Jaeyoung-Lim Jaeyoung-Lim requested a review from bresch August 8, 2019 12:55
@Jaeyoung-Lim Jaeyoung-Lim force-pushed the pr-fw-offboard-pos-sp branch from 8316dec to 4d7a1bb Compare August 11, 2019 19:00
@Jaeyoung-Lim
Copy link
Member Author

Rebased due to merge conflicts. @bresch Would appreciate it if you could review this. Thanks!

Copy link
Member

@bresch bresch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good to me, but we would need to test a bit more. Did you try to enable/disable offboard during a mission flight?

@hamishwillee hamishwillee added the Documentation 📑 Anything improving the documentation of the code / ecosystem label Aug 15, 2019
@Jaeyoung-Lim
Copy link
Member Author

@bresch Here is a log of switching back and forth from mission mode and offboard mode https://review.px4.io/plot_app?log=06293060-4b34-42c6-a3e6-c9ae07209432

@Jaeyoung-Lim
Copy link
Member Author

@bresch Can we get this merged?

@bresch
Copy link
Member

bresch commented Aug 19, 2019

@PX4/testflights can you test that on a fixedwing/vtol please?

@Junkim3DR
Copy link

Junkim3DR commented Aug 20, 2019

Tested on Fixed Wing(Phantom) Pixhawk 1 v2:

Modes Tested

  • Stabilized Mode: Good.
  • Mission Plan Mode (Automated): Good.
  • RTL: Good.

Procedure
Arm and Take off in stabilized mode, after flying for approximately one minute proceed to switch to mission plan mode, make sure that vehicle follows all waypoints as shown in QGC, once completed all waypoint see loiter behavior.

Notes:
No issues noted, good flight in general.

Log:
https://review.px4.io/plot_app?log=a48a9d82-328f-40cc-8db1-e347b96d2ab5

@bresch
Copy link
Member

bresch commented Aug 21, 2019

Thanks @Junkim3DR .

@apoissant95
Copy link

My fixed wing is still unable to execute local position setpoints while in offboard mode using xplane10 HITL. I am running PX4 version 1.9.2, flashed from qgc. I am able to toggle to offboard mode via my RC when I publish attitude setpoint values through mavros. However, I am unable to toggle to offboard mode via my RC when I publish local position setpoint values through mavros. Additionally, when I publish attitude setpoint and local position setpoint values through mavros, I am able to enter offboard mode but the pixhawk only reacts to changes in the attitude setpoint values. Should this functionality be working with version 1.9.2 at this point in time?

@Jaeyoung-Lim
Copy link
Member Author

Jaeyoung-Lim commented Sep 18, 2019

@apoissant95 I don't think this change was part of 1.9.2

@apoissant95
Copy link

Ah. So how could I get this added functionality onto my Pixhawk? Are there plans to release these changes onto the Pixhawk firmware downloaded via qgc?

@Jaeyoung-Lim
Copy link
Member Author

@apoissant95 You can build master of this repo and upload to the pixhawk yourself. I believe it should be included in the next release

@apoissant95
Copy link

@Jaeyoung-Lim I flashed the beta for v1.10.0 using qgc but I got very strange behavior using fw hitl. Basically, when I would arm mission mode using hitl the plane would slowly turn on the ground for a couple seconds, then qgc would say it completed the uploaded mission, and it would disarm. So I just switched back to v1.9.2 and will play around more with just attitude setpoints until v1.10.0 is released.

@DronecodeBot
Copy link

This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there:

https://discuss.px4.io/t/fixed-wing-position-control-using-v1-15-flight-modes/42871/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation 📑 Anything improving the documentation of the code / ecosystem Fixed Wing 🛩️
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants