Commit Graph

4568 Commits

Author SHA1 Message Date
Andrew Tridgell b85f129cc5 ArduCopter: handle SETUP_SIGNING message 2016-05-21 15:25:12 +10:00
Randy Mackay 5461002eea Copter: read rangefinder at 20hz 2016-05-21 10:36:53 +09:00
Randy Mackay e6b3638d84 Copter: minor change to land mode's logic to use rangefinder
No functional change
2016-05-21 10:36:53 +09:00
Randy Mackay 8171532dc5 Copter: allow rangefinder to be disabled from definition 2016-05-21 10:36:53 +09:00
Randy Mackay e489c3184c Copter: rangefinder.enabled false if no range finders are configured 2016-05-21 10:36:53 +09:00
Randy Mackay 59070653cc Copter: provide filtered range finder altitude to AC_WPNav 2016-05-21 10:36:53 +09:00
Randy Mackay e18bf3af56 Copter: remove unused definitions 2016-05-21 10:36:53 +09:00
Randy Mackay 5ac13c0355 Copter: move rangefinder variables into structure
moved in rangefinder_alt, rangefinder_alt_health and rangefinder_enabled
2016-05-21 10:36:53 +09:00
Randy Mackay 70463dc572 Copter: auto_spline_start handles triggers terrain failsafe
Also immediately exit auto_wp_start on terrain failsafe
2016-05-21 10:36:53 +09:00
Randy Mackay 3688636736 Copter: RTL ignores terrain during terrain failsafe 2016-05-21 10:36:53 +09:00
Randy Mackay 273b9acad8 Copter: prearm check that RTL_ALT is below rangefinder max alt
Only applies where terrain following is enabled and a range finder is connected
2016-05-21 10:36:53 +09:00
Randy Mackay c7f80324fa Copter: tilt correct rangefinder 2016-05-21 10:36:53 +09:00
Randy Mackay ba38b0234f Copter: use rangefinder class's valid_range_count
Also read_rangefinder directly updates rangefinder_alt variable instead of returning distance
No functional change
2016-05-21 10:36:53 +09:00
Randy Mackay 949d5f7109 Copter: add rangefinder_alt_ok
Reduces some duplicate code,no functional change.
2016-05-21 10:36:53 +09:00
Randy Mackay 7689315ba2 Copter: rename sonar to rangefinder 2016-05-21 10:36:53 +09:00
Randy Mackay 028946ae9e Copter: rename CONFIG_SONAR to RANGEFINDER_ENABLE 2016-05-21 10:36:53 +09:00
Randy Mackay e0bf08abe0 Copter: fixes to guided mode target check is within fence
guided altitude targets are converted to alt-above-home
remove unnecessary fence_status local variable from guided_set_destination methods
log failures to set guided target under a new failure code: ERROR_CODE_DEST_OUTSIDE_FENCE (5)
rename pv_get_home_destination_distance_mc to pv_distance_to_home_cm
2016-05-21 09:56:12 +09:00
Saloni Jain bc22419286 Copter : Modified set_guided_destination() to reject requests for guided waypoints outside the fence. 2016-05-21 09:56:12 +09:00
Don Gagne 97d361333d ArduCopter: SET_SENSORS_OFFSETS support for third compass 2016-05-19 18:51:17 -03:00
Randy Mackay a9d16f3373 Copter: move auto's take-off check to beginning of auto_init
This ensures there are no side-effects of a failed switch to AUTO like stopping the vehicle or affecting the yaw mode
2016-05-19 19:43:24 +09:00
Niti Rohilla 26e41fee7a Copter: prevent Auto tipovers caused by missing takeoff command 2016-05-19 19:43:19 +09:00
Randy Mackay 793e3da904 Copter: rename variables used for NAV_DELAY command 2016-05-19 16:16:03 +09:00
Niti Rohilla 55f66b7696 Copter: Add support for MAV_CMD_NAV_DELAY 2016-05-19 16:16:02 +09:00
Andrew Tridgell e4948544e7 Copter: cleanup unnecessarily complex gcs[] usage 2016-05-17 08:27:35 +10:00
dgrat 3bc97ae356 ArduCopter: Do not use is_zero() for non-float types
This function makes only sense for floating point types. However this
function was also used for ints.
2016-05-16 19:08:35 -03:00
Ricardo de Almeida Gonzaga ce241dd97a ArduCopter: Fix typos 2016-05-13 19:20:07 -03:00
Francisco Ferreira 8fb318a6e1 Copter: fix do_loiter when executed in same location 2016-05-13 12:20:22 +09:00
Francisco Ferreira 8ce8551669 Copter: fix detection of 0 values for lat, lng and alt in waypoints 2016-05-13 12:20:20 +09:00
Randy Mackay 0732ad3957 Copter: add comments to set_land_complete 2016-05-13 12:01:38 +09:00
Jonathan Challinger 747344a8ba Copter: add disarm on land detect option to PILOT_THR_BHV 2016-05-13 11:57:48 +09:00
Randy Mackay cfb2a6b2f9 Copter: update brake-timeout to work with master
We added mode-change reasons since PR was submitted
2016-05-13 11:42:25 +09:00
Randy Mackay 0a2336a5a8 Copter: update solo-buttons to work with master
Change was due to addition of reason codes since PR was first submitted
2016-05-13 11:42:25 +09:00
Jonathan Challinger 67cd2bae08 Copter: implement SOLO_BTN commands 2016-05-13 11:42:25 +09:00
Jonathan Challinger c99cac773b Copter: add brake_timeout_to_loiter_ms 2016-05-13 11:42:25 +09:00
Andrew Tridgell bd3a58a727 Copter: fixed drift mode
the throttle assistance gain also needs to be scaled by 1000x for new throttle range
2016-05-13 08:48:55 +10:00
Andrew Tridgell 75d76ac3bd Copter: fixed scaling of old heli parms 2016-05-12 17:34:36 +10:00
dgrat 41661f815f AP_Math: Replace the pythagorous* functions with a variadic template
The new function can deal with a variable number of function parameters.
Additionally, I renamed the functions to norm(), because this is the
standard name used in several other projects.
2016-05-10 11:41:26 -03:00
dgrat 76362caee0 AP_Math: Replace wrap_* functions with template versions 2016-05-10 11:41:26 -03:00
skyscraper 4980c8bc94 ArduCopter: RC_Channel refactor
More fixing up of RC_Channel change direct access to data members
to access via member functions.
2016-05-10 16:21:16 +10:00
skyscraper 49d3410896 ArduCopter: fixup RC_Channel data member accesses to function calls 2016-05-10 16:21:16 +10:00
skyscraper 6f200fa923 ArduCopter: 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
Andrew Tridgell 3c9b063eb1 Copter: removed unnecessary libs
now in common
2016-05-10 14:13:35 +10:00
Andrew Tridgell 111eb2ccc1 Copter: use DataFlash::log_while_disarmed() 2016-05-09 12:05:52 +10:00
Leandro Pereira f23bd7e09d GCS_MAVLink: Use a single stream_trigger() implementation
This has no side effects, but since all implementations were basically
the same, move the implementation to GCS_Common and the only part that
adjusts the rate based on which which stream to each individual
GCS_MAVLINK implementation.
2016-05-07 23:49:35 -03:00
Andrew Tridgell 874fae931f Copter: fix for changed API 2016-05-07 18:27:22 +10:00
Andrew Tridgell 9da3b8db60 Copter: only log baro, gps and mag if ekf not logging them 2016-05-07 18:27:19 +10:00
Andrew Tridgell b235304235 Copter: reduce IMU logging to 25Hz
leave more room for IMT logging needed for Replay
2016-05-07 18:27:17 +10:00
Randy Mackay a5c55c3fbd Copter: fix get_non_takeoff_throttle
The throttle_mid parameter (for historic reason) is interpreted as a value that includes throttle_min.  This means we must subtract the throttle_min value from it when converting it to a throttle in the 0 to 1 range.
2016-05-07 12:21:41 +09:00
Randy Mackay 2eb0484142 Copter: rename Loiter states and swap order within select statement 2016-05-07 10:08:34 +09:00
Randy Mackay 1c4db779a1 Copter: Loiter stabilizes roll and pitch while landed 2016-05-07 10:08:32 +09:00