Commit Graph

3557 Commits

Author SHA1 Message Date
Randy Mackay 6bcbcc0382 GCS_MAVLink: add DO_SET_ROI to common.xml 2013-07-14 15:49:17 +09:00
Andrew Tridgell d9f13b6b8c GCS_MAVLink: merge in changes from upstream mavlink repo 2013-07-14 16:02:29 +10:00
Andrew Tridgell b1202ccbff GCS_MAVLink: merge in latest upstream XML changes 2013-07-14 15:41:25 +10:00
Andrew Tridgell 9d66adae13 AP_Airspeed: added get_airspeed_ratio() and set_airspeed_ratio()
This is to help Paul develop an automatic tuning system for airspeed
ratio
2013-07-13 21:53:38 +10:00
Andrew Tridgell cc778a68ae APM_Control: changed attitude controllers to take angular error not angle
this makes it easier for ACRO mode
2013-07-13 21:45:58 +10:00
Andrew Tridgell b721bcc129 AP_AHRS: removed get_roll_rate_earth() and get_pitch_rate_earth()
these are not used any more
2013-07-13 21:45:58 +10:00
Andrew Tridgell 21859f9364 RC_Channel: fixed dead_zone for range channels
The dead_zone was being used inconsistently, used in PWM space in one
place, and in control output space in another.

The fix required us to move the index number of the RC channel eeprom
value for RCn_DZ, as users will have a throttle deadzone of 3 set in
their eeprom due to a bug that Randy just fixed that caused the value
to always be saved to eeprom. In plane we then need to fix the
deadzone for the throttle to be 30

this fixes issue #303

Thanks to Soren Kuula for spotting this!
2013-07-13 13:18:54 +10:00
Andrew Tridgell 086e8f80dc AP_AHRS: fixed spin rate gain conversion from degrees to radians
fixes issue #433

Thanks Jurgen!
2013-07-13 12:36:25 +10:00
Randy Mackay effc829790 INS: relax accel offset check to 3.5 m/s/s
One user, Dusty, has found that even with offsets of 3.1 m/s/s
successful alt hold and loiter are possible
2013-07-13 10:43:07 +09:00
Randy Mackay 110966c186 AP_TECS: compile error fix for size_of(log_tuning) 2013-07-12 11:45:02 +09:00
Randy Mackay fb5ada38c0 RC: example sketch uses set_default_dead_zone 2013-07-12 11:44:58 +09:00
Randy Mackay 47437b9ddf RC: set dead zone only if parameter has not been set by user 2013-07-12 11:44:16 +09:00
Randy Mackay 012d7b0c0a OptFlow: initialisation fix
Thanks to DongFang (aka Soren) for finding the issue and the solution
2013-07-11 14:14:37 +09:00
Andrew Tridgell 131aa53e42 AP_Relay: update for new PX4 relay pin 2013-07-11 13:50:23 +10:00
Andrew Tridgell 83b13c3d88 HAL_PX4: fixed definition of relay and piezo pins 2013-07-11 13:50:23 +10:00
Andrew Tridgell 0916388ab5 HAL_PX4: retry opening UARTs up to 5 times
this seems to help a lot with the USB port on PX4
2013-07-11 13:50:23 +10:00
Marco Bauer 72d0721721 AP_Relay: setup pin for PX4 relay support 2013-07-11 13:50:22 +10:00
Marco Bauer a3b216bce3 HAL_PX4: added GPIO driver 2013-07-11 13:50:22 +10:00
Randy Mackay bf5a50f738 WPNav: stopping point projection uses wp_leash 2013-07-11 11:39:44 +09:00
Andrew Tridgell f2316747f5 APM_Control: re-work to allow for rate based control 2013-07-11 09:10:41 +10:00
Randy Mackay 345924ddec WPNav: replace LOITER_ACCEL_MAX with parameter
Also removed unused _lean_angle_max variable
2013-07-10 20:00:32 +09:00
Randy Mackay 204f613467 WPNav: bug fix to reported distance to target
This value is for reporting purposes only
2013-07-10 18:21:08 +09:00
Randy Mackay 518eba0729 WPNav: bug fix to loiter accel calculation
Contribution from Leonard Hall
2013-07-10 17:52:12 +09:00
Randy Mackay c4f17b3235 WPNav: rounding error fix in loiter
Contributed by Leonard Hall
2013-07-10 16:24:37 +09:00
Randy Mackay 5d23d5aaa7 WPNav: reduce loiter speed used to correct pos error
Contributed by Leonard Hall
This should reduce the aggressiveness of the response when we experience
a GPS glitch
2013-07-10 15:52:18 +09:00
Randy Mackay 7860d06b91 AHRS: typo fix for ORIENTATION param description 2013-07-10 14:56:48 +09:00
Andrew Tridgell 0f72401d8d AP_Baro: added GND_ALT_OFFSET parameter
used for automatic barometric adjustment by a ground station equipped
with a barometer
2013-07-10 14:38:57 +10:00
Andrew Tridgell 469736e6bc DataFlash: changes for GPS field changes 2013-07-10 14:04:22 +10:00
Andrew Tridgell 279f6d00f0 AP_AHRS: changes for GPS field changes 2013-07-10 14:04:22 +10:00
Andrew Tridgell 7dbb898264 AP_GPS: switch fields to add units suffix
altitude -> altitude_cm
ground_speed -> ground_speed_cm
ground_course -> ground_course_cd

