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

FlightTaskManualAltitude: Follow altitude limit given by the estimator #13958

Merged
merged 6 commits into from
Feb 3, 2020

Conversation

bresch
Copy link
Member

@bresch bresch commented Jan 15, 2020

Describe problem solved by this pull request
The altitude agl is limited by the sonar range when taking off without GPS aiding, even if it is gained in air because the constraint is only updated on activate.

Describe your solution
Continuously track the constraint sent by the estimator

Describe possible alternatives
This function should be virtual and the horizontal limits updated in FlightTaskManualPosition

Test data / coverage
SITL tests with flow and intermittent GPS
https://logs.px4.io/plot_app?log=f60d771e-3008-4b44-8d96-2476e7c38c8b
2020-01-15_02-34-42_01_plot

_updateConstraintsFromEstimator();

_max_speed_up = _constraints.speed_up;
_min_speed_down = _constraints.speed_down;
Copy link
Member

@MaEtUgR MaEtUgR Jan 16, 2020

Choose a reason for hiding this comment

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

Suggested change
_min_speed_down = _constraints.speed_down;
_max_speed_down = _constraints.speed_down;

The name confuses me since if I read min_speed_down I'm assuming you have to fly a certain minimum speed to descend... well, it wasn't your decision.

Copy link
Member Author

Choose a reason for hiding this comment

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

Totally agree, I made a 2nd commit to rename that.

Copy link
Member Author

Choose a reason for hiding this comment

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

@MaEtUgR Can you approve again please?

MaEtUgR
MaEtUgR previously approved these changes Jan 16, 2020
Copy link
Member

@MaEtUgR MaEtUgR left a comment

Choose a reason for hiding this comment

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

Looks correct to me, seems to work looking at the plot.

@bresch
Copy link
Member Author

bresch commented Jan 17, 2020

@PX4/testflights Can you fly that please?
Do you have a multicopter with optical flow and range finder? If yes, please try that:

  • Make sure you have optical flow and GPS fusion enabled in EKF2_AID_MASK
  • Takeoff in position to an altitude above the max distance of the range finder
  • Disable GPS fusion in EKF2_AID_MASK (it will tell that you need to reboot to have an effect, but that will still work), the drone should go down by itself to the maximum altitude of the range finder
  • Try to raise the throttle stick to gain altitude (the drone shouldn't be able to climb)
  • Enable GPS fusion in EKF2_AID_MASK, wait a few seconds
  • Try to raise the throttle stick to gain altitude (the drone should climb)

Thanks in advance.

@bresch bresch requested a review from MaEtUgR January 17, 2020 09:43
@bresch
Copy link
Member Author

bresch commented Jan 21, 2020

Ping @PX4/testflights

@bresch bresch requested a review from a team January 21, 2020 19:01
@Tony3dr
Copy link

Tony3dr commented Jan 21, 2020

@bresch, unfortunately, we don't have a setup with optical flow or range finder.

@codecov
Copy link

codecov bot commented Feb 3, 2020

Codecov Report

Merging #13958 into master will increase coverage by 0.17%.
The diff coverage is 33.47%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #13958      +/-   ##
==========================================
+ Coverage   35.97%   36.14%   +0.17%     
==========================================
  Files         574      545      -29     
  Lines       48714    46887    -1827     
==========================================
- Hits        17523    16947     -576     
+ Misses      31191    29940    -1251
Flag Coverage Δ
#mavsdk 36.14% <33.47%> (?)
#sitl_mission_FW ?
#sitl_mission_MC_box ?
#sitl_mission_MC_offboard_att ?
#sitl_mission_MC_offboard_pos ?
#sitl_mission_Rover ?
#sitl_mission_VTOL_standard ?
#sitl_mission_VTOL_tailsitter ?
#sitl_python_FW ?
#sitl_python_MC_box ?
#sitl_python_MC_offboard_att ?
#sitl_python_MC_offboard_pos ?
#sitl_python_Rover ?
#sitl_python_VTOL_standard ?
#sitl_python_VTOL_tailsitter ?
Impacted Files Coverage Δ
src/modules/navigator/navigator_main.cpp 48.86% <ø> (+5.83%) ⬆️
src/modules/rc_update/rc_update.h 0% <ø> (ø) ⬆️
...ehicle_angular_velocity/VehicleAngularVelocity.hpp 100% <ø> (ø) ⬆️
.../modules/navigator/mission_feasibility_checker.cpp 34.49% <ø> (-19.31%) ⬇️
src/modules/uORB/SubscriptionCallback.hpp 83.33% <ø> (ø) ⬆️
src/modules/mavlink/mavlink_messages.cpp 71.71% <ø> (+4.17%) ⬆️
...c/modules/vtol_att_control/vtol_att_control_main.h 94.11% <ø> (ø) ⬆️
src/modules/commander/state_machine_helper.cpp 36.92% <ø> (+8.71%) ⬆️
src/modules/logger/logged_topics.cpp 70.77% <ø> (-0.53%) ⬇️
src/modules/logger/logger.cpp 65.01% <ø> (+0.55%) ⬆️
... and 195 more

@bresch
Copy link
Member Author

bresch commented Feb 3, 2020

This had enough testing on my side

@bresch bresch merged commit c80593a into master Feb 3, 2020
@bresch bresch deleted the pr-ekf-agl-lim-upstream branch February 3, 2020 17:05
@nicovanduijn
Copy link
Contributor

This fixes #13350

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

Successfully merging this pull request may close these issues.

4 participants