Commit Graph

597 Commits

Author SHA1 Message Date
Jason Short
abd0fb9099 AC : global static variables should not be initialized to zero 2013-02-22 17:34:18 +09:00
Randy Mackay
9904e9f4db Copter: update firmware version to 2.9.1-rc1 2013-02-19 13:43:36 +09:00
Randy Mackay
a0b65a262b Copter: use scaled throttle for accel-throttle's I term
Accel throttle's I term is taken from scaled manual throttle
2013-02-01 22:37:25 +09:00
Randy Mackay
06a71af12f Copter: THR_MID used to scale manual throttle 2013-02-01 22:37:16 +09:00
rmackay9
9c3b9907dd Copter: bug fix to set sonar_alt_health to zero when disabled 2013-01-31 17:00:28 +09:00
Randy Mackay
ce370bab0c Copter: rename CUR and CURR to CURRENT for logging
Based on user complaint that enable/disable was using CUR while message
was appearing as CURR
2013-01-26 17:20:41 +09:00
Randy Mackay
d2767b911c AP_Math: switch get_distance_cm to return uint32_t
Includes changes required on ArduCopter and ArduPlane side as well
2013-01-26 17:04:12 +09:00
Randy Mackay
0056bfadd7 Copter: rename ROLL_PITCH_LOITER
new name ROLL_PITCH_LOITER_INAV makes it more clear that it should only
be used with the new inertial nav loiter controllers
2013-01-25 23:27:31 +09:00
Randy Mackay
aaecc25ac7 Copter: leonard's inav2
Moved loiter controller to navigation.pde
2013-01-25 15:16:35 +09:00
Randy Mackay
fd02cfe706 Copter: added set_nav_mode to control initialisation of nav controllers
Renamed run_navigation_controllers() to run_autopilot()
Renamed update_nav_wp() to update_nav_mode()
Renamed wp_control to nav_mode to be more consistent with roll-pitch,
yaw and throttle controllers
2013-01-25 15:16:29 +09:00
Randy Mackay
9a09f086d2 Copter: Leonard Hall's inertial nav ver 2 2013-01-23 12:34:49 +09:00
rmackay9
ab1978ad50 Copter: Leonard Hall's inertial nav based loiter 2013-01-22 18:38:00 +09:00
Robert Lefebvre
dde713aaa5 Arducopter: Backing out my changes for a new Loiter Repositioning mode. Leonard and Jonathan's work will trump this. 2013-01-20 21:32:00 +09:00
Randy Mackay
577bf865b3 Copter: update firmware version to 2.9-dev
The -dev extension indicates that we are post 2.9 release
2013-01-17 13:03:33 +09:00
James Bielman
5631f865b2 Update floating point calculations to use floats instead of doubles.
- Allows use of hardware floating point on the Cortex-M4.
- Added "f" suffix to floating point literals.
- Call floating point versions of stdlib math functions.
2013-01-16 13:52:01 +11:00
Randy Mackay
148c227d73 Copter: update firmware version to rc5 2013-01-15 12:17:41 +09:00
Randy Mackay
c1fa850d10 ArduCopter: update firmware version to 2.9-rc4 2013-01-13 20:01:09 +11:00
Randy Mackay
175f69a64f ArduCopter: smooth throttle when switching from manual throttle to alt hold
new set_accel_throttle_I_from_pilot_throttle function copies the
difference between the pilot's throttle and hover throttle to the
accelerometer based throttle controller's I term.
2013-01-13 20:00:59 +11:00
Randy Mackay
fbed8b8861 ArduCopter: alphabetized the contributors list
Jonathan Challinger added
2013-01-13 20:00:28 +11:00
Randy Mackay
5965914039 ArduCopter: increase firmware version to 2.9-rc3 2013-01-13 20:00:25 +11:00
Andrew Tridgell
b0c710b67f Copter: move read_AHRS() before run_rate_controllers()
this ensures the rate controllers use the latest data
2013-01-13 20:00:14 +11:00
rmackay9
f25f1cb3bf ArduCopter: changed alt hold to use the sonar if enabled and healthy 2013-01-13 19:56:19 +11:00
rmackay9
21b6c78d12 ArduCopter: added get_throttle_althold_with_slew to allow slower altitude target changes
Improved surface tracking by using slewed althold controller
Reduced sonar mode filter to just 3 elements to reduce lag but at the possible consequence of allowing sonar noise to creep through for people with margin sonar set-ups.
2013-01-13 19:51:47 +11:00
Randy Mackay
87627d883b ArduCopter: use new logging method for remaining packet types
Additional changes include renaming RAW dataflash type to IMU
2013-01-13 00:17:44 +09:00
Andrew Tridgell
af478d52bc Copter: use the new logging methods for 2 packet types
the rest still need to be converted
2013-01-12 18:15:23 +11:00
Andrew Tridgell
0fe7901422 Copter: only print perf data when SCHED_DEBUG is non-zero 2013-01-12 12:06:40 +11:00
Andrew Tridgell
dcb181d2d8 Copter: use new AP_Scheduler library 2013-01-12 12:02:57 +11:00
Andrew Tridgell
2e57720444 Copter: move memcheck_init() earlier in setup 2013-01-11 10:24:21 +11:00
James Bielman
7374e5d84e ArduCopter: Use 16-bit arithmetic when comparing event tick counters.
- On the ARM, once the tick counter wrapped, we stopped running events
  because the wraparound case wasn't being handled correctly.  Make
  sure the comparison is 16 bits to prevent this.