this helps prevent unit mixups
2013-07-10 14:04:22 +10:00
Paul Riseborough 66d60953df TECS: added height update_pitch call 2013-07-10 14:04:22 +10:00
Andrew Tridgell 9959f6b2df AP_Camera: removed incorrect mavlink sends
these sends did nothing, as MAVLINK_COMM_3 is not connected to
anything. If it was connected they would be dangerous, as a blocking
serial write could cause the stabilization of a copter not to run. If
the serial port was non-blocking it would corrupt the packet.

If we needed something like this it would have to use the MAVLink
packet queueing logic we use elsewhere
2013-07-10 11:51:40 +10:00
Craig@3DR f5154d9e7a AP_Camera: changed update_location() to return true for camera trigger
Makes the main vehicle code responsible for taking a photo so logging can occur
2013-07-10 08:39:56 +10:00
Andrew Tridgell 7fa1fe8590 AP_Param: use 0xFFFF not __UINT16_MAX__
MacOS doesn't have __UINT16_MAX__
2013-07-09 20:51:06 +10:00
Paul Riseborough 2c5db9a165 TECS: added support for throttle nudging 2013-07-09 20:50:37 +10:00
Paul Riseborough 9c431b4a04 TECS: use altitude supplied by mainline code
this allows for use of ALT_OFFSET and ALT_MIX
2013-07-09 09:25:53 +10:00
Paul Riseborough d8fedf994a AP_SpdHgtControl: added height above field parameter 2013-07-09 09:05:22 +10:00
Tobias 4a75351bd3 AP_Param: fixed a compiler warning with -Wsign-conversion 2013-07-08 14:57:33 +10:00
Tobias 27a5c28851 AP_Param: fixed some compiler warnings
* added comment
* replaced "~0" with the appropriate macro
* resolved -Wconversion
* saved some space by modifying AP_Param::add_vector_suffix (writing
behind buffer could happen, if buffer_size is almost uint16_max but this
can surely be ignored)

further reading:
http://stackoverflow.com/questions/809227/is-it-safe-to-use-1-to-set-all-bits-to-true
2013-07-08 14:57:33 +10:00
Tobias ab311d1dd4 AP_Compass: removed comparison out of range compiler warning
uint_ >= 0 (-Wtype-limits)
2013-07-08 14:57:25 +10:00
Tobias c95072ea25 AP_GPS: added explicit cast to omit [-Wconversion] warning 2013-07-08 14:53:20 +10:00
Andrew Tridgell 8c49ed78a5 AP_Math: make the rotation numbers easier to find 2013-07-08 12:17:59 +10:00
Andrew Tridgell a6c7bd3612 AP_Compass: fixed rotations for COMPASS_ORIENT
this matches AHRS_ORIENTATION again
2013-07-08 12:17:59 +10:00
Tobias 338c054da2 Filter: validity of array index was checked AFTER accessing the element.
(correction decreased Program size by 12 bytes)
2013-07-08 12:17:59 +10:00
Tobias d3ea88e8c7 AP_HAL: resolved -Woverloaded-virtual warning
the function:
virtual size_t AP_HAL::Print::write(const uint8_t *buffer, size_t size);

was hidden in all derived classes by their
virtual size_t write(uint8_t) = 0; implementations.

To solve this, a non-virtual write(const uint8_t *, size_t) that calls a
virtual write_implementation was added.

This isn't necessary atm, because the derived classes don't call
write(const uint8_t *, size_t), BUT this decreases the apm2-quad Program
size by 40 bytes :D and removes warnings.
2013-07-08 12:17:34 +10:00
tobias 1bf135b36f AP_AHRS: make some more functions const 2013-07-08 12:07:50 +10:00
Tobias ce6529734c HAL_AVR: reorder parameters to remove a warning with -Wreorder 2013-07-08 12:07:50 +10:00
tobias 4e7fea787b HAL_AVR: corrected includes to replace #include "$HEADER" with #inlcude "utility/$HEADER"
adding -I for EVERY DIRECTORY isn't desirable

