Commit Graph

7979 Commits

Author SHA1 Message Date
Andrew Tridgell
e3f8e22fc6 AP_Mission: removed BUILD_DELEGATES code
no longer needed
2015-05-26 14:34:51 +10:00
Andrew Tridgell
85f87b6d9c AP_Menu: removed BUILD_DELEGATES code
no longer needed
2015-05-26 14:34:47 +10:00
Andrew Tridgell
1a2b02a563 AP_HAL: removed AVR special case
no longer needed
2015-05-26 14:34:13 +10:00
Andrew Tridgell
7db9da6545 AP_Scheduler: removed delegate ptr handling
no longer needed
2015-05-26 14:33:30 +10:00
Andrew Tridgell
edc21cfa38 AP_Compass: make having no compass backends non-fatal
thanks to Daniel for spotting this
2015-05-26 14:23:40 +10:00
Andrew Tridgell
43fb1202f2 HAL_PX4: fixed functor comparison with NULL 2015-05-26 13:54:38 +10:00
Lucas De Marchi
0daeeb9518 ArduPlane: Start using new Functor implementation
It both reduces flash size and move symbols to read-only sections.
The scheduler_tasks table is one known not to be in read-only section before due
to the FastDelegate implementation. Before and after this patch:

	ArduPlane $ size ArduPlane.elf{.old,}
	   text	   data	    bss	    dec	    hex	filename
	 733368	   8252	  67352	 808972	  c580c	ArduPlane.elf.old
	 730632	   8236	  64792	 803660	  c434c	ArduPlane.elf

	ArduPlane $ nm -C ArduPlane.elf.old|grep scheduler_tasks
	0000000000402800 t _GLOBAL__sub_I__ZN5Plane15scheduler_tasksE
	00000000006b54c0 B Plane::scheduler_tasks

	ArduPlane $ nm -C ArduPlane.elf|grep scheduler_tasks
	0000000000490900 R Plane::scheduler_tasks

As can be seen above, now the scheduler_tasks symbol is in a read-only data
section and in all of them we decreased the total size.

For APM2 we have a little increase in the text size size.

	ArduPlane $ size ArduPlane.elf{.old,}
	   text	   data	    bss	    dec	    hex	filename
	 241940	    942	   4447	 247329	  3c621	ArduPlane.elf.old
	 242222	    942	   4431	 247595	  3c72b	ArduPlane.elf

	ArduPlane $ nm -C ArduPlane.elf.old|grep scheduler_tasks
	00001f8f T Plane::scheduler_tasks

	ArduPlane $ nm -C ArduPlane.elf|grep scheduler_tasks
	00001f8f T Plane::scheduler_tasks
2015-05-26 13:46:55 +10:00
Lucas De Marchi
84f399ec3c APMrover2: Start using new Functor implementation
It both reduces flash size and move symbols to read-only sections.
The scheduler_tasks table is one known not to be in read-only section before due
to the FastDelegate implementation. Before and after this patch:

	APMrover2 $ size APMrover2.elf{.old,}
	   text	   data	    bss	    dec	    hex	filename
	 611406	   4832	  40920	 657158	  a0706	APMrover2.elf.old
	 609686	   4824	  38936	 653446	  9f886	APMrover2.elf

	APMrover2 $ nm -C APMrover2.elf{.old,} |grep tasks
	0000000000696f80 B Rover::scheduler_tasks
	000000000047c440 R Rover::scheduler_tasks

As can be seen above, now the scheduler_tasks symbol is in a read-only data
section and in all of them we decreased the total size.

For APM2 we have a similar situation, but the table was already in text section
because it was using plain C pointers:

	APMrover2 $ size APMrover2.elf{.old,}
	   text	   data	    bss	    dec	    hex	filename
	 189518	   1038	   3494	 194050	  2f602	APMrover2.elf.old
	 189216	   1038	   3480	 193734	  2f4c6	APMrover2.elf

	APMrover2 $ nm -C APMrover2.elf{.old,} |grep tasks
	00001f92 T Rover::scheduler_tasks
	00001f8a T Rover::scheduler_tasks