2013-01-09 11:19:52 -08:00
James Bielman
7827a4a54a ArduCopter: Add AP_HAL_SMACCM support.
- Added default configuration to "config.h".
- Added main function to run under FreeRTOS with HWF4.
2013-01-09 11:19:51 -08:00
James Bielman
ab37f833db MS5611: Fix CONFIG_MS5611_SERIAL definitions.
- Make sure the values are defined as integers.  We were always using
  SPI rather than using I2C when desired.
2013-01-09 11:19:51 -08:00
Andrew Tridgell
e575c5eba0 Copter: read baro at 50Hz 2013-01-09 23:46:05 +11:00
Andrew Tridgell
269804e866 Copter: use barometer.accumulate()
this gives us more consistent timing and faster baro reads on APM1
2013-01-09 23:08:19 +11:00
Andrew Tridgell
860f4b2605 Copter: merge the latest 2.9 changes into master 2013-01-08 14:37:40 -08:00
Andrew Tridgell
d11dde578f Copter: a useful bit of timing debug code
enable when looking at main loop timing
2013-01-07 11:07:44 +11:00
Andrew Tridgell
d952ccf968 Copter: added main_loop_ready() function
this tells us when the main loop is ready to run. MAVLink won't send a
message if the main loop could run.
2013-01-07 11:07:34 +11:00
Andrew Tridgell
c48714be16 Copter: enabled PX4 sensors 2013-01-05 20:39:31 +11:00
James Bielman
264db3670e AP_Baro: Add CONFIG_MS5611_SERIAL option to choose between SPI and I2C.
- Update ArduCopter and ArduPlane modules to pass the correct serial
  driver to the MS5611 driver.