http://gcc.gnu.org/onlinedocs/cpp/Search-Path.html
2013-07-08 12:07:50 +10:00
Randy Mackay 649cbf6b68 WPNav: reduce default WP_ACCEL and LOITER_SPEED 2013-07-07 16:00:13 -10:00
Randy Mackay ded31582de AP_AHRS: add Roll90Yaw90 to parameter description
Thanks to Rainer Walther for spotting this
2013-07-07 13:06:40 -10:00
rmackay9 073e2c9f15 ACMotors: bug fix to yaw limit 2013-07-05 13:51:59 -10:00
John Boiles bb2a6b8a22 HAL_SITL: Fixing SITL build for OSX. 2013-07-05 22:36:57 +10:00
Paul Riseborough a694b781c7 AP_TECS: Add non airspeed sensor pitch to throttle mode lost during integration 2013-07-05 22:16:39 +10:00
Andrew Tridgell 25f8983383 HAL_AVR: don't initialise TWBR twice 2013-07-05 12:59:14 +10:00
Andrew Tridgell 87f6cc715d AP_TECS: fixed parameter doc formatting 2013-07-04 17:52:40 +10:00
Paul Riseborough 8082122053 TECS-WIP : Fixed bug in initialisation of DT value 2013-07-04 16:57:50 +10:00
Andrew Tridgell 904e6b5b8f AP_TECS: for _DT to at most 0.1 2013-07-04 16:56:57 +10:00
Andrew Tridgell 68232a10f9 AP_TECS: updates to use new aircraft parameter structure 2013-07-04 16:56:57 +10:00
Andrew Tridgell 89271b7774 AP_SpdHgtControl: added speed/height control interface
this will be used by TECS
2013-07-04 16:56:57 +10:00
Andrew Tridgell 80e0f8044c AP_AHRS: added airspeed_sensor_enabled() function 2013-07-04 16:56:57 +10:00
Paul Riseborough 5b0129e02b AP_TECS: first implemention of TECS altitude control library 2013-07-04 16:56:56 +10:00
Paul Riseborough 7bdb098e77 AP_Baro: added get_EAS2TAS()
this provides the scaling factor between equivalent and true airspeed
based on altitude
2013-07-04 16:56:56 +10:00
Andrew Tridgell 61361dac9b AP_Baro: added units to baro documentation 2013-07-04 16:56:56 +10:00
Paul Riseborough 3b98bbd159 AP_Baro: more precise altitude calculation on PX4
if not using an AVR CPU then use a more computationally expensive
altitude calculation, which is more precise at higher altitudes
2013-07-04 16:56:56 +10:00
Andrew Tridgell fff777bda2 MAVLink: update to latest upstream message defintions XML
this adds new HIL support for airspeed, and common SIM_STATE and
RADIO_STATUS messages
2013-07-01 15:38:45 +10:00
Andrew Tridgell 6b7b69a048 RC_Channel: added secondary rudder support
this is used when nose wheel steering needs different reverse/range
from rudder
2013-06-29 17:31:03 +10:00
Randy Mackay b16ce5e523 AVR I2C: bug fix
Fix provided by both Jason Short and lucafedechen independently
2013-06-28 07:09:05 -10:00
phokur b00e5d95c9 Update AnalogIn.cpp
Fixed AnalogIn.cpp:42: undefined references