2015-05-26 13:46:55 +10:00
Lucas De Marchi
20ef7efaf6 AP_HAL: use functor macros
Functor is not yet being used but let's make is macro fallback to the
previous Delegate implementation for easy of transition between the two.
2015-05-26 13:46:55 +10:00
Lucas De Marchi
c894a1349e DataFlash: use functor macros
Functor is not yet being used but let's make is macro fallback to the
previous Delegate implementation for easy of transition between the two.
2015-05-26 13:46:54 +10:00
Lucas De Marchi
6ae2591cad AP_Terrain: use functor macros
Functor is not yet being used but let's make is macro fallback to the
previous Delegate implementation for easy of transition between the two.
2015-05-26 13:46:54 +10:00
Lucas De Marchi
9764bb2452 AP_Notify: use functor macros
Functor is not yet being used but let's make is macro fallback to the
previous Delegate implementation for easy of transition between the two.
2015-05-26 13:46:54 +10:00
Lucas De Marchi
3aa46e3213 AP_InertialSensor: use functor macros
Functor is not yet being used but let's make is macro fallback to the
previous Delegate implementation for easy of transition between the two.
2015-05-26 13:46:53 +10:00
Lucas De Marchi
4c97d92982 AP_HAL_Linux: use functor macros
Functor is not yet being used but let's make is macro fallback to the
previous Delegate implementation for easy of transition between the two.
2015-05-26 13:46:53 +10:00
Lucas De Marchi
9b7c1d8f93 AP_HAL_FLYMAPLE: use functor macros
Functor is not yet being used but let's make is macro fallback to the
previous Delegate implementation for easy of transition between the two.
2015-05-26 13:46:53 +10:00
Lucas De Marchi
dcf992b558 AP_HAL_AVR: use functor macros
Functor is not yet being used but let's make is macro fallback to the
previous Delegate implementation for easy of transition between the two.
2015-05-26 13:46:53 +10:00
Lucas De Marchi
435613de69 AP_Frsky_Telem: use functor macros
Functor is not yet being used but let's make is macro fallback to the
previous Delegate implementation for easy of transition between the two.
2015-05-26 13:46:53 +10:00
Lucas De Marchi
95627cf412 AP_Compass: use functor macros
Functor is not yet being used but let's make is macro fallback to the
previous Delegate implementation for easy of transition between the two.
2015-05-26 13:46:52 +10:00
Lucas De Marchi
df5652fa87 AP_Baro: use functor macros
Functor is not yet being used but let's make is macro fallback to the
previous Delegate implementation for easy of transition between the two.
2015-05-26 13:46:52 +10:00
Lucas De Marchi
ca7db5cdc1 AP_Arming: use functor macros
Functor is not yet being used but let's make is macro fallback to the
previous Delegate implementation for easy of transition between the two.
2015-05-26 13:46:52 +10:00
Lucas De Marchi
cc1fbddc95 AP_Airspeed: use functor macros
Functor is not yet being used but let's make is macro fallback to the
previous Delegate implementation for easy of transition between the two.
2015-05-26 13:46:52 +10:00
Lucas De Marchi
f7dc19554f AP_ADC: use functor macros
Functor is not yet being used but let's make is macro fallback to the
previous Delegate implementation for easy of transition between the two.
2015-05-26 13:46:51 +10:00
Lucas De Marchi
9f0af5b9cb AP_HAL: add fallback implementation of functor macros 2015-05-26 13:46:51 +10:00
Lucas De Marchi
83efb9280b AP_HAL: use variadic templates in FastDelegate
Now that we are using C++11 we can use variadic templates to simplify
the FastDelegate classes. It also simplifies moving away from the
FastDelegate implementation.
2015-05-26 13:46:51 +10:00
Lucas De Marchi
78b00784fb AP_Scheduler: allow to use functor 2015-05-26 13:46:50 +10:00
Lucas De Marchi
58847bffd6 GCS_MAVLink: allow to use functor 2015-05-26 13:46:50 +10:00
Lucas De Marchi
cd308b5e2f DataFlash: allow to use functor 2015-05-26 13:46:50 +10:00
Lucas De Marchi
384a3bfcc3 AP_Mission: allow to use functor 2015-05-26 13:46:50 +10:00
Lucas De Marchi
70525fa2c1 AP_Menu: allow to use functor 2015-05-26 13:46:50 +10:00
Lucas De Marchi
4b5cf24a81 Allow to change to functor implementation
Start to add code behind APM_BUILD_FUNCTOR to support changing the
functor implementation (without breaking the build while the change is
not complete).
2015-05-26 13:46:49 +10:00
Lucas De Marchi
a1e1503e1a AP_HAL: Add Functor implementation
This is a Functor implementation that should cover the use cases we have
for FastDelegate. In contrary to the latter, it can be constructed at
compile time so the compiler can safely put it in a read-only section
which covers the cases in which we are not using it.
2015-05-26 13:46:49 +10:00
Lucas De Marchi
5dfb3ed70c AP_Scheduler: replace tabs with spaces 2015-05-26 13:46:49 +10:00
Lucas De Marchi
82d22992bd GCS_MAVLink: Do not compare delegate to NULL
Use the simpler "if (delegate_name)" since it allows simpler
implementation in the class, i.e. the bool operator rather than having
to compare to another object.
2015-05-26 13:46:49 +10:00
Lucas De Marchi
ff398dbf0c AP_Menu: Do not compare delegate to NULL
Use the simpler "if (delegate_name)" since it allows simpler
implementation in the class, i.e. the bool operator rather than having
to compare to another object.
2015-05-26 13:46:48 +10:00
Lucas De Marchi
acdcdc35fa AP_HAL_SITL: Do not compare delegate to NULL
Use the simpler "if (delegate_name)" since it allows simpler
implementation in the class, i.e. the bool operator rather than having
to compare to another object.
2015-05-26 13:46:48 +10:00
Lucas De Marchi
9ef870c08a AP_HAL_AVR: Do not compare delegate to NULL
Use the simpler "if (delegate_name)" since it allows simpler
implementation in the class, i.e. the bool operator rather than having
to compare to another object.
2015-05-26 13:46:48 +10:00
Lucas De Marchi
57386434d1 AP_ADC: remove AP_ADC_HIL
It's not being used and it's actually broken: it references
AP_ADC_HIL::read() that doesn't exist.
2015-05-26 13:46:48 +10: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
915236f1f5 AC_AttitudeControl: Non-functional comment change
Don't encourage future misuse of g.rc3
2015-05-25 22:13:37 +09:00
Robert Lefebvre
e87ca6de6f AC_PosControl: Change motors.get_throttle_out
to get_throttle to follow function renaming in AP_Motors
2015-05-25 22:13:34 +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
Andrew Tridgell
527fc2a610 SITL: use 127.0.0.1 to improve reliability on windows 2015-05-25 22:02:18 +10:00
Andrew Tridgell
563be63d00 SITL: try to get speedup accurate on both windows and linux 2015-05-25 21:48:42 +10:00
Andrew Tridgell
2b2259a6d7 SITL: use more granrular sleeps for windows 2015-05-25 17:05:44 +10:00
Andrew Tridgell
c06d81a06a SITL: use autotest_dir
this allows for the aircraft directory for SITL to be packaged without
the source tree
2015-05-25 13:04:46 +10:00
Andrew Tridgell
3daee9c8bc HAL_SITL: added --autotest-dir option 2015-05-25 13:04:17 +10:00
Andrew Tridgell
4f37926aea SITL: fixed gimbal build on PX4 2015-05-25 12:39:40 +10:00
Andrew Tridgell
958d8b4787 GCS_MAVLink: update from upstream headers 2015-05-25 12:20:27 +10:00
Andrew Tridgell
e7abc07898 HAL_SITL: enable --gimbal option
instantiates a MAVLink gimbal
2015-05-25 12:20:26 +10:00
Andrew Tridgell
7f5b206c55 SITL: added gimbal simulator class 2015-05-25 12:20:26 +10:00
Andrew Tridgell
2f7facba40 GCS_MAVLink: removed old MAVLink 0.9 headers 2015-05-25 10:19:47 +10:00
Andrew Tridgell
d96e62cce7 AP_Mount: update gimbal for changed quaternion API 2015-05-25 09:08:45 +10:00
Andrew Tridgell
2a8f645d81 AP_Math: use matrix3 euler312 operations in quaternion library 2015-05-25 09:08:31 +10:00
Andrew Tridgell
7aa7e03169 AP_Math: added euler312 functions (for gimbal) 2015-05-25 09:03:11 +10:00
Andrew Tridgell
2bb5f677c7 SITL: removed earth frame rates 2015-05-25 09:03:10 +10:00
Andrew Tridgell
8dce5e11d6 HAL_SITL: removed earth-frame rates 2015-05-25 09:03:10 +10:00
Andrew Tridgell
19419fd901 AP_Mount: fixed reporting of MAVLink gimbal position to GCS 2015-05-24 15:24:02 +10:00
Andrew Tridgell
b61f7fa2f6 AP_AHRS: enable EKF by default on plane
now we have arming checks enabled by default I think this is the best
choice
2015-05-23 17:17:44 +10:00
Andrew Tridgell
efd958f0b0 AP_NavEKF: rename file to remove spaces
spaces in file names break shell scripts
2015-05-23 17:14:52 +10:00
Andrew Tridgell
2d53a1ff9a SITL: fixed airspeed in last_letter 2015-05-23 11:37:21 +10:00
Andrew Tridgell
ae6ac1b82d SITL: fixed airspeed in CRRCSim 2015-05-23 11:35:56 +10:00
Andrew Tridgell
da5d5c9936 SITL: fixed airspeed pass-thru from simulators 2015-05-23 11:24:10 +10:00
Andrew Tridgell
e7f3716e8c HAL_SITL: pass in wind speed to C++ simulators 2015-05-23 11:04:13 +10:00
Andrew Tridgell
091a1e7fe0 SITL: fixed wind support in JSBSim 2015-05-23 11:03:57 +10:00
Andrew Tridgell
4486ddc53e DataFlash: changed TimeUS to SampleUS for raw IMU logging
this prevents a problem with an upcoming patch from Peter
2015-05-22 17:58:18 +10:00
Jonathan Challinger
28731d2bdc AP_Motors: add throttle filter input constraint from -100 to 1100 2015-05-22 16:12:27 +09:00
Andrew Tridgell
60221f5e9c SITL: use sendto() in CRRCSim
this makes us robust to restart of client or server
2015-05-22 16:07:45 +10:00
Andrew Tridgell
6cbd291dd2 HAL_SITL: make model name case insensitive 2015-05-22 16:07:44 +10:00
Andrew Tridgell
9336914598 AP_HAL: added sendto socket method 2015-05-22 16:07:44 +10:00
Andrew Tridgell
4e117bc90f HAL_SITL: support last_letter simulator 2015-05-22 16:07:44 +10:00
Andrew Tridgell
b35c21fbe2 SITL: fixed socket recv error check 2015-05-22 16:07:43 +10:00
Andrew Tridgell
e487d95c1b SITL: added direct support for last_letter simulator 2015-05-22 16:07:43 +10:00
Robert Lefebvre
bcc3fa0526 AC_HELI_PID: Pass default FF param setting in constructor 2015-05-22 09:38:28 +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
Peter Barker
6299a8c90d autotest: drain control socket in SITL
fixes SITL on plane
2015-05-22 08:09:15 +10:00
Andrew Tridgell
cd66ce1c74 HAL_SITL: don't advance clock on garbage SIM input 2015-05-21 21:17:22 +10:00
Andrew Tridgell
605b8b4ece AP_Math: converted rotations example to cpp
this is just a test conversion before we start converting on-mass
2015-05-21 13:41:20 +10:00
Andrew Tridgell
062c9406bd AP_Math: fixed rotations example build 2015-05-21 13:37:44 +10:00
Andrew Tridgell
a1a3212131 AP_Common: moved NOINLINE define to AP_Common.h 2015-05-21 09:35:26 +10:00
Andrew Tridgell
fb97c16a84 AP_Param: make data pointer const 2015-05-21 07:48:52 +10:00
Andrew Tridgell
84726e4a3a GCS_MAVLink: use APM_BUILD_DELEGATES 2015-05-21 07:48:52 +10:00
Andrew Tridgell
f8aef57ec3 DataFlash: use APM_BUILD_DELEGATES 2015-05-21 07:48:51 +10:00
Andrew Tridgell
0847bd2608 AP_Scheduler: use APM_BUILD_DELEGATES 2015-05-21 07:48:51 +10:00
Andrew Tridgell
e7ba2c8d93 AP_Mission: use APM_BUILD_DELEGATES 2015-05-21 07:48:51 +10:00
Andrew Tridgell
3a300575bc AP_Menu: use APM_BUILD_DELEGATES 2015-05-21 07:48:51 +10:00
Andrew Tridgell
98d2b9b3aa AP_Vehicle: added APM_BUILD_DELEGATES macro 2015-05-21 07:48:50 +10:00
Andrew Tridgell
c3aa8d67fa AP_Arming: convert to delegates 2015-05-21 07:48:50 +10:00
Andrew Tridgell
71b550d7b5 GCS_MAVLink: support member functions for rover 2015-05-21 07:48:47 +10:00
Andrew Tridgell
b5d930be61 DataFlash: support member functions for rover 2015-05-21 07:48:47 +10:00
Andrew Tridgell
1237772479 AP_Scheduler: support member functions for rover 2015-05-21 07:48:46 +10:00
Andrew Tridgell
12cbf7888f AP_Mission: support member functions for rover 2015-05-21 07:48:46 +10:00
Andrew Tridgell
db13f657a8 AP_Menu: support member functions for rover 2015-05-21 07:48:46 +10:00
Andrew Tridgell
e1e85ecc3d AP_Progmem: simpler PROGMEM header 2015-05-21 07:48:46 +10:00
Andrew Tridgell
abfb601db6 AP_Progmem: added pgm_read_block() 2015-05-21 07:48:45 +10:00