- Update barometer examples, assuming SPI.
2013-01-03 13:48:06 -08:00
Andrew Tridgell
94e3322e24 Copter: fixed build on px4 2013-01-02 22:09:02 +11:00
Andrew Tridgell
e56a7eacec Copter: don't pass board version to motors 2013-01-02 15:28:34 +11:00
Andrew Tridgell
ead38f917f Copter: use GRAVITY_MSS 2013-01-02 14:45:08 +11:00
rmackay9
228ad2198f ArduCopter: update firmware version to 2.9-rc2 2013-01-02 09:55:37 +11:00
rmackay9
677b38a48e ArduCopter: first implementation of surface tracking using sonar
Note: not yet enabled as part of any flight mode
2013-01-02 09:55:37 +11:00
rmackay9
68b62abd38 ArduCopter with the new Camera and Relay classes for APM1 and APM2.
All changes by Sandro Benigno
2013-01-02 09:55:37 +11:00
rmackay9
e850ab7ccd ArduCopter: add AUTO_VELZ_MIN, AUTO_VELZ_MAX and PILOT_VELZ_MAX to allow better control of climb/descent rate in auto and manual throttle modes 2013-01-02 09:24:31 +11:00
Craig@3DR
0ed25cf719 Global change all references from
GPS_PROTOCOL_MTK16
to
GPS_PROTOCOL_MTK19
2013-01-02 09:24:31 +11:00
rmackay9
466097b383 ArduCopter: use inertial nav for current altitude and climb rate 2013-01-02 09:22:51 +11:00
rmackay9
5ba363b007 ArduCopter: move gcs_check function (which sends to ground station) to run when 50hz loop is not running
Also removed redundant heartbeat message
2013-01-02 09:21:35 +11:00
rmackay9
bd0e018ca0 ArduCopter: restore auto-trim method but now use AHRS.add_trim 2013-01-02 09:20:08 +11:00
Robert Lefebvre
6e64b1b357 ACM: Precision Loiter RePositioning code.
Protected behind a #define
2013-01-02 09:19:39 +11:00
rmackay9
e6519330f4 ArduCopter: remove unused rc_override variables to save 21 bytes 2013-01-02 09:19:17 +11:00
rmackay9
ac8af9a53f ArduCopter: Leonard Hall's changes to alt hold including adding low pass filter to climb rate
get_throttle_rate_stabilized changed to simply update the target altitude instead of talking directly to the rate controller.
get_throttle_althold changed to use sqrt of distance when calculating the desired rate towards the target altitude.
added reset of accel based throttle PID's I term.
unrelated small bug fix from Randy to allow CH6 tuning of throttle rate D term.
2013-01-02 09:19:17 +11:00
rmackay9
d926360e81 ArduCopter: move gcs updates to run only when there are 4ms of spare time before the next 100hz iteration starts 2013-01-02 09:14:31 +11:00
rmackay9
6da68c53a5 ArduCopter: bug fix so AP_Limits does not use up memory if it is disabled 2013-01-02 09:13:42 +11:00
rmackay9
5633164fa0 ArduCopter: bug fix for compass.accumulate check in main loop (millis vs micros issue) 2013-01-02 09:12:40 +11:00
rmackay9
8e032b89ee ArduCopter: create 2.9 branch and update firmware version 2013-01-02 09:10:40 +11:00
Andrew Tridgell
06357c40f2 Copter: use new functions 2012-12-20 14:53:22 +11:00
Andrew Tridgell
a02f723f3a Copter: fixed HIL builds 2012-12-20 14:52:37 +11:00
Andrew Tridgell
9e986801c9 Copter: fixed SITL for ArduCopter 2012-12-20 14:52:34 +11:00
Andrew Tridgell
08b1c2d590 Copter: fixed GPS init 2012-12-20 14:52:33 +11:00
Pat Hickey
d5d97be837 ArduCopter: add param loader properly implement parameters
* thanks tridge!
2012-12-20 14:52:29 +11:00
Pat Hickey
5e63491994 ArduCopter: fix issues with HAL/HIL mixup and baro/compass instances 2012-12-20 14:52:29 +11:00
Pat Hickey
21d0da84a6 ArduCopter: temporarily disable AP_Param::setup_sketch_results
* rebased away tridge's AP_Param changes as they seemed possibly buggy?
2012-12-20 14:52:29 +11:00
Pat Hickey
a0151aa66c ArduCopter: fix cliSerial null ptr, do AP_Param::setup_sketch_defaults
* plus make SITL DataFlash available.
2012-12-20 14:52:29 +11:00
Pat Hickey
2aa4657315 ArduCopter: changes to use CONFIG_HIL_BOARD 2012-12-20 14:52:28 +11:00
Pat Hickey
ade7099d75 ArduCopter: add AP_HAL_MAIN 2012-12-20 14:52:28 +11:00
Pat Hickey
5bd7046a95 ArduCopter: sketch cpp builds! 2012-12-20 14:52:28 +11:00
Pat Hickey
7af03127f6 ArduCopter: more work 2012-12-20 14:52:28 +11:00
Pat Hickey
70f4739522 ArduCopter: more fixes 2012-12-20 14:52:28 +11:00
Pat Hickey
f281d9265e ArduCopter: reworked sonar analog source creation 2012-12-20 14:52:28 +11:00
Pat Hickey
d9e0bbbbab ArduCopter: first pass at AP_HAL porting
* changed all the byte types to uint8_t
* fixed up much of the serial stuff
2012-12-20 14:52:27 +11:00
Pat Hickey
a4f1f6a5db AP_Progmem: fix dependencies for all sketches touched by AP_HAL_AVR 2012-12-20 14:51:28 +11:00
Pat Hickey
3f1d9d7f69 AP_Param: #include <AP_Param.h> fixups for libraries & sketches
* I mostly went through with grep and added an #include <AP_Param.h> below
  every #include <AP_Common.h>. Not all of these example sketches might
  strictly need AP_Param.
