Commit Graph

194 Commits

Author SHA1 Message Date
Pierre Kancir bffe3f6c21 AC_WPNav: add getter for crosstrack_error 2018-06-26 08:42:14 +09:00
Peter Barker 2c962afe98 AC_WPNav: add get_wp_destination to get a Location_Class for the wp 2018-05-18 20:26:37 +10:00
murata 494735db2e AC_WPNav: Change the variable name according to the unit. 2018-05-14 16:38:47 +09:00
Randy Mackay 9426ee6df6 AC_WPNav: remove loiter
Loiter is in separate AC_Loiter class
2018-04-04 10:45:10 +09:00
Randy Mackay 5215588ba0 AC_WPNav: remove unused set_desired_alt
also remove unused get_desired_alt
2018-03-28 15:08:42 +09:00
Randy Mackay 92b56c2c89 AC_WPNav: init_loiter_target always resets I term
This was only used by poshold and this has been removed as part of "new-loiter"
2018-03-16 13:50:57 +09:00
Leonard Hall 1c0678226c AC_WPNav: new loiter including accel ff and braking
Includes:
sanity check loiter accel max vs lean angle max
increase loiter aggressiveness
remove loiter calls to pos_con.freeze_ff_xy
use loiter max velocity correction
remove xy mode from loiter
move predictor to angle
add maximum pilot commanded angle to loiter
loiter use alt hold angle limit
set_pilot_desired_acceleration accept dt

Also includes:
remove loiter jerk and setting pos-con jerk
breaking gain is based on VelxyP
Jerk limit Loiter breaking
change breaking parameters use jerk limit
add maximum distance correction in Loiter to 2m
update Loiter parameter defaults
2018-03-16 13:50:57 +09:00
Randy Mackay efbd8eb386 AC_WPNav: remove unused definition
This has been moved to AC_PosControl library
2018-01-23 12:00:43 +09:00
Dr.-Ing. Amilcar Do Carmo Lucas 1a512609ac AC_WPNav: Use the get_bearing_cd() overloaded function provided by AP_Math instead 2017-12-05 08:54:49 +09:00
squilter da7aa36f2d AC_WPNav: add set_wp_destination_NED to accept target in meters NED 2017-09-09 14:05:41 +09:00
Randy Mackay 222dd0c9be AC_WPNav: correct comments
all position vectors are offsets from the ekf origin (not from the ahrs home)
2017-08-17 16:05:08 +09:00
Randy Mackay a1a5c9f239 AC_WPNav: sanity check wpnav-radius
Occasionally users accidentally set the wpnav-radius to 0 and the vehicle gets stuck at waypoints
2017-05-18 12:25:47 +09:00
Randy Mackay b1bd3f0364 AC_WPNav: yaw points along leash 2017-04-29 11:47:51 +09:00
Randy Mackay e2cf836734 AC_WPNav: add get_stopping_point
returns 3D stopping point, simply re-uses pos_controller methods
2017-04-27 14:36:22 +09:00
Randy Mackay 8c6c2e46cc AC_WPNav: protect against LOIT_SPEED divide-by-zero 2017-03-15 09:22:23 +09:00
Jacob Walser 96303c3092 AC_WPNav: Add accessor for origin, and make get_bearing_cd() public 2017-02-21 11:26:14 +11:00
Andrew Tridgell 17e1329068 AC_WPNav: converted to use AP_AHRS_View
for use in quadplane tailsitters
2017-02-18 17:26:43 +11:00
Dr.-Ing. Amilcar Do Carmo Lucas 713b08d830 AC_WPNav: Reduced WPNAV_SPEED minimum to 20cm/s 2017-01-07 14:30:07 +09:00
Randy Mackay a32068a973 AC_WPNav: remove ekf position reset handler
This has been migrated to the position control library
2016-11-24 19:58:00 +09:00
Randy Mackay 6406e34016 AC_WPNav: remove unused _loiter_step member 2016-11-24 19:57:50 +09:00
Peter Barker 1eca4e128d AC_WPNav: method to retrieve current desired pilot accels 2016-11-18 09:41:56 +09:00
murata c808ee2f49 Global: To nullptr from NULL.
RC_Channel: To nullptr from NULL.

AC_Fence: To nullptr from NULL.

