Commit Graph

42 Commits

Author SHA1 Message Date
Peter Barker b7f982d7ce Copter: support for arming and disarming using an auxsw 2017-02-06 16:48:50 +09:00
Andrew Tridgell 0f6d0c5ba9 Copter: combined tri, single, coax and multicopter into a single build
this allows copter to be just 2 builds, one for heli, and one for
everything else
2017-01-12 17:39:37 +11:00
Andrew Tridgell 5a87ae3f01 Copter: use new SRV_Channels API 2017-01-12 17:39:37 +11:00
Peter Barker a233024e05 Copter: fix compilation when fence andd proximity are disabled
This adds AC_AVOID_ENABLED; avoidance must be disabled if either
of fence or proximity are disabled.

Parameter definitions have been reordered to avoid compiler warnings;
this make sthe numbering non-linear
2017-01-03 10:44:03 +09:00
Randy Mackay 38478638de Copter: aux switch for enable/disable proximity based avoidance 2016-12-20 19:48:02 +09:00
Randy Mackay 2371b05696 Copter: init avoid-adsb and prec-loiter enabled from switch positions
Without this there could be a mismatch between the switch position and whether the feature is enabled/disabled
2016-12-19 17:01:16 +09:00
Randy Mackay 2365036e5c Copter: move #if within case statement in switches.cpp
This removes some compile warnings when features are disabled
2016-12-19 17:01:12 +09:00
Randy Mackay 70feff487e Copter: format fixes to switches.cpp
No functional change
2016-12-19 17:01:09 +09:00
Peter Barker 556eb88fe5 Copter: fix compile when precland is not selected
Fixes #5327
2016-12-05 20:03:00 +09:00
Peter Barker e72f5a6240 ArduCopter: enable/disable precision loiter on a switch
A switch MUST be assigned for precision loiter to be enabled
2016-11-18 09:41:56 +09:00
Peter Barker 2fd6be8ccb ArduCopter: neaten reading of aux switches 2016-11-18 09:41:56 +09:00
Peter Barker 236b8ab6b7 Copter: make EPM a subclass of AP_Gripper_Backend 2016-11-05 10:20:39 +09:00
Peter Barker 920868145c Copter: support for AP_Gripper 2016-11-05 10:20:33 +09:00
Peter Barker d877a00825 Copter: call run rather than enable for sprayer 2016-10-29 15:02:54 +09: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
Randy Mackay ccc99c772f Copter: remove union from aux_con for switch state 2016-10-14 10:31:05 +09:00
murata b23823a934 Copter: delete unused variable from aux switch structure 2016-10-14 10:30:41 +09:00
Peter Barker b81074d83a Copter: simplify auxsw duplicates check 2016-09-23 18:12:19 +09:00
Randy Mackay e17c8ac851 Copter: remove non-working reset-to-armed-yaw
Arguably we should make this work, but until that happens we should not present the option on the auxiliary switches
2016-08-29 16:34:24 +09:00
Jonathan Challinger 80f3541933 Copter: add configurable arming delay 2016-08-04 15:19:22 +09:00
Randy Mackay 807e930251 Copter: throw uses motor spooling instead of interlock 2016-08-02 20:25:52 +09:00
Randy Mackay d50987f976 Copter: avoidance_adsb implements copter avoidance using ADSB 2016-07-25 20:24:37 +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 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 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
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
Jonathan Challinger 1356deab8b Copter: add control_mode_reason 2016-04-14 12:24:04 +09:00
Jonathan Challinger a0ce8af633 Copter: use enum type for control_mode 2016-04-14 12:24:04 +09:00
Randy Mackay a93a0d370a Copter: add throw mode to aux switches 2016-03-03 15:30:03 +09:00
Paul Riseborough a7b69366a1 Copter: Add flight mode for throw launch
The is commit adds a new flight mode called 'Throw' to Copter that enables the copter to be thrown into the air to start motors. This mode can only be netered when the copters EKF has a valid position estimate and goes through the following states

Throw_Disarmed - The copter is disarmed and motors are off.
Throw_Detecting - The copter is armed, but motors will not spin unless THROW_MOT_START has been set to 1. The copter is waiting to detect the throw. A throw with an upwards velocity of at least 50cm/s is required to trigger the detector.
Throw_Uprighting - The throw has been detected and the copter is being uprighted with 50% throttle to maximise control authority. This state transitions when the copter is within 30 degrees of level.
Throw_HgtStabilise - The copter is kept level and height is stabilised about the target height which is 3m above the height at which the throw release was detected. This state transitions when the height is no more than 0.5m below the demanded height.
Throw_PosHold - The horizontal motion is arrested and the copter is kept at a constant position and height.
2016-03-03 12:18:13 +09:00
Randy Mackay 6a67ad706c Copter: add Relays to aux switch parameter descriptions
Also fix formatting of new options in switches.cpp
No functional change
2016-01-08 12:13:37 +09:00
Gavin Mogensen 3918987507 Copter: aux switches for relays 2,3 and 4 2016-01-08 12:12:47 +09:00
Andrew Tridgell 5c94b61f49 Copter: support up to 14 input channels for all boards 2016-01-04 08:22:51 +11:00
Lucas De Marchi 2591261af6 Global: rename min and max macros to uppercase
The problem with using min() and max() is that they conflict with some
C++ headers. Name the macros in uppercase instead. We may go case by
case later converting them to be typesafe.

Changes generated with:

	git ls-files '*.cpp' '*.h' -z | xargs -0 sed -i 's/\([^_[:alnum:]]\)max(/\1MAX(/g'
	git ls-files '*.cpp' '*.h' -z | xargs -0 sed -i 's/\([^_[:alnum:]]\)min(/\1MIN(/g'
2015-12-01 16:28:09 -02:00
Randy Mackay 1b29a1af46 Copter: consolidate setting of using-iterlock state 2015-11-17 09:02:31 +09:00
lvale 549695181c Copter: revised and uniformization of severity messages 2015-11-05 12:20:49 +09:00
Lucas De Marchi 84da1f5039 Rename gcs_send_text_P to gcs_send_text 2015-10-30 14:35:07 +09:00
Lucas De Marchi 2c38e31c93 Remove use of PSTR
The PSTR is already define as a NOP for all supported platforms. It's
only needed for AVR so here we remove all the uses throughout the
codebase.

This was automated with a simple python script so it also converts
places which spans to multiple lines, removing the matching parentheses.

AVR-specific places were not changed.
2015-10-30 14:35:04 +09:00
squilter 767b4da5b6 Copter: update send text severities 2015-08-25 14:05:25 +09:00
Andrew Tridgell 278883c521 Copter: finished conversion to .cpp files
Pair-Programmed-With: Randy Mackay <rmackay9@yahoo.com>
2015-05-30 15:21:19 +09:00
Andrew Tridgell 356ece3402 Copter: rename .pde files to .cpp files 2015-05-30 15:21:15 +09:00