Commit Graph

71 Commits

Author SHA1 Message Date
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
Lucas De Marchi f43f6c53f7 AP_Motors: Group writes to motors
Surround calls to rcout->write() with rcout->cork() and rcout->push().
If the RCOutput implementation allows the writes are grouped and only
sent together to the underlying hardware.
2015-10-06 10:42:18 +11:00
Lucas De Marchi 1572c9d4f4 AP_MotorsMatrix: get rid of _motor_to_channel_map 2015-09-29 12:00:56 +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 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 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 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 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
Leonard Hall 0f894ac1a8 AP_Motors: Rename and move Throttle Mix / Comp 2015-05-08 14:14:17 +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 8e442675a7 AP_Motors: introduce set_stabilize(bool), specifies whether torque demands should be output 2015-04-16 20:59:40 +09:00
Leonard Hall 31a55b2bd6 MotorsMatrix: fix div by zero by ensuring throttle is above min 2015-03-16 14:49:31 +09:00
Leonard Hall 3ad9b1a06b AP_MotorsMatrix: remove incorrect throttle limit flag 2015-03-06 14:02:55 +09:00
Leonard Hall 3e960dfc3b Motors: add get_voltage_comp_gain
This clarifies that lift_max is the inverse of the battery voltage gain
compensation
2015-03-03 15:49:04 +09:00
Leonard Hall 997c6f0868 Motors: move battery resistance calcs to parent
Moving from MotorsMatrix to parent Motors class allows these to be used
from other frame types
Also initialise battery resistance
2015-03-03 15:49:02 +09:00
Leonard Hall 529c6fed3a Motors: move over current throttle limiting to parent
Moving from MotorsMatrix to parent Motors class allows this to be used
from other frame types
2015-03-03 15:48:54 +09:00
Randy Mackay 812473fd9a MotorsMatrix: use get_hover_throttle_as_pwm 2015-03-03 15:48:52 +09:00
Leonard Hall 6b7bdf64bd Motors: move batt voltage lift_max calcs to parent
Moving from MotorsMatrix to parent Motors class allows them to be used
by other frame types
Also added sanity check of batt_voltage_min
2015-03-03 15:48:48 +09:00
Randy Mackay c549b58eb7 MotorsMatrix: remove check of throttle_curve_enabled 2015-03-03 15:48:46 +09:00
Leonard Hall 751dbb7df7 Motors: move thrust curve and volt scaling to parent
Moving from MotorsMatrix to Motors allows it to be used from other frames
2015-03-03 15:48:41 +09:00
Leonard Hall ec9d7dd99e Motors: minor comment fixes 2015-03-03 15:48:30 +09:00
Leonard Hall 1d0ee68116 Motors: over current throttle limiting 2015-03-03 15:48:28 +09:00
Randy Mackay f6523c0997 Motors: Add THR_LOW_CMP to adjust low throttle inputs affect on attitude control 2015-03-03 15:48:21 +09:00
Leonard Hall 83e3e2fec2 Motors: thrust curve and voltage scaling for matrix supported frames 2015-03-03 15:48:19 +09:00
Leonard Hall 5b0bd49ff2 Motors: configurable yaw headroom for matrix frames 2015-03-03 15:48:15 +09:00
Randy Mackay 85fb4b122a MotorsMatrix: _min_throttle interpreted as 0 ~ 1000 range for throttle_lower flag
Also trigger throttle_upper flag when throttle in reaches 1000
2014-10-04 23:49:14 +09:00
NullVoxPopuli c672b3e324 Copter: Added support for V-Shaped and A-Shaped VTail Quadcopter frames
Signed-off-by: NullVoxPopuli <LPSego3+dev@gmail.com>
2014-08-18 14:31:01 +09:00
Randy Mackay b665ebd7a0 MotorsMatrix: implement get_motor_mask 2014-07-26 16:33:24 +09:00
Randy Mackay d63d82ec17 MotorMatrix: output_test for individual motors
Based on original work by Nils Hogberg
2014-04-29 11:41:10 +09:00
Jonathan Challinger 9959a44453 AP_Motors: properly constrain thr_adj_max 2014-04-07 14:14:32 +09:00
Randy Mackay 8d6eb1eceb MotorsMatrix: motor_to_channel_map moved to progmem 2014-02-15 05:27:50 +11:00
Randy Mackay cf1d6854b9 AP_MotorsMatrix: use ref for roll, pitch, yaw, thr channels 2014-02-15 05:27:49 +11:00
Randy Mackay 2c6470f87b AP_MotorsMatrix: remove unused _num_motors
Saves 1 byte of RAM
2014-02-15 05:27:49 +11:00
Randy Mackay 32a0992985 MatrixMotors: motor_out array made local 2014-02-15 05:27:48 +11:00
Randy Mackay 14409ee20f Copter: disable aux channels used for motors 2014-02-07 22:04:27 +09:00
Randy Mackay 851a538692 Copter: motor matrix comment change 2013-11-27 22:33:01 +09:00
Randy Mackay 943d7374f6 Copter: slow start motors from 0 to min throttle 2013-10-20 14:51:35 +09:00
Randy Mackay 62cb5c172b Copter Motors: add slow start feature
Combined armed, frame orientation and slow_start into flags bitmask
Removed ability to set max throttle because it was never used
Re-ordered class variables
2013-09-12 22:27:44 +09:00
Andrew Tridgell 97b7130bb9 libraries: update license header to GPLv3
we switched to GPLv3 a long time ago, but neglected to update the
per-file license headers
2013-08-30 13:01:39 +10:00
Randy Mackay fe412437c2 Copter: add flags for upper and lower throttle limits
Freeze desired altitude when motors hit a limit
2013-07-28 18:18:39 +09:00
Randy Mackay f3a2db195e Copter Motors: remove old style stability patch 2013-07-25 15:34:04 +09:00
Randy Mackay 43379f20c3 Copter Motors: replace limit bitmask with structure 2013-07-21 13:58:24 +09:00
Randy Mackay 336357fbaf Copter: ensure _spin_when_armed is not higher than _min_throttle 2013-07-16 15:25:57 +09:00
Randy Mackay 6477c746cd Copter: renamed MOT_UNSAFE_THR to MOT_SPIN_ARMED
Removed special purpose spin_unsafe function
renamed _throttle_unsafe to _spin_when_armed and changed to an AP_Int8
2013-07-16 12:47:59 +09:00
Jonathan Challinger 2725f219cb Copter: Warn user with motors while copter is arming 2013-07-16 12:47:51 +09:00
Jonathan Challinger ae2b1e3b7e AP_Motors: Added MOT_UNSAFE_THR parameter - Throttle setting used to signal that the copter is armed or otherwise unsafe to approach 2013-07-16 12:47:49 +09:00
rmackay9 073e2c9f15 ACMotors: bug fix to yaw limit 2013-07-05 13:51:59 -10:00
Randy Mackay 76028fc9d3 Copter Motors: use _min_throttle in output_test 2013-05-31 15:16:04 +09:00
Andrew Tridgell 81f7ae9108 AP_Motors: fixed indent-tabs-mode 2013-05-30 09:51:34 +10:00
Randy Mackay ec7ee47099 Copter: scaling stability patch 2013-05-27 11:21:31 +09:00