Commit Graph

65 Commits

Author SHA1 Message Date
Pierre Kancir 65b4ba0539 ArduPlane: use past_interval_finish_line and line_path_proportion from Location 2019-04-23 09:20:43 +10:00
Pierre Kancir 3f5999a6ad ArduPlane: move location_update to Location and rename to offset_bearing 2019-04-06 09:10:28 +11:00
Pierre Kancir 58328da5f3 ArduPlane: move get_bearing_cd to Location and rename to get_bearing_to 2019-04-06 09:10:28 +11:00
Tom Pittenger 0270c57530 Plane: massive refactor and creation of Mode class 2019-04-02 16:28:52 +11:00
Dr.-Ing. Amilcar do Carmo Lucas f430fd14f6 Plane: replace location_offset() and get_distance() function calls with Location object member function calls
This allows removing duplicated code
2019-02-28 11:44:09 +11:00
Peter Barker acafb0f3c1 Plane: adjust for location flags being moved out of union 2019-01-16 11:45:29 +11:00
Michael du Breuil a78bce32c0 Plane: Allow users to force target airspeed in cruise or fbwb 2018-12-18 22:36:55 -08:00
Michael du Breuil 05484c3987 Plane: Support a different landing airspeed for fw quadplane landings 2018-12-18 10:11:22 +11:00
Michael du Breuil 42e67d5849 Plane: Whitespace fixes 2018-12-18 10:11:22 +11:00
Andrew Tridgell da69bf3391 Plane: added an abstraction for reverse thrust
use have_reverse_thrust() and get_throttle_input()
2018-11-16 08:33:35 +11:00
Michael du Breuil f150cae75a Plane: Allow center throttle to be trim airspeed in cruise 2018-09-11 09:07:00 +10:00
Michael du Breuil ee96c53844 Plane: Don't go to minimum airspeed when in RC failsafe in cruise/fbwb 2018-09-11 09:07:00 +10:00
Michael du Breuil 8417bcc7d5 Plane: Add flight options bitmask 2018-08-28 09:40:53 +10:00
Tom Pittenger 518abfe1d0 Plane: Allow GUIDED mode to take advantage of crosstrack flag. 2018-01-22 19:17:09 -08:00
Tom Pittenger 746ca91649 Plane: reset groundspeed_undershoot value when GPS is lost
If we lose GPS lock the gndspd undershoot value gets stuck at the last calculated value forever (until GPS locks again)
2018-01-09 17:05:04 -08:00
Tom Pittenger 1ef0f27786 Plane: allow control_mode enum to be in arbitrary order
never use control_mode >= BLAH. This requires the order to be important which greatly increases chance for unexpected behavior
Closes https://github.com/ArduPilot/ardupilot/issues/4656
2018-01-09 17:05:04 -08:00
Tom Pittenger 39a200b83f Plane: allow control_mode enum to be in arbitrary order
never use control_mode >= BLAH. This requires the order to be important which greatly increases chance for unexpected behavior
Closes https://github.com/ArduPilot/ardupilot/issues/4656
2018-01-09 17:05:04 -08:00
Michael du Breuil 1a3ca43e86 Plane: Don't check FS_SHORT_TIMEOUT if it's disabled
Also renames the check_minimum_altitude() to reflect that it's only used
for FBWB.
2017-11-24 09:58:01 -08:00
Tom Pittenger 7271586a47 Plane: invert auto_state.no_crosstrack flag to be auto_state.crosstrack. Non-functional change 2017-11-23 09:25:18 -08:00
Andrew Tridgell f14f40d3ef Plane: fixed GUIDED loiter with Q_RTL_MODE=1
this was broken by the recent RTL_RADIUS changes

