Commit Graph

165 Commits

Author SHA1 Message Date
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 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
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 ccaa7a52ef Copter: RTL bug fix to initial step is always a climb and not a descent
Also bug fix to hold yaw on take-off
2013-01-15 12:17:52 +09:00
Randy Mackay 76f032160c Copter: relax altitude check in verify_takeoff
Previously we checked if the alt > target_alt but because there is
little to no overshoot with the new accel based alt controller this
check was failing for some users.
2013-01-14 13:34:06 +09:00
Randy Mackay c447b4b79b ArduCopter: move setting of land's yaw mode to the do_land function 2013-01-13 20:01:06 +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 e77b54c7dc ArduCopter: bug fix to GUIDED mode. Now checks that desired altitude was reached before deciding the waypoint is complete. 2013-01-02 09:24:31 +11:00
rmackay9 d3cbf733ba ArduCopter: ensure RTL performs a land if a failsafe has been triggered 2013-01-02 09:19:39 +11:00
rmackay9 1b5ff6aac6 ArduCopter: restore initial climb to RTL 2013-01-02 09:19:17 +11:00
rmackay9 d8e3d5c10c ArduCopter: allow RTL's yaw mode to be overridden with a #define in APM_Config.h 2013-01-02 09:12:40 +11:00
rmackay9 ddc578fd18 ArduCopter: restore YAW to default AUTO_YAW mode instead of YAW_LOOK_AT_NEXT_WP mode 2013-01-02 09:12:17 +11:00
Pat Hickey 7af03127f6 ArduCopter: more work 2012-12-20 14:52:28 +11:00
rmackay9 d31efebd44 ArduCopter: rename throttle failsafe parameters.
Switch to LAND flight mode if throttle failsafe triggers and we do not have a GPS.
THR_FAILSAFE renamed to FS_THR_ENABLE.
THR_FS_VALUE renamed to FS_THR_VALUE.
THR_FS_ACTION removed (action is now controlled by setting FS_THR parameter).
2012-12-10 23:38:43 +09:00
rmackay9 f522ef078e ArduCopter: remove unused functions do_target_yaw, do_loiter_at_location, get_altitude_error and clear_new_altitude 2012-12-10 17:30:50 +09:00
rmackay9 56ceb230cb ArduCopter: add YAW_OVR_BEHAVE to allow control of when autopilot takes back control of yaw after pilot overrides it during a mission 2012-12-09 18:04:31 +09:00
rmackay9 9a05d3bd36 ArduCopter: add comments at the top of many navigation functions 2012-12-09 15:50:50 +09: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 cca9f9dbce ArduCopter: do_set_servo fix to resolve -1 being assigned to uint8_t 2012-12-07 12:58:44 +09:00
rmackay9 3a90fc77f9 ArduCopter: add dataflash logging of camera events 2012-12-07 00:57:08 +09:00
rmackay9 d74cf54b5d ArduCopter: allow triggering of camera from a mission 2012-12-06 23:48:30 +09:00
rmackay9 d3de77f74c ArduCopter: fix do_set_servo so that it works again 2012-12-06 20:18:33 +09:00
rmackay9 75401756f2 ArduCopter: maintain loiter control even below 1m while landing 2012-12-06 12:40:53 +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 a94826f182 ArduCopter: add set_throttle_mode to better control initialisation of variables 2012-12-06 10:31:04 +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
Andrew Tridgell bcae83c4f6 ACM: make it possible to run CLI on radio port in ArduCopter 2012-11-21 21:41:34 +11:00
Jason Short d2a5928c06 Ap state updates 2012-11-09 22:15:15 -08:00
Andrew Tridgell 406a5dc328 ACM: save another 20 bytes 2012-10-22 18:59:51 +11:00
Jason Short a0752dc7dc ACM Acceleration management
removed unused waypoint_radius var
removed slow_wp
updated speed management system to maintain a constant acceleration or deceleration of 1m/s
changed version to 2.8.1a
2012-10-21 14:32:39 -07:00
rmackay9 3c9ba94f42 ArduCopter: bug fix to ROI when no camera mount is specific 2012-10-08 12:31:10 +09:00
rmackay9 5d3ddf1fc9 ArduCopter: bug fix for ROI not working if user did not have a camera mount
Changed verify_nav_roi command to attempt to point at the target if our camera mount type is not pan_tilt nor pan_tilt_roll
2012-09-10 02:03:32 +09:00
uncrustify 6791da4ee7 uncrustify ArduCopter/commands_logic.pde 2012-08-21 19:19:50 -07:00
rmackay9 7a6732fb4b ArduCopter: removed unused icount variable from commands_logic.pde to reduce compiler warnings. 2012-08-18 16:04:23 +09:00
rmackay9 a72bf6ef57 ArduCopter: replaced abs with labs as required in a few places.
Also fixed a small bug in the get_stabilize_pitch function in which it was using the roll (instead of pitch) to decide whether it should let the i term build-up or not.
2012-08-16 17:51:09 +09:00
Jason Short 3ad08b7ffc ACM : Added larger WP radius for fast waypoints so we don't loose speed angling in on the WP at the last second. 2012-08-10 10:02:32 -07:00
Jason Short d796814dfc ACM : Commands Logic
Altitude cleanup
2012-08-09 16:59:43 -07:00
Andrew Tridgell fb26160d3b ACM: change to use get_bearing_cd() instead of get_bearing() 2012-08-08 12:12:30 +10:00
rmackay9 f79b90725e ArduCopter: Dan Gray's fix for Condition_Yaw
command_yaw_dir is an unsigned byte but was being set to a -ve number leading to very incorrect yaw target heading for counter clockwise turns.
command_yaw_end (i.e. turn's end target) was not being set if turn was of type "relative"
2012-08-07 06:43:10 -07:00
rmackay9 8e5312a759 ArduCopter: add support for MAVLink's MAV_CMD_NAV_ROI command
do_nav_roi and verify_nav_roi functions added to turn the copter and/or mount in response to a MAV_CMD_NAV_ROI way point
2012-07-25 11:02:54 +09:00
Jason Short 3a62608355 Arducopter: Added Slow_WP setting to regular wp navigation 2012-07-19 09:48:54 -07:00
Jason Short 71248fe114 Arducopter
increased landing authority
2012-07-18 22:57:10 -07:00
Jason Short a88d69e40e Arducopter:
Loiter unlimited can now travel to a WP and then loiter.
set_altitude for landing now set to 0
2012-07-18 22:57:10 -07:00
Jason Short d8ff5dcfab Arducopter: Fix circle_WP 2012-07-12 09:22:20 -07:00
Jason Short a28070e0e0 Arducopter: Loiter unlimited fix 2012-07-12 08:52:49 -07:00
Jason Short 3048d2f9b4 Arducopter: WP_radius
Switching to stored WP_radius in meters, just like Arduplane
2012-07-10 21:53:38 -07:00
Jason Short 19d8c405fd Arducopter : Force home alt to 0 2012-07-10 21:53:37 -07:00
Amilcar Lucas dfe0983e1e Merge the changes from APM_Camera branch into ArduCopter
Conflicts:

	ArduCopter/Camera.pde
	ArduCopter/Parameters.pde
2012-07-11 00:39:13 +02:00
Jason Short b076b571eb commands_logic: Removed some old unused code 2012-07-03 17:19:19 -07:00
Jason Short d58ceb2b09 RTL: Commands.pde
Removed do_approach function - now redundant
2012-07-01 13:40:11 -07:00
Jason Short 2450c25544 Arducopter: enabled RTL_altitude, renamed function to be more accurate 2012-07-01 13:40:11 -07:00
Jason Short bc578172a5 moved detector to run until the throttle is low, then stop running. 2012-05-30 09:44:59 -07:00
Jason Short f0456dc947 Missed a Semicolon 2012-05-30 09:36:16 -07:00
Jason Short 302c632205 Altered the ground detector logic to no continuously run when landed 2012-05-30 09:34:31 -07:00
Robert Lefebvre 4e4ff84cf1 Updates to CopterLEDS
Creation of Nav Blink Function.
2012-05-22 09:58:37 -04:00
Adam M Rivera 07e53fad18 commands_logic.pde: Added write to constrained value to EEPROM. 2012-04-16 14:03:33 -05:00
Adam M Rivera 3d024ba2dd commands_logic: Allowed for an approach alt as low as 1m. Added a check to make sure we are currently above our target approach alt. 2012-04-16 10:11:50 -05:00
Adam M Rivera 77d6f22864 ArduCopter, commands_logic: Updated logic to allow as low as 5m. 2012-04-15 19:50:05 -05:00
Adam M Rivera cddcdb8be3 commands_logic: Added check to make sure the do_approach method is not being used to land. 2012-04-15 16:57:49 -05:00
Adam M Rivera cfe3b58248 commands_logic: Added do_approach() to set the new target alt based on the user defined value. 2012-04-15 16:53:25 -05:00
Jason Short 33d4d52a6b set Slow WP option for RTL in Auto mode 2012-02-19 13:12:23 -08:00
Jason Short 969ac70000 reset All for Auto takeoff 2012-02-10 22:54:29 -08:00
Jason Short 6848dc17e5 Added safety to prevent shutdown of motors during Auto-land 2012-02-09 22:22:00 -08:00
Randy Mackay 70f91e3cc3 Arducopter - reduced rate of decent when landing using sonar 2012-02-08 22:46:32 +09:00
Jason Short 67cd412105 Landing update for better baro landing 2012-01-28 22:35:57 -08:00
Jason Short 7833cea9d4 2.2B6 - Please verify Heli still functions properly.
Added AC_PID lib
Updated landing code
bug fixes
2012-01-28 22:00:05 -08:00
Jason Short 59d1f225d5 convert command into CM from M
Making Landing boost be one at minimum to trigger better navthrottle output
2012-01-21 22:06:35 -08:00
Jason Short fb72ecd4e4 formatting 2012-01-20 22:52:31 -08:00
Jason Short 43365fe802 Verify land updates from JLN
Effectively a throttle control for landing that mimics a person lowering the throttle.
2012-01-20 22:52:29 -08:00
Jason Short 72faa6525e Tweak to make circle mode scripting more accurate 2012-01-14 11:21:50 -08:00
Jason Short c327a9f000 made landing shoot for below home by 2 meters to avoid bounce up. 2012-01-13 12:46:40 -08:00
Jason Short 6b85adb460 Added Landing throttle control to force down the copter 2012-01-12 22:28:58 -08:00
Jason Short 5e9db462f5 attempting to force down without using Manual boost. 2012-01-11 22:41:51 -08:00
Jason Short 3a5ffc252d updated climb rate control
Land detector
2012-01-10 23:42:27 -08:00
Jason Short 351be7c305 Made timer unsigned 2012-01-10 23:42:26 -08:00
Jason Short 78255b722e Slowed Auto Descent
Don't return true in Landing code to prevent flyways in Stabilize
2012-01-08 23:01:22 -08:00
Jason Short 6678edf243 Auto-land updates - removed sonar option - not needed
updates from JLN
2012-01-07 22:27:26 -08:00
Andrew Tridgell c1c3115b42 ACM: fixed a alt hold bug
== instead of =
2012-01-05 10:14:30 +11:00
Jason Short 467ef66a77 Added home offset for altitude 2012-01-04 09:28:38 -08:00
Jason Short 40c649a27b Made landing disarm the motors 2012-01-04 09:28:38 -08:00
Jason Short 580ad2c5ce Added JLN's landing patch, moved some variables local such as Jump counter 2012-01-04 09:28:36 -08:00
Jason Short 51e6170ecb Missing ; 2011-12-29 23:02:01 -08:00
Jason Short 4353f60f60 removed takeoff complete flag from missions, not used and would be useful elsewhere. 2011-12-29 23:02:01 -08:00
Jason Short 0ba8a9f30b Allows user to specify just an altitude for Circle Mode 2011-12-15 20:51:40 -08:00
Jason Short 4d90058c90 dupe of landing logic for scripting 2011-12-14 22:08:41 -08:00
Jason Short 069bcbf5e6 Made landing slower 2011-12-10 19:33:19 -08:00
Jason Short 6dfdd754ea Stability patch updates,
Cleanup
2011-12-06 21:03:56 -08:00
Jason Short 4a6feb3acb better comments out of some old unused functions to avoid compiler errors 2011-11-28 10:33:06 -08:00
Jason Short b883ff937c renamed the options_mask 2011-11-20 00:22:52 -08:00
Jason Short a168691eba Working implementation of Jump Command 2011-11-16 21:28:56 -08:00
Jason Short ddd89e1849 Mission Scripting updates 2011-11-16 00:22:23 -08:00
Jason Short 163345dadd Mission Scripting re-write 2011-11-16 00:22:22 -08:00
Jason Short 3732b7db71 Added code notes 2011-11-09 12:07:15 -08:00
Jason Short 69fec433e6 Update to RTL logic. 2011-11-07 21:30:12 -08:00
Jason Short 4afc3e9f17 Fix for bad RTL tracking in Autopilot 2011-11-07 21:09:29 -08:00
Jason Short c8304114a3 renamed some command variables to align with Arduplane
reworked the arming code and moved the DCM gains out.
updated climb_rate to include sonar data.
2011-11-04 21:41:51 -07:00
Jason Short 9500171a46 tweak to the Loiter N turns 2011-10-12 20:59:12 -07:00
Andrew Tridgell d11303ef78 removed an unused variable 2011-10-11 20:53:43 +11:00
Andrew Tridgell eed26ae91a fixed a '=' vs '==' bug in do_loiter_turns() 2011-10-11 20:53:43 +11:00
Andrew Tridgell d89ae696ef merged the GCS updates from ArduPlane to ArduCopter
this removes all the non-MAVLink GCS options, and simplifies the HIL
and GCS code a lot. It also adds async sending of low priority GCS
text messages.
2011-10-11 20:53:43 +11:00