AC_Avoidance: To nullptr from NULL.

AC_PrecLand: To nullptr from NULL.

DataFlash: To nullptr from NULL.

SITL: To nullptr from NULL.

GCS_MAVLink: To nullptr from NULL.

DataFlash: To nullptr from NULL.

AP_Compass: To nullptr from NULL.

Global: To nullptr from NULL.

Global: To nullptr from NULL.
2016-11-02 16:04:47 -02:00
Mathieu OTHACEHE 152edf7189 Global: remove mode line from headers
Using a global .dir-locals.el file is a better alternative than
reincluding the same emacs header in every file of the project.
2016-10-24 09:42:01 -02:00
Andrew Tridgell c87fa13e77 AC_WPNav: added WP_RFND_USE parameter
allows disable of rangefinder use for terrain following
2016-08-23 09:27:39 +10:00
Jonathan Challinger b5e80148c6 AC_WPNav: remove shift_loiter_target 2016-07-04 16:57:06 +09:00
Andrew Tridgell 86ceee4a53 AC_WPNav: fixed typo 2016-07-01 15:34:56 +10:00
Daniel Ricketts 8a6aa24525 AC_WPNav: use AC_Avoidance to stop at fence during Loiter 2016-06-22 11:38:15 +09:00
Randy Mackay 2bafc36ded AC_WPNav: support rangefinder for terrain following 2016-05-21 10:36:53 +09:00
Ricardo de Almeida Gonzaga 3033c53834 AC_WPNav: Fix typos 2016-05-13 19:20:05 -03:00
Randy Mackay 1c4b2be16a AC_WPNav: simplify use of terrain to just current location 2016-04-30 10:33:01 +09:00
Randy Mackay c5a3781507 AC_WPNav: accept terrain library reference 2016-04-30 10:33:01 +09:00
Randy Mackay 9fbfea951a AC_WPNav: spline handles terrain altitudes 2016-04-30 10:33:01 +09:00
Randy Mackay 8b2c479d62 AC_WPNav: straight line waypoints accept terrain 2016-04-30 10:33:01 +09:00
Lucas De Marchi 3ae4c222e0 AC_WPNav: replace header guard with pragma once 2016-03-16 18:40:39 +11:00
Randy Mackay adee13d729 AC_WPNav: handle ekf position reset in Loiter and Brake 2015-10-30 12:24:17 +09:00
Randy Mackay 7706102d1e AC_WPNav: add shift_loiter_target method
Shift the loiter target and freeze the feedforward if necessary
2015-08-31 18:00:24 +09:00
Randy Mackay 15fc689085 AC_WPNav: remove unused get_wp_radius 2015-08-23 11:06:19 +09:00
Gustavo Jose de Sousa ee2c388bb0 AC_WPNav: 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:28:41 +10:00
Randy Mackay a81d756ce1 AC_WPNav: remove unused definitions 2015-08-05 14:14:55 +09:00
Randy Mackay 0077cac1b7 AC_WPNav: rename stop to brake 2015-05-17 14:44:33 +09:00
Randy Mackay 61c851885f AC_WPNav: remove unused set_spline_dest_and_vel 2015-05-13 22:40:08 +09:00
Andrew Tridgell e789984c98 AC_WPNav: fix for HAL_SITL rename 2015-05-05 09:45:54 +10:00
Jonathan Challinger 2b29060a4e AC_WPNav: remove unused set_loiter_velocity 2015-05-01 16:46:53 +09:00
Randy Mackay 35874292a0 AC_WPNav: move stop below all loiter methods
No functional change
2015-04-26 16:26:53 +09:00
Robert Lefebvre 4a7fe83b0f AC_WPNav: Create Stop Mode functions 2015-04-26 16:11:45 +09:00
Randy Mackay 39213584da AC_WPNav: minor comment and formatting changes 2015-04-14 14:50:58 +09:00
Jonathan Challinger 1da410a6c6 AC_WPNav: allow user to tune loiter 2015-04-14 14:50:53 +09:00
Jonathan Challinger 6eab698e85 AC_WPNav: remove various timing hacks 2014-12-31 14:03:20 +09:00
priseborough 11fb51ceba AC_WPNav: Add nav velocity gain scaler to interfaces
Allows gains to be adjusted to compensate for optical flow noise
2014-12-06 18:16:50 +11:00
priseborough 5fa0c59310 AC_WPNav: Add EKF ground speed limit to loiter speed control
This is required to prevent the speed controller saturating the optical flow sensor during low altitude flying.
2014-12-06 18:16:50 +11:00
Jonathan Challinger 2cc65dffe0 AC_WPNav: add set_spline_dest_and_vel function 2014-11-17 14:38:46 -08:00
Jonathan Challinger 369839c7ca AC_WPNav: Use target yaw instead of current yaw for close waypoints 2014-10-31 15:23:52 +09:00
Randy Mackay dbe1c55666 AC_WPNav: add shift_wp_origin_to_current_pos for takeoff
This shifts the origin to the vehicle's current position and should be
called just before take-off to ensure there are no sudden roll or pitch
moves on takeoff.
2014-09-29 15:26:18 +09:00
Randy Mackay 765420ee04 AC_WPNav: add loiter_soften_for_landing method
This resets the position target to the current location.
2014-09-19 16:43:10 +09:00
Randy Mackay 2b64c511ed AC_WPNav: update yaw only when track is at least 2m 2014-07-06 17:02:12 +09:00
Randy Mackay a2f54fdf2c AC_WPNav: smooth waypoint by freezing feed-forward and allowing overshoot
First part of this fix is freezing the position controller's xy-axis
feed foward as we transition to the new segment.
Second part is work-around for straight line segments in that we allow
the target point to actually overshoot the end of the segment by up to
2m if the segment is a "fast waypoint".  Ideally we would instead notice
the waypoint has been completed and take any left over time or distance
and move our target along the track towards the next waypoint but that
would require a much larger change to allow the wpnav lib to hold the
next two waypoints.
2014-06-10 20:03:01 +09:00
Randy Mackay efd6d6dc70 AC_WPNav: spline div by zero fix
Also add check for straight line navigation to ensure speed is not
reduced below zero when it hits the leash limit
Also minor formatting changes
2014-06-05 22:23:38 +09:00
lthall 0912bec8f5 Spline div zero and leash limit fix 2014-06-05 22:23:35 +09:00
Randy Mackay 597d5227f5 AC_WPNav: rename set_loiter_target to init_loiter_target 2014-05-19 12:27:25 +09:00
Randy Mackay 5d20594fa4 AC_WPNav: bug fix for loiter and waypoint update rate
Thanks to EmileC for spotting this
2014-05-12 20:13:46 +09:00
lthall 9ab9eaec25 AC_WPNav: Loiter jerk default to 10m/s/s/s
Pair programmed with Randy
2014-05-08 16:16:05 +09:00
Randy Mackay 091ff91a70 WPNav: add wp_and_spline_init to set speeds an init pos controller 2014-05-08 16:15:50 +09:00
Randy Mackay 48ec0caf75 AC_WPNav: run navigation at 10hz in SITL 2014-05-08 16:15:44 +09:00
lthall b38c484874 AC_WPNav: add LOIT_JERK parameter
Limit accel output from loiter controller.
Call new pos_control.init_xy_controller when loiter starts
Remove sudden stop when pilot requested acceleration is zero

