Commit Graph

49 Commits

Author SHA1 Message Date
Randy Mackay 129651b7e4 Rover: move set_desired_speed to each mode 2019-11-08 10:09:23 +08:00
Randy Mackay c233c3aff3 Rover: integrate OAPathPlanner 2019-06-11 13:13:22 +09:00
Peter Barker c61412d2d1 Rover: correct get_distance_to_destination in loiter mode 2019-06-05 14:35:30 +09:00
Randy Mackay 93b05d7d8a Rover: add get_desired_location method 2019-05-29 09:40:05 +09:00
Randy Mackay d0a39e6114 Rover: fix notification in guided and rtl 2019-05-10 06:55:35 +09:00
Peter Barker 40f3f414cd Rover: handle AR_WPNav failing to set desired location 2019-05-10 06:55:35 +09:00
Randy Mackay 75ba96b7a2 Rover: separate nudge from calc_throttle
This is required because AR_WPNav produces an acceleration adjusted desired speed meaning in rare cases where the vehicle is moving in reverse at the time auto is engaged, the desired speed may be temporarily negative as the vehicle slows.  In these situations we do not want to allow the vehicle's speed to be nudged to a higher reverse speed if the pilot's throttle stick is all the way down
2019-05-10 06:55:35 +09:00
Randy Mackay a94ebc5bc3 Rover: integrate navigation library 2019-05-10 06:55:35 +09:00
Tom Pittenger a798f9eb27 Rover: refactor motor.set_steering() to mode.set_steering() 2019-05-03 13:14:11 -07:00
Pierre Kancir f91ffffca7 APMrover2: use past_interval_finish_line and line_path_proportion from Location 2019-04-23 09:20:43 +10:00
Randy Mackay 28ac2c2600 Rover: rename guided limits start_time_ms 2019-03-15 21:18:46 +09:00
Randy Mackay 95d68b0cf5 Rover: reached_destination becomes const 2019-03-15 14:51:35 +09:00
Randy Mackay 3f8adb4e7d Rover: guided-within-auto target moved to structure
also guided's limit_breached made const
also guided limit check uses is_positive
2019-03-15 14:51:35 +09:00
Randy Mackay 89f0418c0f Rover: support do-guided-limits mission command 2019-03-15 14:51:35 +09:00
Randy Mackay 721c200bcc Rover: support guided-within-auto
also adds support for sending position targets to offboard controller which is assumed to return velocity commands
2019-03-15 14:51:35 +09:00
Dr.-Ing. Amilcar do Carmo Lucas 36d755a48a Rover: replace location_offset() and get_distance() function calls with Location object member function calls
This allows removing duplicated code
2019-02-28 11:44:09 +11:00
Randy Mackay 2ba6aa7e8a Rover: guided heading-and-speed control fix
This removes the lane-based-speed-control from guided mode's heading-and-speed controller which does not use the navigation controller
2019-02-13 20:11:27 +09:00
TsuyoshiKawamura 5575eeddab Rover: fixed coverity issue around loiter logic 2019-01-10 20:24:57 +09:00
TsuyoshiKawamura a9781686b1 Rover: Vehicle will stop with loiter in Guided mode for boat. 2018-12-20 20:13:15 +09:00
Peter Barker 86168cd180 Rover: add override keyword where required, fix bad method override 2018-11-08 11:30:12 +11:00
Randy Mackay 743de16c07 Rover: fix calls to calc_steering_to_heading
reversed flag was being passed into the wrong argument
2018-09-11 14:39:50 +09:00
Pierre Kancir 3ef910ff11 Rover: fix initial target when setting Guided 2018-08-22 21:02:40 +09:00
Raouf df3b6202f5 Rover: support DO_SET_REVERSE commands in guided, RTL, SmartRTL 2018-08-22 13:36:44 +09:00
Randy Mackay 82aba6fe56 Rover: guided heading-and-speed control slows using yaw error 2018-07-18 15:11:09 +09:00
Randy Mackay 5dc4b8e66d Rover: guided mode slows to stopping point on init 2018-07-18 15:11:09 +09:00
Randy Mackay 77598f72d1 Rover: remove redundant set_steering calls from Guided
steering is centered within the stop_vehicle method
2018-07-18 15:11:09 +09:00
Randy Mackay 73bdc3be09 Rover: set ahrs flyforward if thr over 15% for 2 seconds
or if throttle is positive and desired speed over 0.5m/s
2018-05-29 16:37:31 +09:00
Randy Mackay fc35e74821 Rover: pass dt to attitude controller 2018-05-24 11:06:20 +09:00
Randy Mackay ef2223a712 Rover: integrate attitude control change to steering output and scaling
steering output is always positive for clockwise
steering is scaled in motors library meaning we do not need to tell attitude controller about skid-steering or vectored-thrust
2018-05-10 08:02:13 +09:00
Randy Mackay 8119c537c7 Rover: integrate vectored thrust support 2018-04-24 19:57:19 +09:00
Randy Mackay 29e8866ea9 Rover: move avoidance into calc_throttle
also enable avoidance for steering and guided modes
2018-04-24 12:24:53 +09:00
Randy Mackay 0da8ff6b2e Rover: boats always navigate when outside waypoint radius 2018-02-07 07:33:11 +09:00
Randy Mackay 916fe80000 Rover: remove mode class's desired-lat-accel
This was a duplicate of the value held in the attitude controller
2018-01-05 09:27:53 +09:00
Randy Mackay 49493fe6a2 Rover: add calc_steering_to_heading
removes some duplicate code in Guided and Auto
2018-01-05 09:27:53 +09:00
Randy Mackay b778546eda Rover: rename mode lateral acceleration and make private 2017-12-09 12:18:49 +09:00
Randy Mackay 34c2fba9a7 Rover: boats stay active at destination in guided, rtl, smartrtl 2017-12-08 08:48:05 +09:00
Randy Mackay 57067fb8bc Rover: add WP_SPEED and RTL_SPEED
This separates the default/maximum speed used in Auto, Guided, RTL and SmartRTL from the CRUISE_SPEED which is used as the base for the speed-to-throttle controller (along with CRUISE_THROTTLE)
2017-12-07 07:29:10 +09:00
Randy Mackay c6689fd2e1 Rover: rename calc_nav_steer to calc_steering_from_lateral_acceleration
rename calc_lateral_acceleration to calc_steering_to_waypoint
calc_steering_to_waypoint internally calls calc_steering_from_lateral_acceleration
non-functional change
2017-11-28 11:46:21 +09:00
Randy Mackay 23028a659b Rover: slew throttle in all modes 2017-11-27 14:31:20 +09:00
Daniel Widmann bc7cf97b4e Rover: don't use GPS speed to detect reversing
instead pass reverse to attitude controller based on desired speed
2017-11-08 14:37:59 +09:00
Randy Mackay 95c5ada3e9 Rover: modes use stop_vehicle to stop gently
modes slow to a stop instead of immediately setting motors to zero
vehicle centers steering when stopping
2017-08-15 20:47:19 +09:00
Randy Mackay d99108f3bc Rover: use AR_AttitudeControl for throttle control
also direct throttle nudge replaced with speed nudge
calc_speed_max estimates vehicle's top speed based on cruise-speed and
cruise-throttle
steering mode now provides total target speed instead of using speed plug
throttle nudge
motor limits provided to attitude control to stop i-term buildup
uses negative desired speed instead of reversed flag
reporting to GCS uses new throttle controller
braking is simply enabled and allows a reverse motor output regardless of vehicle
speed
2017-08-15 20:47:19 +09:00
Randy Mackay 9097269d6d Rover: use AR_AttitudeControl for steering control 2017-08-15 20:47:19 +09:00
khancyr 848df551ac Rover: formatting and comment fixes to mode class 2017-08-05 17:02:52 +09:00
Randy Mackay 4f5e82f406 Rover: mode fixes for reversing 2017-08-05 11:20:58 +09:00
Randy Mackay 946a0a8e54 Rover: guided mode refactoring
add set-desired methods
add get_distance_to_destination
fix to one interation with no update to motors
slow down for turns
2017-08-05 11:20:58 +09:00
khancyr ded1bad6c3 Rover: remove duplicate calls from update_navigation()
calc_lateral_acceleration() and calc_nav_steer() aren't need here
2017-07-21 10:13:20 +09:00
khancyr b9644c4ec7 Rover: disable slew limit by default on mode 2017-07-21 10:13:20 +09:00
Peter Barker 2a9b1017b6 Rover: add control modes class 2017-07-21 10:13:20 +09:00