thanks to Nick for noticing this!
2017-10-31 18:02:31 +11:00
Andrew Tridgell aa430a6e2c Plane: use RTL_RADIUS for QRTL threshold
when Q_RTL_MODE=1 in a quadplane use RTL_RADIUS as the distance to
switch to QRTL mode. We navigate to the destination using direct
waypoint navigation instead of using a loiter circle.
2017-10-30 16:30:38 +11:00
Andrew Tridgell c24ee9192b Plane: prevent a float exception at pitch 90
this can happen with a tailsitter
2017-10-30 16:30:38 +11:00
Andrew Tridgell 178e7eca54 Plane: always setup target airspeed
this sets up a target airspeed even when flying without an airspeed
sensor. This is needed for quadplanes without airspeed sensors where
we use synthetic airspeed during the transition in TECS
2017-07-31 09:55:44 -07:00
Peter Barker 250f315678 Plane: eliminate gcs_send_mission_item_reached wrapper 2017-07-11 23:45:16 +01:00
Andrew Tridgell 92f88e9b33 Plane: fixed climb rate for quadplanes in CRUISE
the high loop rate of quadplanes led to less than 1cm/loop change in
height, which got truncated to zero. Adjusting height at 10Hz fixes
that.

Thanks to Marco for reporting this!
2017-05-10 08:03:23 +10:00
Tom Pittenger 4ccd59f394 Plane: allow exiting loiter_to_alt in cases where you get stuck
- check for scenarios where updrafts can keep you from loitering down indefinitely.
2017-02-23 05:15:49 -08:00
Michael du Breuil 2326eee9a0 Plane: Move loiter_radius to vehicle 2017-01-30 10:43:54 -08:00
Tom Pittenger 61bc0a6206 Plane: check stage==LAND instead of landing.in_progress 2017-01-26 13:11:44 -08:00
Michael du Breuil 3e66dd10d7 Plane: Move landing stages inside AP_Landing and refactor 2017-01-26 13:11:44 -08:00
Randy Mackay c3b6fd4315 Plane: fix suppressing comment for case fall through
No functional change
eclipse stops complaining if no-break is used in place of fall-through
2016-12-14 13:22:15 +09:00
Tom Pittenger 696828c144 Plane: increase landing airspeed scaled to headwind 2016-12-02 15:35:28 -08:00
Tom Pittenger ac1dced3bf Plane: set landing params as private and use accessors 2016-11-25 19:07:30 -08:00
Tom Pittenger 8a5a62cfdc Plane: migrate aparm "LAND_" params from plane to AP_Landing 2016-11-25 19:07:30 -08:00
Tom Pittenger f556f705e6 Plane: move various g params to aparms 2016-11-25 19:07:30 -08:00
Tom Pittenger 896b931a7c Plane: Move auto_state variables to AP_landing members 2016-11-25 19:07:30 -08:00
Mathieu OTHACEHE 152edf7189 Global: remove mode line from headers
Using a global .dir-locals.el file is a better alternative than
reincluding the same emacs header in every file of the project.
2016-10-24 09:42:01 -02:00
murata 2f18d1de73 Plane: To add a judgment of 0 degrees longitude. 2016-10-04 08:15:23 -07:00
Andrew Tridgell 4e017bf5b3 Plane: fixed loiter mode when Q_GUIDED_MODE=1
This fixes the fixed wing behaviour of LOITER mode whne
Q_GUIDED_MODE=1.

