Commit Graph

23 Commits

Author SHA1 Message Date
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
Randy Mackay
caf6bbc2e0 Copter: rename set_alt to set_alt_cm in control_rtl 2016-04-30 10:33:01 +09:00
Randy Mackay
43d14defd4 Copter: RTL handles terrain data failure 2016-04-30 10:33:01 +09:00
Randy Mackay
352b6ae82a Copter: RTL supports terrain altitudes 2016-04-30 10:33:01 +09:00
Jonathan Challinger
1356deab8b Copter: add control_mode_reason 2016-04-14 12:24:04 +09:00
Randy Mackay
a927db3e6a Copter: rtl uses AP_Motors set_desired_spool_state 2016-04-01 11:59:30 +09:00
Leonard Hall
cce426dcb8 Copter: rtl uses throttle in 0 to 1 range and sets motor spool state 2016-04-01 11:59:30 +09:00
Randy Mackay
2c5f9422d4 Copter: log event if pilot cancels land
Also add definition for throttle value that cancels land
2016-01-14 15:21:57 +09:00
Jonathan Challinger
8965185587 Copter: add "high throttle cancels landing" option 2016-01-14 15:21:54 +09:00
Jonathan Challinger
3800c66f07 Copter: add RTL_CONE_SLOPE 2016-01-07 17:22:33 +09:00
Jonathan Challinger
dcd16696a2 Copter: refactor RTL to compute full path on initialization 2016-01-07 17:22:31 +09:00
Jonathan Challinger
dfab21171b Copter: call renamed functions in AC_AttitudeControl 2015-12-09 19:58:37 +09:00
Jonathan Challinger
9d8b0f3d58 Copter: call renamed functions in AC_AttitudeControl 2015-12-09 19:58:30 +09: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
Jonathan Challinger
5086168b03 Copter: add RTL_SPEED parameter 2015-11-16 10:20:32 +09:00
Randy Mackay
05246ea0c7 Copter: fix RTL compile error when rally disabled
Thanks to derekxm for finding this
2015-11-14 12:39:23 +09:00
Jonathan Challinger
a18f71b29e Copter: bug fix to RTL_ALT_MIN feature
commited by Randy
2015-08-08 15:38:47 +09:00
Randy Mackay
35a924703f Copter: change multirotor comments to multicopter
No functional change
2015-07-21 16:26:25 +09:00
Robert Lefebvre
0a69c13b1d Copter: Fix helicopter ground stabilization in Auto, Brake, Circle, Guided, Land and RTL modes. 2015-07-14 20:17:14 +09:00
Randy Mackay
063faa0383 Copter: add RTL_CLIMB_MIN
Vehicle climbs at least this many cm when entering RTL
2015-07-13 20:38:52 +09:00
Jonathan Challinger
fb82ac3eb3 Copter: rework land detector logic 2015-05-30 18:51:55 +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