2012-12-20 14:51:19 +11:00
Jason Short
19ae5c30eb ACM : Formatting 2012-12-13 20:12:39 -08:00
rmackay9
047f848cc7 ArduCopter: remove ThirdOrderCompFilter from list of includes 2012-12-10 09:14:44 +09:00
rmackay9
0f7bb79d89 ArduCopter: add comments to tuning parameters.
Use RC_CHANNEL types as defined by RC_Channel library.
Remove unused definitions.
2012-12-09 16:44:42 +09:00
rmackay9
8c2423f618 ArduCopter: code clean-up. Changed update_nav_wp to use a switch statement and relocated to navigation.pde 2012-12-09 15:24:19 +09:00
rmackay9
b4e5176e2a ArduCopter, AP_InertialSensor: restore mpu6k sample rate to 200hz but keep default filtering at 42hz. 2012-12-09 14:27:33 +09:00
Robert Lefebvre
0eb57bf93d ACM: TradHeli
Fix to make update_throttle_cruise work with stab_throttle scaling.
2012-12-08 15:12:39 -05:00
rmackay9
9dd978576b ArduCopter: auto yaw changes to allow pilot override of yaw during missions
Added set_yaw_mode to better control of yaw controller changes and variable initialisation.
Replaced AUTO_YAW mode with separate yaw controllers YAW_LOOK_AT_NEXT_WP, YAW_LOOK_AT_LOCATION, YAW_LOOK_AT_HEADING.
Pilot manual override of yaw causes yaw to change to YAW_HOLD (i.e. manual yaw) until next waypoint is reached.
Added get_yaw_slew function to control how quickly autopilot turns copter
Changed YAW_LOOK_AHEAD to use GPS heading and moved to new get_look_ahead_yaw function in Attitude.pde
Renamed variables: target_bearing->wp_bearing, original_target_bearing->original_wp_bearing.
Removed auto_yaw_tracking and auto_yaw variables and update_auto_yaw function as they are no longer needed.
Simplified MAV_CMD_CONDITION_YAW handling (do_yaw).  We lose ability to control direction of turn and ability to do long panorama shots but it now works between waypoints and save 20bytes.
2012-12-08 14:23:32 +09:00
rmackay9
99b32a39c4 ArduCopter: InertialNav time constant CH6 tuning changed to only update enabled axis 2012-12-07 13:01:40 +09:00
rmackay9
39d524212f ArduCopter: allow accel based throttle controller to be enabled/disabled with the new THR_ACC_ENABLE parameter.
When disabled the original velocity based throttle controller is used.
2012-12-06 10:31:57 +09:00
rmackay9
a5bb54e36e ArduCopter: RTL clean-up and slightly improved landing sensor
Consolidated RTL state to be captured by rtl_state variable.
Combined update_RTL_Nav and verify_RTL functions which performed the same function but one was for missions, the other for the RTL flight mode.
Renamed some RTL parameters and global variables to have RTL at the front.
Landing detector now checks accel-throttle's I term and/or a very low throttle value
2012-12-06 10:31:52 +09:00
rmackay9
072ffec493 ArduCopter: allow INERTIAL_NAV to be enabled separately for horizontal and vertical position 2012-12-06 10:31:41 +09:00
rmackay9
d7f76ebd87 ArduCopter: add tuning of throttle rate controller's I term (THROTTLE_KI) 2012-12-06 10:31:25 +09:00
rmackay9
7b4ed2d227 ArduCopter: restored landing detector to landing throttle mode.
Added LAND_SPEED parameter to control the rate of descent for the last 10m of a landing.
Added CH6 tuning for accel based throttle controller.
2012-12-06 10:31:20 +09:00
rmackay9
a94826f182 ArduCopter: add set_throttle_mode to better control initialisation of variables 2012-12-06 10:31:04 +09:00
rmackay9
1036b35128 ArduCopter: added back in angle boost and recombined for heli and multicopter 2012-12-06 10:30:55 +09:00
rmackay9
3cbef57c64 ArduCopter: first merge of leonard's accel based altitude controller plus other changes from Randy
Changes include:
New low-level get_throttle_accel function takes target acceleration and compares vs earth-frame Z accelerometer values to produce output to motors.
Higher level throttle controllers modified to call new get_throttle_accel controller
Throttle_rate_stabilized controller added which maintains a desired climb/descent rate
Throttle_land controller added - descends using normal auto throttle controller to 10m then descends at 50cm/s
Multiple throttle modes added including landing mode
Land flight mode no longer needs GPS
Throttle cruise maintenance moved to update_throttle_cruise function
2012-12-06 10:30:49 +09:00
Robert Lefebvre
1d589c0b7d ACM: TradHeli
Fixes for Attitude rate controllers.
2012-12-04 14:42:04 -05:00
Robert Lefebvre
315a7e8000 ACM: Yaw Look Ahead Changes 2012-12-04 13:26:41 -05:00
Robert Lefebvre
9130045298 ACM: Code Cleanup 2012-11-30 17:05:12 -05:00
rmackay9
8141f0b600 ArduCopter: bug fix - increase mpu6k sample rate to 100hz 2012-11-30 23:49:18 +09:00
Andrew Tridgell
6fbf5ec8f2 Copter: update ArduCopter for new ins interface 2012-11-30 07:15:18 +11:00
Robert Lefebvre
07d7d90882 ACM: TradHeli
Bringing in Low Pass Filter for Rate Controllers
2012-11-26 21:51:23 -05:00
Robert Lefebvre
6b8c39dd10 ACM: Creating Yaw_Look_Ahead yaw mode.
This function is not fully tested yet.
2012-11-26 21:37:13 -05:00
Robert Lefebvre
3f0e8dd358 ACM: TradHeli
Bringing in Low Pas Filter
Commented out because it does not build.
Needs updates to Low Pass Filter Lib
2012-11-26 21:21:12 -05:00
Robert Lefebvre
e8d619acad ACM: Begin creation of TradHeli rate control.
May affect Multi-Rotors.
2012-11-26 21:02:41 -05:00
Robert Lefebvre
6b1fee767a ACM: TradHeli
Creating Stab_Collective Function to allow for different collective ranges between Stabilize and other modes.
This makes for a smoother collective action in Stabilize mode with manual throttle, while still allowing full collective travel in Acro and other modes.
2012-11-26 19:37:20 -05:00
Robert Lefebvre
95eeda7cf7 ACM: TradHeli
Removing Angle Boost function.
Does not make sense for helis due to aerodynamics.  Can cause more problems than it solves.
2012-11-26 18:58:21 -05:00