Commit Graph

492 Commits

Author SHA1 Message Date
Martina df19610e69 mc_pos_control: add execution of position waypoint coming from the
obstacle avoidance
2018-07-12 16:36:11 -04:00
Martina 5d6771753d mc_pos_control: add execution of velocity waypoint coming from the
obstacle avoidance module
2018-07-12 16:36:11 -04:00
Martina f511d3a399 mc_pos_control: add method to constrain velocity setpoint 2018-07-12 16:36:11 -04:00
Martina 14444af38c mc_pos_control: subscribe to trajectory_waypoint message 2018-07-12 16:36:11 -04:00
Hamish Willee 7402d8223b Fix up references to pixhawk.org 2018-07-02 13:11:15 +02:00
Daniel Agar d0bde9ab2a replace geo _wrap_pi with matrix::wrap_pi 2018-06-12 09:00:52 +02:00
Paul Riseborough c84d35e3d7 mc_pos_control: rework height limiter to stay in velocity mode 2018-06-09 13:38:04 +02:00
Paul Riseborough d26da5fa3b mc_pos_control: Improve maximum height limiter
Implements a better method of determining when to switch from velocity to altitude control to keep height limit from being exceeded.
This method removes the overshoot and transients in height caused by the switching of the previous algorithm.
2018-06-09 13:38:04 +02:00
Paul Riseborough f0a1cd197e mc_pos_control: formatting fixes 2018-06-09 13:38:04 +02:00
Paul Riseborough b77845a3c0 mc_pos_control: Fix bug in calculation of altitude limit
The correction for stopping distance applied to the maximum altitude limiter uses the vertical velocity estimate and gives the same offset for both positive (down) and negative (up) velocity.
This calculation has been corrected and simplified and variable names changes to make the functionality clearer.
2018-06-09 13:38:04 +02:00
Mohammed Kabir c1169eb38b mc_pos_control : update to use new navigation limits architechture 2018-06-09 13:38:04 +02:00
Mohammed Kabir b3c5e53333 Unify optical flow height limiting 2018-06-09 13:38:04 +02:00
Paul Riseborough 0dc2377c2f mc_pos_control: format fixes 2018-06-09 13:38:04 +02:00
Paul Riseborough 2c325414f9 mc_pos_control: limit maximum height when reliant on optical flow data 2018-06-09 13:38:04 +02:00
Paul Riseborough 9028592c5f mc_pos_control: control height above ground when reliant on optical flow 2018-06-09 13:38:04 +02:00
Beat Küng 13ab5ed0d0 px4_main_t: fix method declaration throughout the code base
px4_main_t is defined as:
typedef int (*px4_main_t)(int argc, char *argv[]);
which matches with the definition in NuttX, given to task_create
2018-05-09 07:59:46 +02:00
Beat Küng 90513e719e ASSERT: remove some inappropriate asserts
Since assertions lead to crashes, we need better failure handling. In all
the cases in this patch, the assert is not required.

All the ones with the task id should be replaced with the module base
class.

Ah yes, and this reduces flash space, since the ASSERT macro will expand to
a printf that contains the source file name.
2018-04-11 07:47:06 +02:00
Beat Küng 0eaa6222a2 flight tasks: refactor BlockParam -> Param and handle param updates 2018-04-11 07:47:06 +02:00
Beat Küng 2e620cf1d4 mc_pos_control: refactor BlockParam -> Param 2018-04-11 07:47:06 +02:00
Matthias Grob 2405baa2c9 FlightTasks: fix manual mode takeoff
With the new position control architercture manual mode and
potition mode run through the same logic and as a result
it had a throttle thershold for smooth takeoff also in
manual mode. This is fixed by by ignoring the threshold for
any mode which doesn't control the climb rate.
2018-04-05 07:30:12 +02:00
Dennis Mannhart e15240d3ad FlightTask: only allow for position and alitude control without smoothing.
This commit is only done to enable incremental testing of Flighttask.
2018-04-05 07:30:12 +02:00
Matthias Grob dc60bc8766 mc_pos_control: enable flight tasks
instantiate flight tasks and the refactored position controller class
only use the new functionality if a temporary parameter is set for testing
2018-04-05 07:30:12 +02:00
Matthias Grob 0dcad42f57 mc_pos_control: refactor, indent control block
individual commit for the indentation because otherwise
the diff gets unreadable. this indentation is made because
afterwards the entire legacy position control functionality
is in an else case.
2018-04-05 07:30:12 +02:00
Matthias Grob 5ee136fe10 mc_pos_control: refactor, move landed thrust reduction into function
and make it use matrix library for flight task compatibility