Full error msgs:
/cygdrive/c/MAVPRO~1/ardupilot/libraries/AP_HAL_Empty/AnalogIn.cpp:42: undefined reference to `Empty::EmptyAnalogSource::set_stop_pin(unsigned char)'
/cygdrive/c/MAVPRO~1/ardupilot/libraries/AP_HAL_Empty/AnalogIn.cpp:42: undefined reference to `Empty::EmptyAnalogSource::set_settle_time(unsigned short)'
2013-06-26 23:22:08 -10:00
Craig@3DR 1a3ed2d80b AP_Compass: Corrected COMPASS_ORIENT Parameter Description 2013-06-26 19:14:24 -07:00
Randy Mackay 6cd18868c2 AirSpeed: fix example sketch compile error 2013-06-25 22:45:30 +09:00
Randy Mackay 20ed00dcc9 AP_InertialSensor: relax accel offset sanity check 2013-06-25 14:19:42 +09:00
Andrew Tridgell 7d42a0562d AP_AHRS: cope better with large GPS yaw changes
this should cope better with bungee launches when using only GPS for
yaw.
2013-06-25 12:44:26 +10:00
Andrew Tridgell 169b5a30a5 AP_Camera: added CAM_TRIGG_DIST parameter
for triggering every N meters of GPS distance travelled
2013-06-25 12:44:26 +10:00
Andrew Tridgell 7902d57877 AP_Relay: added RELAY_PIN parameter
makes it easier to choose a pin
2013-06-24 22:39:18 +10:00
Paul Riseborough 2204b30e66 Plane: Added APM_Control integrator limits to table used to covert old PID values 2013-06-22 21:59:47 +10:00
Paul Riseborough 147856e73c APM_Control: Added integrator limiting adjustable by an advanced user parameter
this is compatible with the old IMAX settings
2013-06-22 21:55:27 +10:00
Paul Riseborough d8dab7b5c7 APM_Control: Pitch Control - Reduced the speed below which the integrator is locked
This is to allow for slow speed flare manoeuvres in FBW modes
2013-06-22 21:49:40 +10:00
Randy Mackay aa2b10f044 AP_Baro: TEMP parameter comment fix 2013-06-18 11:28:36 +09:00
Randy Mackay dde19c9585 WPNav: add acceleration parameter
WP_ACCEL added to allow user control of acceleration during missions.
Loiter acceleration made to be half of loiter max speed
2013-06-16 11:40:51 +09:00
Randy Mackay 272f0e5032 Copter: reduce twitch when entering CIRCLE mode
Set loiter target and prev iterations velocity when circle mode is
started
Start circling from projected stopping point
2013-06-15 18:18:30 +09:00
Andrew Tridgell d7d87f827e HAL_PX4: support voltage monitoring on multi-connector pin 5 2013-06-05 08:24:20 +10:00
Paul Riseborough 3ad35363be Plane : APM_Control : Removed scaler incorrectly applied to the integrator path 2013-06-04 18:09:06 +10:00
Andrew Tridgell f44f7308e8 AP_Param: we don't need to avoid writes in AP_Param now
now handled in the HAL
2013-06-04 14:02:49 +10:00
Andrew Tridgell 2316c3bd11 AP_HAL: make storage->write_block() take a const pointer 2013-06-04 14:02:13 +10:00
Andrew Tridgell 3c9d45d7d0 HAL_AVR: avoid writing bytes to EEPROM that are already correct
this speeds up writing of waypoint data, reducing latency
2013-06-04 13:33:41 +10:00
Andrew Tridgell 02252b5387 RC_Channel: removed reference to dip switches 2013-06-03 17:49:56 +10:00
Andrew Tridgell aaaa5247e3 AP_AHRS: make it possible to setup board orientation at runtime 2013-06-03 16:52:28 +10:00
Andrew Tridgell 45b385cf81 AP_RCMapper: improved docs for RCMAP_* 2013-06-03 16:28:05 +10:00
Andrew Tridgell c0058bbb03 RC_Channel: added output_trim() and read() functions
these make using rcmap in the plane code easier
2013-06-03 16:23:48 +10:00
Andrew Tridgell 033828aeb6 AP_Mount: make the code a bit easier to read 2013-06-03 16:23:48 +10:00
Andrew Tridgell 9076f6a1d0 AP_Mount: use RC_Channel::rc_channel() instead of rc_ch[] 2013-06-03 16:23:47 +10:00
Andrew Tridgell 0438952a8b RC_Channel: removed global rc_ch[] array
hide it as a object static instead
2013-06-03 16:23:47 +10:00
Randy Mackay e9594c8b80 RCMapper: simple mapping object for primary input channels
allows arbitrary mapping of first 4 channels
2013-06-03 16:23:47 +10:00
Andrew Tridgell 68adeb041d AP_Airspeed: support ARSPD_PIN option for choosing source
this gives us support for arbitrary analog pins for the airspeed
sensor, plus support for the EagleTree airspeed driver on PX4
2013-06-03 11:51:09 +10:00
Andrew Tridgell 26b7de668a AP_Param: fixed parameter save bug
This bug affected parameters where the defaults are overridden in the
object constructor. For example, a PID object may have a default value
for PID_D of 0.0, but have a constructor based default of 0.2. If the
user tries to set the value to exactly 0.0, then the set wouldn't happen,
as the value matches the value in the object default var_info[]
table. 

This change ensures we force a save to eeprom if the value is changing
from the current value, regardless of the var_info[] default.

Thanks to Tom Coyle for finding this bug!
2013-06-02 14:49:34 +10:00
Andrew Tridgell 05889391e5 APM_Control: cope with zero integrator or tconst
if the user zeros the integrator tuning factor, we need to zero the
integrator
2013-06-01 22:29:38 +10:00
Andrew Tridgell 512d3d811d APM_Control: neaten up code formatting 2013-06-01 22:29:38 +10:00
Randy Mackay 7a2afb7443 Copter Nav: add accessor for waypoint speed 2013-06-01 18:21:29 +09:00
Randy Mackay 8b87849acd Math: add wrap_PI 2013-06-01 18:21:29 +09:00
Andrew Tridgell c82caeeba1 HAL_AVR: configure analog inputs as INPUT without pullup
not all pins were defaulting to this, which led to some strange
readings on some devices. First noticed by Andi on a LM335 temperature
sensor
2013-06-01 12:19:02 +10:00