Commit Graph

421 Commits

Author SHA1 Message Date
Lucas De Marchi
7ea141b774 AP_Motors_Multi: get rid of _motor_to_channel_map 2015-09-29 11:59:48 +09:00
Lucas De Marchi
d97d97dc54 AP_Motors: get rid of _motor_to_channel_map
This was only used for supporting APM1. The removal was mostly automatic
with:

    sed -i 's/pgm_read_byte(&_motor_to_channel_map\[\([^]]*\)\])/\1/g' libraries/AP_Motors/*.cpp
    sed -i 's/_motor_to_channel_map\[\([^]]*\)\]/\1/g' libraries/AP_Motors/*.cpp

And then remove references to MOTOR_TO_CHANNEL_MAP and
_motor_to_channel_map and make sure the variable used in shifts is
unsigned
2015-09-29 11:59:25 +09:00
Andrew Tridgell
f22a1d3e6d AP_Motors: display message in heli parameter_check() 2015-09-25 12:30:34 +10:00
Andrew Tridgell
9da2b2b430 AP_Motors: added H_GYR_GAIN_ACRO 2015-09-25 12:30:33 +10:00
Randy Mackay
1024790633 MotorsMulti: add throttle_max accessor 2015-09-07 15:10:02 +09:00
Randy Mackay
e3ff4ed9c4 MotorsHeli: integrate RotorControlState 2015-08-31 11:43:59 +09:00
Randy Mackay
cb47311416 MotorsHeli_RSC: add RotorControlMode enum 2015-08-31 11:43:58 +09:00
Randy Mackay
72efc85ee8 MotorsHeli_RSC: RotorControlState enum 2015-08-31 11:43:57 +09:00
Robert Lefebvre
bde43412d8 AP_MotorsHeli: Fix RSC Mode 3 2015-08-31 11:43:55 +09:00
Robert Lefebvre
38ccd6e04f AP_MotorsHeli_RSC: Fix tail_type control 2015-08-31 11:43:54 +09:00
Robert Lefebvre
535da1d79a AP_MotorsHeli_Single: DDVPT to use it's own ramp and runup times 2015-08-31 11:43:51 +09:00
Robert Lefebvre
28318c4116 AP_MotorsHeli: Move Output functions into parent class 2015-08-31 11:43:50 +09:00
Robert Lefebvre
84102c3e3f AP_MotorsHeli: Rework how servo setup is done. 2015-08-31 11:43:49 +09:00
Robert Lefebvre
345663f705 AP_MotorsHeli: Simplify servo init/reset 2015-08-31 11:43:48 +09:00
Robert Lefebvre
b11600aebe AP_MotorsHeli: Move set_delta_phase_angle into _Single class 2015-08-31 11:43:47 +09:00
Robert Lefebvre
3756c6b3f3 AP_MotorsHeli: Create RSC Throttle Curve mode for controlling gas engines. 2015-08-31 11:43:45 +09:00
Robert Lefebvre
f853979816 AP_MotorsHeli: run RSC Control function in Output Min function
Move Output_Min() function into Heli_Single class as it will eventually be overloaded by other helicopter class types.
2015-08-31 11:43:44 +09:00
Robert Lefebvre
315f0408ae AP_MotorsHeli: RSC controller to use speed ramp as simple float scalar 2015-08-31 11:27:52 +09:00
Robert Lefebvre
91c7663ca2 AP_MotorsHeli: Set range of new RSC Servo object. 2015-08-31 11:27:51 +09:00
Robert Lefebvre
cefa0c28a6 AP_MotorsHeli: RSC Mode 0 no longer a valid mode 2015-08-31 11:27:48 +09:00
Robert Lefebvre
981c96d8bc AP_MotorsHeli: Add more parameter checks 2015-08-31 11:27:47 +09:00
Robert Lefebvre
ed08e9d531 AP_MotorsHeli_RSC: Split out rotor speed estimate into it's own function 2015-08-31 11:27:46 +09:00
Robert Lefebvre
064cc63512 AP_MotorsHeli: Colyaw function to check if rotor speed control is above idle 2015-08-31 11:27:45 +09:00
Robert Lefebvre
77e4bf39aa AP_MotorsHeli: rework RSC output() function to implement idle speed function
Also, split out speed_ramp function
2015-08-31 11:27:44 +09:00
Robert Lefebvre
c3e7eed299 AP_MotorsHeli_Single: Fix recalc_scalars function 2015-08-31 11:27:42 +09:00
Robert Lefebvre
214d60abb9 AP_MotorsHeli: Create RSC_IDLE param 2015-08-31 11:27:41 +09:00
Robert Lefebvre
27f8d6bcd5 AP_MotorsHeli: Change RSC output() function into a state machine. 2015-08-31 11:27:40 +09:00
Robert Lefebvre
10b0be9e75 AP_MotorsHeli: Fully detail tradheli output functions and move manual servo handling 2015-08-31 11:27:39 +09:00
Robert Lefebvre
7dda0f651a AP_MotorsHeli: Rename tradheli servo objects for clarity 2015-08-31 11:27:38 +09:00
Robert Lefebvre
457d939e77 AP_MotorsHeli: Update includes so that it builds 2015-08-31 11:27:37 +09:00
Fredrik Hedberg
e6119cf51f AP_Motors: Fix param indices in AP_MotorsHeli. 2015-08-31 11:27:36 +09:00
Fredrik Hedberg
411947ea7c AP_Motors: Rename output_yaw to move_yaw in AP_MotorsHeli_Single. 2015-08-31 11:27:35 +09:00
Fredrik Hedberg
1e8be73a27 AP_Motors: Fix formatting in AP_MotorsHeli_RSC. 2015-08-31 11:27:34 +09:00
Fredrik Hedberg
e6957df54a AP_Motors: Fix param range comment in AP_MotorsHeli. 2015-08-31 11:27:33 +09:00
Fredrik Hedberg
97e09fa9b0 AP_Motors: Move traditional helicopter controls into AP_MotorsHeli_Single.
Original commit by fhedberg, had to fix merge conflicts and now it appears I did the commit?
2015-08-31 11:27:31 +09:00
Fredrik Hedberg
af69a20ba5 AP_Motors: Break out yaw output in AP_MotorsHeli. 2015-08-31 11:27:30 +09:00
Fredrik Hedberg
feb32f40ed AP_Motors: Break out servo init and reset in AP_MotorsHeli. 2015-08-31 11:27:29 +09:00
Fredrik Hedberg
ae9a16dc27 AP_Motors: Move rotor speed control into AP_MotorsHeli_RSC. 2015-08-31 11:27:28 +09:00
Fredrik Hedberg
1bb6b65ce0 AP_Motors: Use C++11 initializers in AP_MotorsHeli. 2015-08-31 11:27:27 +09:00
Leonard Hall
c357cb8f84 Copter: increase default thrust expo to 0.65 2015-08-23 16:42:05 +09:00
Gustavo Jose de Sousa
1e619c6c59 AP_Motors: standardize inclusion of libaries headers
This commit changes the way libraries headers are included in source files:

 - If the header is in the same directory the source belongs to, so the
 notation '#include ""' is used with the path relative to the directory
 containing the source.

 - If the header is outside the directory containing the source, then we use
 the notation '#include <>' with the path relative to libraries folder.

Some of the advantages of such approach:

 - Only one search path for libraries headers.

 - OSs like Windows may have a better lookup time.
2015-08-11 16:38:19 +10:00
Randy Mackay
f009c2ddb9 Motors_Multicopter: add MOT_THR_MIX_MAX parameter
Allows controlling the prioritisation of throttle vs attitude control
during active flight
2015-08-07 17:39:09 +09:00
Leonard Hall
1a583c5382 AP_Motors: calc_roll_pwm based on throttle pwm range 2015-08-03 14:12:49 +09:00
Randy Mackay
5032cf9fbc Copter: init multicopter flags
Resolves coverity warning

Also fixed indentation
2015-07-25 14:00:29 +09:00
Randy Mackay
e31f2d26c4 MotorsMulticopter: move get_hover_throttle_as_pwm to protected
No functional change
2015-07-21 16:27:04 +09:00
Randy Mackay
c7c6228b5d MotorsMulticopter: remove virtual from set_yaw_headroom 2015-07-21 16:27:01 +09:00
Randy Mackay
4843be49de AP_MotorsTri: remove call to empty parent Init
Also rename uses of Multirotor to Multicopter
2015-07-21 16:25:48 +09:00
Randy Mackay
f906934dfa AP_MotorsSingle: remove call to empty parent Init
Also rename uses of Multirotor to Multicopter
2015-07-21 16:25:45 +09:00
Randy Mackay
112e934072 AP_MotorsMatrix: remove call to empty parent Init
Also rename uses of Multirotor to Multicopter
2015-07-21 16:25:43 +09:00
Randy Mackay
b1a4a6bf0a AP_Motors_Coax: remove call to empty parent Init
Also rename uses of Multirotor to Multicopter
2015-07-21 16:25:40 +09:00
Randy Mackay
4d1dfd94f5 AP_MotorsMulticopter: multicopter features moved in from parent
Also rename from multirotor to multicopter
2015-07-21 16:25:37 +09:00
Randy Mackay
7355ac9cb8 AP_MotorsHeli: implement empty slow start method 2015-07-21 16:25:34 +09:00
Randy Mackay
a3fab10ef4 AP_MotorsHeli: init roll_radio_passthrough 2015-07-21 16:25:31 +09:00
Randy Mackay
c9dedbd3b2 AP_Motors: remove multicopter only features
Also rename uses of Multirotor to Multicopter
2015-07-21 16:25:28 +09:00
Robert Lefebvre
abb6eba291 AP_MotorsHeli: Change allow_arming check to use _rotor_speed_estimate
In future, this will be used to check actual rotor speed (measured) if available, to prevent trying to arm with the rotor spinning.
2015-07-21 16:25:21 +09:00
Robert Lefebvre
9fcbc77ce0 AP_MotorsHeli: Create rotor_speed_above_critical accessor 2015-07-21 16:25:11 +09:00
Robert Lefebvre
992c9c75bb AP_MotorsHeli: Create parameter_check method. 2015-07-21 16:25:04 +09:00
Robert Lefebvre
e2fe640e6c Copter: Clean up helicopter allow_arming() function 2015-07-21 16:24:58 +09:00
Robert Lefebvre
61d6c5aa1d AP_Motors: Creation of AP_Motors_Multirotor class 2015-07-21 16:24:38 +09:00
Randy Mackay
8225e58454 AP_Motors: throttle_min method in 0 to 1000 range
Previously the pwm range value was returned.  This value is only used by
the multicopter attitude controller's angle boost function.
2015-07-20 20:44:46 +09:00
Randy Mackay
6bf6442396 MotorsMatrix; protect against divide by zero
This should never happen but just to be safe
2015-07-20 20:44:43 +09:00
Randy Mackay
fa60c3dce8 MotorsCoax: fix output_armed_stabilized min thr limit 2015-07-20 20:44:36 +09:00
Randy Mackay
8a308205ce MotorsSingle: fix output_armed_stabilized min thr limit 2015-07-20 20:44:32 +09:00
Randy Mackay
bd9a605086 MotorsTri: fix output_armed_stabilized min thr limit
_min_throttle is in the pwm range but was being used as if in the 0 to
1000 range
2015-07-20 20:44:23 +09:00
Randy Mackay
e53c46bd8f MotorsMatrix: fix output_armed_stabilized min thr limit
_min_throttle was being used as if it were in the 0 to 1000 range when
in fact it is in the pwm range.  This meant the lower limit was too low.
2015-07-20 20:44:14 +09:00
Robert Lefebvre
e1902e2289 AP_MotorsHeli: Remove unused _dt variable. 2015-07-14 20:13:43 +09:00
Robert Lefebvre
11214b3414 AP_Motors: move constraints to set_throttle 2015-06-22 13:52:59 +09:00
Robert Lefebvre
0c92565d23 AP_MotorsHeli: add Critical Rotor Speed param, use to switch off runup_complete 2015-06-19 15:10:53 +09:00
Robert Lefebvre
3ad6700c5d AP_MotorsHeli: add getters for rotor speed 2015-06-19 15:10:51 +09:00
Robert Lefebvre
8b917b82ee AP_MotorsHeli: Simplify set_desired_rotor_speed function definition 2015-06-19 15:10:50 +09:00
Robert Lefebvre
79e8c8f7f7 AP_MotorsHeli: whitespace fixes 2015-06-19 15:10:47 +09:00
Randy Mackay
2849430341 AP_Motors: init flags
resolves coverity issue
2015-06-08 14:46:16 +09:00
Andrew Tridgell
d746e8fa29 AP_Motors: mark examples as nobuild
waiting for fix from Rob
2015-06-01 17:27:33 +10:00
Andrew Tridgell
89baf2bdf1 AP_Motors: convert example from .pde to .cpp 2015-06-01 17:07:05 +10:00
Robert Lefebvre
1424b17a83 AP_Motors_Heli: Change default RSC_SETPOINT to 700 2015-05-29 17:46:25 +09:00
Robert Lefebvre
d24664ccf9 AP_MotorsHeli: Semantic change. Motor Runup to Rotor Runup 2015-05-29 17:46:18 +09:00
Robert Lefebvre
65ca09600c AP_Motors: Heli eliminate _dt member and fix rsc_runup calculation 2015-05-29 17:46:09 +09:00
Randy Mackay
d777166c6f AP_MotorsTri: revert tail servo to Ch7 2015-05-25 22:27:38 +09:00
Randy Mackay
1a1fa7ca4b AP_MotorsHeli: add comment to avoid param conflict 2015-05-25 22:13:49 +09:00
Randy Mackay
4c94a69e33 AP_MotorsCoax: resolve param conflict with TradHeli 2015-05-25 22:13:47 +09:00
Randy Mackay
78b49fb4c6 AP_MotorsSingle: resolve param conflict with TradHeli
Also rename servo reverse parameters to be consistent with tricopter
2015-05-25 22:13:45 +09:00
Randy Mackay
8dc7cf7fa8 AP_MotorsTri: YAW_SV_REV values -1 or +1
Also resolve parameter conflict with TradHeli
2015-05-25 22:13:43 +09:00
Randy Mackay
71e4bccecb AP_Motors: init members in constructor
Also add f to end of float constants
2015-05-25 22:13:41 +09:00
Robert Lefebvre
b8181b6b90 AP_Motors: RCMAP fix
Remove all RC Input channels passed as reference into AP_Motors.  All input handling self-contained inside AP_Motors.
Rework Tricopter to use internal servo calcs.
2015-05-25 22:13:32 +09:00
Jonathan Challinger
28731d2bdc AP_Motors: add throttle filter input constraint from -100 to 1100 2015-05-22 16:12:27 +09:00
Robert Lefebvre
73bafa131e AP_MotorsHeli: Overload output()
To protect it from future interference from Multirotor code.
2015-05-22 09:38:23 +09:00
Robert Lefebvre
d3ce68a8ca AP_MotorsHeli: Overload update_throttle_filter()
Do not reset filter to zero when disarmed to allow collective pitch servo movement.
2015-05-22 09:38:20 +09:00
Randy Mackay
3d9a6a69e2 MotorsHeli: COLYAW to float 2015-05-08 14:14:36 +09:00
Randy Mackay
edfa206bb8 Motors_Heli: nest heli params 2015-05-08 14:14:35 +09:00
Randy Mackay
68b05a4ca2 AP_Motors: is_throttle_mix_min returns bol 2015-05-08 14:14:32 +09:00
Leonard Hall
0f894ac1a8 AP_Motors: Rename and move Throttle Mix / Comp 2015-05-08 14:14:17 +09:00
Andrew Tridgell
2e57c62ebb AP_Motors: fix for HAL_SITL rename 2015-05-05 09:45:55 +10:00
Randy Mackay
b223e90ef6 AP_Motors: fix example sketches 2015-05-01 20:58:20 +09:00
Randy Mackay
0acc06d713 AP_Motors: minor comment for interlock 2015-05-01 14:30:45 +09:00
Robert Lefebvre
1a482de5e2 AP_MotorsHeli: Overload output_armed_zero_throttle 2015-05-01 14:30:25 +09:00
Robert Lefebvre
6bdace30d2 AP_Motors: Add throttle interlock functionality
AP_MotorsMatrix's output_armed_zero_throttle uses output_min default from base class
2015-05-01 14:30:24 +09:00
Jonathan Challinger
348001e786 AP_Motors: add get_throttle_warn function 2015-05-01 12:56:11 +09:00
Randy Mackay
bae1722946 AP_Motors: get_compensation_gain gets div-by-zero check 2015-04-29 14:36:22 +09:00
Jonathan Challinger
41ae7207c7 AP_Motors: scale roll/pitch/yaw gain for air density 2015-04-29 14:36:15 +09:00
Jonathan Challinger
e2ba351149 AP_Motors: refactor apply_thrust_curve_and_volt_scaling 2015-04-29 14:36:12 +09:00