Caio Marcelo de Oliveira Filho
f20a4e413c
AP_Mission: use millis/micros/panic functions
2015-11-20 12:32:03 +09:00
Lucas De Marchi
831d8acca5
Remove use of PROGMEM
...
Now variables don't have to be declared with PROGMEM anymore, so remove
them. This was automated with:
git grep -l -z PROGMEM | xargs -0 sed -i 's/ PROGMEM / /g'
git grep -l -z PROGMEM | xargs -0 sed -i 's/PROGMEM//g'
The 2 commands were done so we don't leave behind spurious spaces.
AVR-specific places were not changed.
2015-10-30 14:35:16 +09:00
Lucas De Marchi
2c38e31c93
Remove use of PSTR
...
The PSTR is already define as a NOP for all supported platforms. It's
only needed for AVR so here we remove all the uses throughout the
codebase.
This was automated with a simple python script so it also converts
places which spans to multiple lines, removing the matching parentheses.
AVR-specific places were not changed.
2015-10-30 14:35:04 +09:00
Randy Mackay
756d564b7c
Mission: sanity check command altitudes
2015-10-19 16:15:08 +09:00
Tom Pittenger
cb20325593
AP_Mission: added flight stage FLIGHT_LAND_ABORT
...
- add get_prev_nav_cmd_with_wp_index(). This is different than get_prev_nav_cmd_index() in that it only stores the index if there is a valid lat/lng (+1 squashed commits)
- added mission item command to NAV_LAND which is the abort takeoff altitude. If 0 then use last takeoff if available, else use 50m
2015-09-09 09:04:24 +10:00
Tom Pittenger
1026e7df45
AP_Mission: updated comment
...
altitude and lat/lng are all used
2015-09-08 17:05:54 +10:00
Tom Pittenger
15b242832e
AP_Mission: lat/lng == 0 bug fix
...
was using wrong logic to check for lat/lng == 0
2015-08-29 21:17:35 +10:00
Tom Pittenger
41508457e1
AP_Mission: add get_prev_nav_cmd_with_wp_index()
...
This is different than get_prev_nav_cmd_index() in that it only stores the index if there is a valid lat/lng
2015-08-29 21:17:35 +10:00
Randy Mackay
1271e531e2
Mission: sanity check location
2015-08-27 15:15:56 +09:00
Michael Day
a5e1d8e902
AP_Mission: Give CONINTUE_AND_CHANGE_ALT a parameter: climb/descend
...
Param 1 denotes which direction the user expects the plane to
travel when changing altitude:
0 = no expectation, command completes when within 5 m of altitude.
1 = climb expected, command completes at or above altitude.
2 = descent expected, command completes at or below altitude.
2015-08-20 11:37:17 +10:00
Gustavo Jose de Sousa
34d1a29ec1
AP_Mission: 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
766ccea3be
Mission: fix bug causing first do-cmd to be run many times
...
The symptom was that if the very first command in the mission was a
do-command, it would be run after every nav-command that didn't have
another do-command before it.
2015-07-17 12:15:08 +09:00
Randy Mackay
429346f4bc
AP_Mission: add missing breaks to case statement
2015-07-17 12:15:06 +09:00
Tom Pittenger
e6122d1a4e
AP_Mission: ensure cache coherence on mission resume
...
- when resuming a mission we should read the value from storage of the same index to ensure we're not continuing an old cached version of the mission item.
- inherent problem: DO commands will continue and will be unaffected unless the new mission has a different DO_ command structure. If so, a set_current_cmd() or reset() should be issued by the GCS.
2015-06-25 10:21:06 +10:00
Andrew Tridgell
9bd8e215b2
AP_Mission: enable DO_AUTOTUNE_ENABLE
2015-06-15 09:20:54 +10:00
Andrew Tridgell
08acde2766
AP_Mission: added ALTITUDE_WAIT NAV command
...
used for HAB launch
2015-06-15 09:20:54 +10:00
Randy Mackay
9c28d61a5c
Mission: protect against endless loops of do-commands
2015-06-01 18:11:54 +09:00
Tom Pittenger
79605de8f5
AP_Mission: replace fabs() with fabsf()
2015-05-09 09:57:27 +10:00
Michael Day
3d3267d472
AP_Mission: Now support mission item MAV_CMD_NAV_LOITER_TO_ALT
2015-04-25 09:12:16 +10:00
Randy Mackay
87e6452ee9
Mission: bug fix when jump target is zero
...
This would result in copter flying to a waypoint high above home
2015-04-21 20:42:49 +09:00
Randy Mackay
888c2289ce
Mission: support do-digicam-control parameters
2015-04-20 13:50:01 +09:00
Randy Mackay
f6021010c5
Mission: support do-mount-control
2015-03-21 21:52:19 +09:00
Andrew Tridgell
3d433d2106
AP_Mission: loop check is only needed in one place
2015-01-23 13:48:45 +11:00
Andrew Tridgell
540cadc086
AP_Mission: prevent infinite loop with linked jump commands
...
this prevents a "jump loop" from causing a firmware lockup. Thanks to
dellarb for reporting this!
2015-01-23 13:14:27 +11:00
Andrew Tridgell
ede920f293
AP_Mission: ensure location options are zero at start of mavlink conversion
2014-12-03 18:29:43 +11:00
Michael Day
b3e693daa4
AP_Mission: Support MAV_CMD_DO_FENCE_ENABLE as a mission item.
2014-11-25 13:02:47 +11:00
Michael Day
b36c1b2c3d
AP_Mission: support for MAV_CMD_CONTINUE_AND_CHANGE_ALT
2014-11-25 10:43:15 +11:00
Michael Day
83c2f497a3
AP_Mission: Change jump_to_landing_sequence to get_landing_sequence_start
2014-10-24 21:42:06 +11:00
Andrew Tridgell
15a661e17a
AP_Mission: fixed logic in jump_to_landing_sequence()
...
see comments on drones-discuss
2014-10-20 08:36:20 +11:00
Andrew Tridgell
8c6b875dcc
AP_Mission: avoid the AP_AHRS cast
...
get_position() is now const
2014-10-20 08:36:20 +11:00
Michael Day
ea91f4d47b
AP_Mission: Added support for MAV_CMD_DO_LAND_START
2014-10-20 08:36:19 +11:00
Randy Mackay
be1621877f
Mission: support GUIDED_ENABLE and GUIDED_LIMITS
...
This replaces the ardupilot only NAV_GUIDED command.
Also remove support for NAV_VELOCITY mission command which will be
replaced by SET_POSITION_TARGET non-mission command.
2014-10-13 21:40:23 +09:00
Randy Mackay
5ca3c4baf6
Mission: fix CHANGE_ALT to store climb rate in lat param
...
The slightly confusing storage of climb rate in the lat field led to a
bug fix a few months ago that actually created a bug.
2014-09-26 23:23:04 +09:00
Randy Mackay
1ce8e453c2
Mission: add support for DO_GRIPPER
2014-09-17 21:14:17 +09:00
Andrew Tridgell
effccacf46
AP_Mission: fixed acceptance radius outgoing
...
this needs to match incoming
2014-09-03 21:15:56 +10:00
Andrew Tridgell
3a5e960fe5
AP_Mission: revert APM_BUILD_TYPE change
2014-09-03 13:28:17 +10:00
Andrew Tridgell
36b854fa98
AP_Mission: fixed build for arduino IDE
2014-09-03 13:20:31 +10:00
Andrew Tridgell
c4f84232e2
AP_Mission: make cmd.p1 be radius on plane for NAV_WAYPOINT
2014-09-03 12:38:30 +10:00
Randy Mackay
d6aa868cac
Mission: start next nav cmd immediately after prev completes
2014-08-27 18:05:49 +10:00
Andrew Tridgell
7a12ff0271
AP_Mission: convert to using StorageManager
2014-08-13 18:46:43 +10:00
Daniel Frenzel
1c7e8f8fb2
AP_Mission: Consecutive return, break, continue, goto or throw statements are unnecessary.
...
Signed-off-by: Daniel Frenzel <dgdanielf@gmail.com>
2014-08-11 09:24:26 +10:00
Andrew Tridgell
df55ae86c4
AP_Mission: added last_change_time_ms() call
...
will be used by terrain lib for scanning waypoints
2014-08-06 17:59:19 +10:00
Randy Mackay
621cc2b953
Mission: bug fix to condition-change-alt
...
Fix contributed by oniondream, thanks!
2014-08-01 12:51:50 +09:00
Andrew Tridgell
34cbaa6f17
AP_Mission: added support for MAV_FRAME_GLOBAL_TERRAIN_ALT
2014-07-25 08:33:44 +10:00
Andrew Tridgell
feaf9751cc
AP_Mission: removed use of MAV_CMD_NAV_VELOCITY and MAV_CMD_NAV_GUIDED
2014-07-24 21:38:31 +10:00
Randy Mackay
fe8a5be802
AP_Mission: support MAV_CMD_NAV_VELOCITY msg
2014-07-06 17:01:00 +09:00
Randy Mackay
f4c9d58051
AP_Mission: add support for MAV_CMD_NAV_GUIDED
2014-07-06 17:00:26 +09:00
Randy Mackay
2f7dee3ba5
AP_Mission: squeeze loiter turns radius into high byte of p1
2014-06-17 20:53:50 +10:00
Andrew Tridgell
f0df912a11
AP_Mission: added support for MAV_CMD_DO_INVERTED_FLIGHT
2014-06-05 15:44:18 +10:00
Randy Mackay
05f5164dfa
Mission: rename AUTORESET to RESTART
2014-05-09 11:31:37 +09:00
Andrew Tridgell
818e500509
AP_Mission: improve the AP_Mission docs
...
DisplayName isn't a description
2014-04-29 11:46:06 +10:00
Andrew Chapman
782fbe1ec5
AP_Mission: added reset() function
2014-04-29 11:46:06 +10:00
Andrew Chapman
a80e72ff82
AP_Mission: added MIS_AUTORESTART parameter
...
- added MIS_AUTORESTART parameter, defaults to 0
- added start_or_resume() function to either start or resume a mission
based on that parameter value
2014-04-29 11:46:06 +10:00
Randy Mackay
d8f9a1c6c6
Mission: add support for MAV_CMD_DO_PARACHUTE
2014-04-07 13:36:55 +09:00
Andrew Tridgell
cc212be41e
AP_Mission: added get_next_ground_course_cd() API
...
this gives the ground course of the next navigation leg, which can be
used to calculate the amount of steering required
2014-04-07 09:29:54 +10:00
Andrew Tridgell
31082f4ce2
AP_Mission: fixed a bug re-entering AUTO
...
this fixes a bug found by Marco where we would continue in CRUISE mode
with no waypoint if we re-entered AUTO after a mission reset
2014-03-31 06:18:07 +11:00
Randy Mackay
ac339a0289
Mission: add decoding of NAV_SPLINE command
2014-03-28 09:23:30 +09:00
Andrew Tridgell
0af35bd636
AP_Mission: fixed some compiler warnings
2014-03-24 12:52:27 +11:00
Andrew Tridgell
3bdc22d672
AP_Mission: make p1 16 bit
...
this gives us a 16 bit value for extra data on a location, allowing
for an accurate angle in centi-degrees.
Also add validation of the size of the union arms in Content
2014-03-20 16:57:09 +11:00
Randy Mackay
c520cb789c
Mission: cmd field types to match mavlink commands
...
Split Set-Servo and Repeat-Servo command structures
Split Set-Relay and Repeat-Relay command structures
2014-03-19 12:14:22 +09:00
Randy Mackay
37cff752c8
Mission: handle Loiter direction
...
loiter-unlimited, loiter-turns and loiter-time cms specify the turn
direction in Param3. This is stored in the location's loiter_ccw flag.
Previously supported only in Plane, moving here allows us to share more
code with Plane, Copter, Rover.
2014-03-19 12:13:16 +09:00
Randy Mackay
c75560218d
Mission: command specific structures
2014-03-19 12:12:51 +09:00
Andrew Tridgell
3a6698f54b
AP_Mission: fixed typo
2014-03-19 12:12:42 +09:00
Andrew Tridgell
3538621c48
AP_Mission: doc updates
2014-03-19 12:12:40 +09:00
Randy Mackay
48329c1bba
Mission: bug fix for loading consecutive do-cmds
...
The verify step was not being run for the 2nd consecutive do-command in
a mission list
2014-03-19 12:12:37 +09:00
Randy Mackay
266a1ce9af
Mission: bug fix set_current_cmd
...
If mission had completed desired command index was ignored
2014-03-19 12:12:27 +09:00
Andrew Tridgell
107cc2c126
AP_Mission: added truncate() function
...
Used when loading a mission while flying
Pair-Programmed-With: Randy Mackay <rmackay9@yahoo.com>
2014-03-19 12:12:21 +09:00
Andrew Tridgell
acdaf561c8
AP_Mission: fixed typo
2014-03-19 12:12:15 +09:00
Randy Mackay
9e07070d86
Mission: pass eeprom start into constructor
...
This allows different storage locations for ArduCopter, Plane and Rover
2014-03-19 12:11:53 +09:00
Randy Mackay
ddc4cd4f18
Mission: add init and check_eeprom_version methods
2014-03-19 12:11:46 +09:00
Randy Mackay
4c0a31a9dc
Mission: init home to zero before writing to eeprom
2014-03-19 12:11:37 +09:00
Randy Mackay
512b378c4a
Mission: allow set_current_cmd when mission is not running
...
Can now be run when mission is complete or stopped. When mission is
resumed it will begin at the set command. This command can be either a
nav or do command
2014-03-19 12:11:10 +09:00
Andrew Tridgell
eaf34bba9a
AP_Mission: fixed reset using set mission item to 0
...
this causes a mission reset
2014-03-19 12:11:07 +09:00
Randy Mackay
8dd301b0c2
Mission: set_current_cmd to use uint16
2014-03-19 12:11:06 +09:00
Randy Mackay
a6e422333e
Mission: remove alt_in_cm from mavlink to cmd conversion
2014-03-19 12:11:01 +09:00
Randy Mackay
0dc3c9ab42
Mission: add p1 to command structure
...
mavlink_to_mission_cmd method extended to support plane including adding
parameter to allow the alt to be expressed in cm or meters
2014-03-19 12:10:45 +09:00
Randy Mackay
61cc5e6b72
Mission: add replace_cmd method
2014-03-19 12:10:40 +09:00
Randy Mackay
3cbbd4ebb9
Mission: add set current command method
2014-03-19 12:10:36 +09:00
Randy Mackay
c7ffd2db90
Mission: reduce unnecessary search for do-commands
...
do_cmd_all_done flag is set after all do-commands are complete
2014-03-19 12:10:33 +09:00
Randy Mackay
0c92d60406
Mission: command index increase to int16
...
Once more eeprom space is allocated this will allow more than 255
commands
2014-03-19 12:10:31 +09:00
Randy Mackay
85b979ede9
Mission: support do-jump num_times is -1
...
do-jump loops forever when num times is set to -1
2014-03-19 12:10:29 +09:00
Randy Mackay
f4d8ccc128
Mission: add mavlink to cmd conversion methods
2014-03-19 12:10:17 +09:00
Randy Mackay
87c7d19f83
AP_Mission: special handling for cmd
2014-03-19 12:10:14 +09:00
Randy Mackay
e8db57ced3
AP_Mission: replace block read/write for eeprom
...
Also reserve command #0 for home position
2014-03-19 12:10:00 +09:00
Randy Mackay
84b3497a82
AP_Mission: fixes to protect against endless loops
2014-03-19 12:09:57 +09:00
Randy Mackay
6086bc14be
AP_Mission: mostly working draft
2014-03-19 12:09:56 +09:00
Randy Mackay
4285eba297
AP_Mission: initial draft library
2014-03-19 12:09:54 +09:00