Pair programmed with Randy
2014-05-08 16:15:38 +09:00
Randy Mackay fd9f8f571f AC_WPNav: replace inav, ahrs pointers with references 2014-05-08 16:15:26 +09:00
Randy Mackay 0103ae2eb0 AC_WPNav: add WPNAV_ACCEL_Z
Allows configurable z-axis acceleration during missions
2014-04-30 21:46:12 +09:00
Randy Mackay 510c9920a6 AC_WPNav: rename get_horizontal_velocity to get_speed_xy
This new method name is consistent with the equivalent in the
AC_PosControl class
2014-04-30 21:46:06 +09:00
Randy Mackay db51d37071 AC_WPNav: add clear_pilot_desired_acceleration
This allows quickly clearing out the pilot desired acceleration for
loiter contoller.
2014-04-25 14:45:14 +09:00
Randy Mackay ad99918fee AC_WPNav: recalc leash lengths if set_horizontal_velocity is called
Resolves bug in which do-set-speed allowed reducing the speed during the
mission but not increasing it.
Slow down distance is also recalculated.
Unnecessary call to calc_wp_leash_length removed from
set_spline_origin_and_destination.
2014-04-24 13:16:08 +09:00
Randy Mackay 46fba47c8e AC_WPNav: slow target point's speed near destination 2014-04-24 13:16:00 +09:00
Randy Mackay 7c02a02bd8 AC_WPNav: reset_I flag moved to position controller 2014-04-23 15:00:14 +09:00
Randy Mackay 4d5b73b968 AC_WPNav: add reset_I to set_loiter_target 2014-04-23 15:00:07 +09:00
Ju1ien 5d0476e522 AC_WPNav: add reset_I to init_loiter_target 2014-04-23 14:59:47 +09:00
Randy Mackay 559a258ede AC_WPNav: bug fix to limit target point from moving beyond leash
Also pull Z-axis acceleration from position controller instead of using
#define
2014-04-22 23:05:11 +09:00
Randy Mackay 648787a6c8 AC_WPNav: rename some definitions 2014-04-21 15:06:29 +09:00
Randy Mackay 2167dd7d3e AC_WPNav: update target speed immediately 2014-04-21 14:51:26 +09:00
Randy Mackay d382fa51ee AC_WPNav: run loiter and wp nav at 50hz on Pixhawk 2014-04-21 13:32:02 +09:00
Randy Mackay b15d4379d8 AC_WPNav: use atan2f, make methods const 2014-03-30 23:09:51 +09:00
Randy Mackay 24eb195aa3 WPNav: add yaw control for straight line wp nav 2014-03-28 09:23:13 +09:00
Randy Mackay b42b12f7be AC_WPNav: add get_spline_yaw 2014-03-28 09:23:07 +09:00
Randy Mackay e5e71ce371 WPNav: add spline support 2014-03-28 09:22:53 +09:00
Randy Mackay e86a21a254 AC_WPNav: remove AC_PID include
This is no longer required with introduction of PosControl lib
2014-02-15 06:09:08 +11:00
Randy Mackay 9e31f0b985 AC_WPNav: use PosControl accessor
Saves 2bytes of RAM
2014-02-15 05:27:50 +11:00
Randy Mackay 64cfcb2308 AC_WPNav: use trig values from ahrs 2014-02-15 05:27:48 +11:00
Randy Mackay d4e4620159 AC_WPNav: remove unused PID references 2014-02-15 05:27:39 +11:00
Randy Mackay 1596d83d02 AC_WPNav: move leashes to AC_PosControl 2014-02-15 05:27:37 +11:00
Randy Mackay 0d4ba04e75 AC_WPNav: make advance_wp_target private 2014-02-15 05:27:37 +11:00
Randy Mackay 0c8cbba644 AC_WPNav: remove xy pos controller 2014-02-15 05:27:36 +11:00
Randy Mackay 2984e492df AC_WPNav: add reference to AC_PosControl
Also remove requirement to pass in inertial nav position and velocity to
init_loiter method
2014-02-15 05:27:35 +11:00
Randy Mackay c9415a08f1 AC_WPNav: use ahrs trig values 2014-02-08 18:16:47 +09:00
Randy Mackay 0a3559813a AC_WPNav: accessor for loiter speed 2014-01-15 15:22:30 +09:00
Andrew Tridgell 30fffa5854 AC_WPNav: fixed some build warnings 2013-12-11 10:21:41 +11:00
Tobias c3309d909c AC_WPNav: make more member pointers const 2013-10-27 13:41:29 +09:00
Tobias bb5cf4a311 AC_WPNav: make member pointer to AP_InertialNav object const since it's
never modified
2013-10-27 13:41:23 +09:00
Randy Mackay 45aeb1a921 Copter: split up loiter into 4 steps
Reduces disruption to the main loop but also introduces a delay of 30ms
to navigation output
2013-08-28 11:33:10 +09:00
Randy Mackay 6969ab573d Copter: configurable max lean angle
ANGLE_MAX parameter allows limiting the roll and pitch angles during
manual and auto flight modes to anywhere from 10 to 80 degrees
2013-08-11 12:53:22 +09: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 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 649cbf6b68 WPNav: reduce default WP_ACCEL and LOITER_SPEED 2013-07-07 16:00:13 -10: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