Many thanks to the PertUAV team for finding and reporting this bug
2016-10-01 08:37:17 +10:00
Tom Pittenger ca32bcc58d Plane: add new flight mode AVOID_ADSB to mimic GUIDED 2016-08-17 22:38:54 -07:00
Tom Pittenger fc50f145ce Revert "ArduPlane: Convert references to AP_Airspeed. Added automatic migration of ARSPD_FBW_MIN and ARSPD_FBW_MAX (plane parameter) to ARSPD_FBW_MIN and ARSPD_FBW_MAX (library parameter)."
This reverts commit da1b18d918.
2016-08-07 17:54:24 -07:00
AndersonRayner da1b18d918 ArduPlane: Convert references to AP_Airspeed. Added automatic migration of ARSPD_FBW_MIN and ARSPD_FBW_MAX (plane parameter) to ARSPD_FBW_MIN and ARSPD_FBW_MAX (library parameter). 2016-08-04 10:09:04 -07:00
Tom Pittenger d2365c25c6 Plane: increase update_waypoint() distance threshold during update_loiter()
- outside this radius of a loiter waypoint is where crosstracking is available
2016-06-23 12:43:03 -07:00
Tom Pittenger 8a58f5a5eb Plane: convert airspeed_error_cmd to airspeed_error (in meters) 2016-05-13 17:21:59 -07:00
Tom Pittenger 25dfb583d5 Plane: adjust target_airspeed with and without airspeed sensor (pitot) 2016-05-13 17:14:47 -07:00
Andrew Tridgell 12e0012b16 Plane: allow for NAV_LOITER_UNLIM and NAV_LOITER_TIME in quadplane 2016-05-11 15:57:41 +10:00
Andrew Tridgell 3fc43b94f9 Plane: separate out auto and guided VTOL states
this prevents a switch to AUTO from using VTOL mode incorrectly
2016-05-11 15:14:43 +10:00
Andrew Tridgell 691d4b6ca7 Plane: added local reached_loiter_target()
this distinguishes between VTOL and fixed wing loiter targets
2016-05-11 05:55:26 +10:00
Andrew Tridgell 6b358a5618 Plane: added Q_GUIDED_MODE parameter
this allows you to do hybrid VTOL and fixed wing guided mode
2016-05-11 05:55:25 +10:00
skyscraper 7f29903287 ArduPlane: Fix up after refactoring RC_Channel class
Further to refactor of RC_Channel class which included
adding get_xx set_xx methods, change reads and writes to the public members
to calls to  get and set functionsss

old public member(int16_t)   get function -> int16_t     set function (int16_t)
(expression where c is an object of type RC_Channel)
c.radio_in                     c.get_radio_in()           c.set_radio_in(v)
c.control_in                   c.get_control_in()         c.set_control_in(v)
c.servo_out                    c.get_servo_out()          c.set_servo_out(v)
c.pwm_out                      c.get_pwm_out()            // use existing
c.radio_out                    c.get_radio_out()          c.set_radio_out(v)
c.radio_max                    c.get_radio_max()          c.set_radio_max(v)
c.radio_min                    c.get_radio_min()          c.set_radio_min(v)
c.radio_trim                   c.get_radio_trim()         c.set_radio_trim(v);

c.min_max_configured() // return true if min and max are configured

Because data members of RC_Channels are now private and so cannot be written directly
 some overloads are provided in the Plane classes to provide the old functionality

new overload Plane::stick_mix_channel(RC_Channel *channel)
which forwards to the previously existing
void stick_mix_channel(RC_Channel *channel, int16_t &servo_out);

new overload Plane::channel_output_mixer(Rc_Channel* , RC_Channel*)const
which forwards to
(uint8_t mixing_type, int16_t & chan1, int16_t & chan2)const;

Rename functions

 RC_Channel_aux::set_radio_trim(Aux_servo_function_t function)
    to RC_Channel_aux::set_trim_to_radio_in_for(Aux_servo_function_t function)

 RC_Channel_aux::set_servo_out(Aux_servo_function_t function, int16_t value)
    to RC_Channel_aux::set_servo_out_for(Aux_servo_function_t function, int16_t value)

 Rationale:

        RC_Channel is a complicated class, which combines
        several functionalities dealing with stick inputs
        in pwm and logical units, logical and actual actuator
        outputs, unit conversion etc, etc
        The intent of this PR is to clarify existing use of
        the class. At the basic level it should now be possible
        to grep all places where private variable is set by
        searching for the set_xx function.

        (The wider purpose is to provide a more generic and
        logically simpler method of output mixing. This is a small step)
2016-05-10 16:21:16 +10:00
Tom Pittenger ec3e9014e4 Plane: move target land_airspeed logic to top layer
- this is to allow min groundspeed to be enforced which is otherwise lost when TECS assigns a target airspeed at the lower level
2016-04-21 21:30:50 -07:00