# Conflicts:
#	src/modules/mc_pos_control/mc_pos_control_main.cpp
2018-04-05 07:30:12 +02:00
Matthias Grob fabf214bca mc_pos_control: refactor, move smooth takeoff velocity into a function
# Conflicts:
#	src/modules/mc_pos_control/mc_pos_control_main.cpp
2018-04-05 07:30:12 +02:00
Daniel Agar 29b3950747 move geo and geo_lookup to PX4/ecl 2018-03-26 23:16:55 -04:00
Daniel Agar d2712dcb05 mc_pos_control move to matrix lib (#9141) 2018-03-23 12:53:49 -04:00
Daniel Agar ac7242987c delete unused tailsitter_recovery library (#9103) 2018-03-21 14:09:36 -04:00
Matthias Grob ff25c7f48a ensure attitude setpoint initialization before arming
- On initialization _v_att_sp got filled with zeros
  leaving invalid quaternions
- While not armed mc_pos_control did not publish any
  attitude setpoint which makes no sense
- The attitude control just uses the data in _v_att_sp
  if it was (ever) updated or not
2018-03-15 17:16:14 +01:00
Beat Küng 4b64bfdd95 mc_pos_control: disable roll/pitch modification in manual for multicopters
This causes severe oscillations in aggressive maneuvers with high tilt
angles. It's an issue on VTOL's too, but the modification is specifically
for VTOL's and VTOL's typically do not fly with such high tilt angles
(>50 deg).
See also: https://github.com/PX4/Firmware/issues/7949
2018-02-12 10:53:54 +01:00
Matthias Grob 5ad03d7ef2 mc_pos_control: comment typo in flow sensor altitude 2018-02-02 00:38:01 -05:00
Paul Riseborough eed8b00857 mc_pos_control: Release estimator speed limit only when speed demand is significant
This prevents unexpected increases in stick sensitivity when stick is moved after periods of inactivity.
2018-01-29 22:30:34 +01:00
Paul Riseborough f8693b49c2 mc_pos_control: Fix compile error after rebase 2018-01-29 22:30:34 +01:00
Paul Riseborough 642a4a5fc7 mc_pos_control: respect estimator max speed and min height limits 2018-01-29 22:30:34 +01:00
Nicolas de Palezieux d9221bb8d2 mc_pos_control : add support for precision landing 2018-01-15 10:27:23 +01:00
Matthias Grob 931482941c mc_pos_control: use global _dt member from the control block architecture 2018-01-13 13:08:47 +01:00
Huang 60eb1c2262 mc_pos_control: delete the unused variable 2018-01-09 10:03:44 +01:00
Paul Riseborough 3c667bb4f5 mc_pos_control: format fixes 2017-12-12 12:14:24 +00:00
Paul Riseborough deaa83bba0 mc_pos_control: Use vertical position derivative when in velocity control mode
Stops vertical velocity bias errors preventing the vehicle from landing.
Use of the vertical derivative is blended in so that for zero vertical velocity set point, the  local_position.vz is used and when the magnitude of the vertical velocity setpoint exceeds the landing speed, the  local_position.z_deriv is used.
2017-12-12 12:14:24 +00:00
Dennis Mannhart 4f8f0d8645 mc_pos_control: set triplets to NAN if not in auto mode 2017-12-07 20:27:11 +00:00
Paul Riseborough a81c49014f mc_pos_control: reset height reference when global position available
This enables the reference height to be reset when global vertical position becomes available in-flight.
2017-12-07 08:20:16 +00:00
Martina a61974709b mc_pos_control_main: wrap yaw attitude setpoint for offboard mode 2017-11-24 09:10:31 +01:00
Matthias Grob 26171df9fc mc_pos_control: save previous velocity setpoint after constraining, fix smooth takeoff to be still excluded from slewrate 2017-11-15 10:38:57 +01:00
Daniel Agar 4416c4ddb3 navigator move parameters out of MissionBlock
- MissionBlock is an interface with > 10 implementations
2017-10-26 22:43:53 +02:00
ChristophTobler 8e457b6037 reset setpoint to current position
avoid abrupt position changes as the delta can be quite big depending on deadreckoning/imu
2017-10-26 21:36:36 +02:00
Dennis Mannhart 8a0a8e20e1 mc_pos_control: use correct altitude as limit
fadfdasf
2017-10-10 10:28:07 +02:00
Dennis Mannhart f9b8afc006 Navigator: Use maximum flight altitude to limit missions
This change limits all mission items to the maximum flight altitude. The mission will still be executed and flown,
but the vehicle will never exceed the mission altitude. This ensures the vehicle can always reach the mission
items. Wether or not the entire mission should be rejected if it falls outside of the fenced area is enforced
in the mission feasibility checker function.
2017-10-10 10:28:07 +02:00
Dennis Mannhart 44a71d90f5 mc_pos_control: takeoff threshold to 0.65 2017-10-09 19:05:15 +02:00
Julian Oes 7229ec2a37 Move throttle check from land detector to posctrl
This commit is an attempt to fix a race condition happening on takeoff
between the land detector and the multicopter position controller.

Previously, an auto-takeoff leads to the following events:

1. A takeoff setpoint is given.
2. The thrust setpoint spikes because we don't enter smooth takeoff yet.
3. The land detector detects a takeoff because of the high thrust.
4. The position controller sees the landed state transition and
   initiates the smooth takeoff. Thrust goes back down.
5. Depending on control gains the takeoff is successful or fails
   if the smoothing takes too long which causes thrust to be too low, so
   the land detector detects land again.

The two obvious problems with this are:
- The intermittent spike.
- The failed takeoff because of the smoothing leads to a delay..

With this change, the logic for a takeoff detection is moved from the
land detector to the position controller.

The events are now:

1. A takeoff setpoint is given.
2. The position controller detects the takeoff setpoint and initiates
   the smooth takeoff.
3. As thrust ramps up, the land detector detects the take off.

In the same way, we now detect the intent to takeoff in manual,
altitude, control, position control in the position controller instead
of in the land detector.
2017-10-09 19:05:15 +02:00
Dennis Mannhart 0d7d6e59f5 mc_pos_control: description fix 2017-10-09 10:20:29 +02:00