13755 Commits

Author SHA1 Message Date
brad112358
d53fcb0bab
mavlink: use RADIO_STATUS to regulate parameter sending 2021-02-22 18:57:29 -05:00
Daniel Agar
7cc4aa6fe2 vtol_att_control: fix code style 2021-02-22 12:09:39 -05:00
Nicolas MARTIN
50ec809fdf SIH: add mag offset from parameters
An absolute value superior to 10000 block mag publication
2021-02-22 11:56:16 -05:00
Nicolas MARTIN
8f54dc402d SIH: add baro offset (or pressure change) from parameters
An absolute value superior to 10000 block barometer publication
2021-02-22 11:56:16 -05:00
Nicolas MARTIN
1df63cb6b1 SIH: add gps fix loss simulation from parameters
A new parameter allows to change the SIH number of gps satellites used
If it is below 4, fix is lost
2021-02-22 11:56:16 -05:00
Sander Smeets
a8a9832b59 Allow new modes for forward thrust 2021-02-22 11:18:49 -05:00
Lorenz Meier
1b8a3079e6 Update commander_params.c
Better documentation boolean settings, removed duplicate boolean.
2021-02-22 11:17:16 -05:00
Lorenz Meier
90f5d7338c Commander: Relax pre-arm check for EKF
The previous testing ratios could lead to extremely tight pre-arm acceptance.
2021-02-22 11:17:16 -05:00
Lorenz Meier
f12d368a64 Commander: Document arming check params 2021-02-22 11:17:16 -05:00
Lorenz Meier
87f98f096f Commander: Respect position circuit breaker
This ensures that commander respects the position check circuit breaker and allows arming without position.
2021-02-22 11:17:16 -05:00
David Jablonski
ed7a5314d8 rtl: head towards home location after descend 2021-02-22 16:37:08 +01:00
David Jablonski
aeccb621c5 rtl: added loiter radius for descending 2021-02-22 16:37:08 +01:00
Daniel Agar
30e8a14be3 logger: update SDLOG_PROFILE comment to reflect current default
- closes https://github.com/PX4/PX4-Autopilot/issues/16904
2021-02-22 08:45:10 +01:00
Daniel Agar
bbc721917c
mavlink: mission ignore takeoff pitch error
- this mission rejection was only added recently in https://github.com/PX4/PX4-Autopilot/pull/16792
 - causing QGC compatibility issues https://github.com/mavlink/qgroundcontrol/pull/9464
2021-02-21 16:40:38 -05:00
Silvan Fuhrer
0ea8104344
select single system-wide wind estimate message (current best)
- publish wind estimate only from EKF, and wind speeds from airspeed selector to new separate topic (airspeed_wind)
 - rename message wind_estimate to wind
 - publish wind from currently used ekf instance (ekf2selector)

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-02-20 13:15:01 -05:00
Daniel Agar
711a69854b uthash: move remaining utarray usage to parameters and delete unused
- this is to discourage further use until utarray can be dropped entirely
2021-02-20 11:28:22 +01:00
Daniel Agar
9ed959402e mavlink: store instances in array
- simplify mavlink header writes that go back through the mavlink module
 - add locking around mavlink command line usage (start, stop, status, etc)
2021-02-20 11:28:22 +01:00
Beat Küng
9d11d94e7e px4iofirmware: guard against parsing multiple RC protocols
It was for example possible that DSM got parsed, and in the next iteration
SBUS got parsed, leading to multiple PX4IO_P_STATUS_FLAGS_RC_ flags set.
input_rc::input_source was then incorrectly set to DSM.

Partially guarding was already done: if SBUS got parsed, DSM and others
were skipped.

The IO will still clear all PX4IO_P_STATUS_FLAGS_RC_* flags on RC loss.
2021-02-19 09:28:46 -05:00
Daniel Agar
5e188b3cd7 ekf2: populate local_position dist_bottom_sensor_bitfield 2021-02-18 10:37:02 -05:00
Daniel Agar
cff7a01d5e
ekf2: estimator_status log reset counts 2021-02-17 21:16:34 -05:00
Julian Oes
1493ebf350 mavlink: reset MAVLink version to auto-detect 2021-02-17 13:54:34 -05:00
Julian Oes
b812763a5a mavlink: no gimbal messages on constrained flash 2021-02-17 13:54:34 -05:00
Julian Oes
a2d419c91a vmount: use copyTo to copy quaternions 2021-02-17 13:54:34 -05:00
Julian Oes
f39216b9c3 vmount: use math functions instead of macros 2021-02-17 13:54:34 -05:00
Julian Oes
6672be040a mavlink: limit mavlink channels based on memory 2021-02-17 13:54:34 -05:00
Julian Oes
7633b119f7 gimbal: merge fixes 2021-02-17 13:54:34 -05:00
Julian Oes
3a2e4db309 vmount: mute gimbal manager ignoring messages 2021-02-17 13:54:34 -05:00
Julian Oes
db09a1386f vmount: fix regression around stabilize flags
We use the stabilize param to set the input. Like this the input flags
can be changed using the configure message later, and then eventually
used in the output.
2021-02-17 13:54:34 -05:00
Julian Oes
086c45d406 vmount: fix POI for gimbal v2
This includes several changes to fix POI when used with MAVLink gimbal
v2 input:
- Correctly set capability flag that POI is supported.
- Keep lat/lon and calculate attitude on each cycle, instead of only
  once on init.
- Always publish gimbal manager information, with or withoug gimbal v2
  device.
2021-02-17 13:54:34 -05:00
Julian Oes
b0d7d19bab vmount/mavlink: update gimbal information message
We should be using gimbal_manager_information and not
gimbal_device_information. Plus, this updates the fields and flags
according to the MAVLink changes.
2021-02-17 13:54:34 -05:00
Julian Oes
cb3ad39406 vmount: add comment about possible NAN values 2021-02-17 13:54:34 -05:00
Julian Oes
cd0509d2ef vmount: fix AUX gimbal output for v2 mavlink input
This should fix the case where AUX gimbals don't work anymore when
gimbal input is mavlink gimbal v2.

The fix is mostly to take care against NAN inputs.
2021-02-17 13:54:34 -05:00
Julian Oes
17dce18b32 mavlink: reduce GIMBAL_MANAGER_STATUS message rate
This was way too fast.
2021-02-17 13:54:34 -05:00
Julian Oes
6561b07caf vmount: support legacy gimbal v1 mission commands
This is a hotfix to restore gimbal functionality for SITL set-ups that
are set to MNT_MODE_IN 4 (gimbal protocol v2) but still need to accept
gimbal v1 commands that might be part of a mission, e.g. uploaded by
MAVSDK.
2021-02-17 13:54:34 -05:00
Julian Oes
6f56797f3d mavlink: hack to forward messages from gimbal
This is a hack to make sure the messages from the gimbal arrive at other
links (e.g. the ground station). It means that the gimbal does not get
flooded with all other messages that would get forwarded but messages
from the gimbal will still make it through.
2021-02-17 13:54:34 -05:00
Julian Oes
b8ad7092dc mavlink: use Mavlink 2 by default 2021-02-17 13:54:34 -05:00
Julian Oes
e6b1775bb6 vmount/navigator/mavlink: gimbal v2 changes
This is a collection of commits all having to do with changes in the
Mavlink gimbal v2 protocol as described in:
https://mavlink.io/en/services/gimbal_v2.html
2021-02-17 13:54:34 -05:00
Julian Oes
422bac4bfd mavlink: add gimbal mode to talk to gimbal device 2021-02-17 13:54:34 -05:00
Julian Oes
2a0ddf9f44 mavlink: enable 6 instead of 4 instance 2021-02-17 13:54:34 -05:00
Martina Rivizzigno
48b00ff678 Support for gimbal v2 protocol
- add command to request a message
- add gimbal attitude message

mavlink_receiver handle GIMBAL_MANAGER_SET_ATTITUDE

first implementation of new vmount input MavlinkGimbalV2
- setup class
- decode gimbal_manager_set_attitude in ControlData

add gimbal information message

add gimbal manager information and vehicle command ack

mavlink messages: add stream for GIMBAL_MANAGER_INFORMATION

mavlink_receiver: handle GIMBAL_DEVICE_INFORMATION

remove mavlink cmd handling from vmount input MavlinkGimbalV2

complete gimbal manager:
- send out fake gimbal_device_information for dummy gimbals
- complete ROI handling with nudging

small fixes

fix typos

cleanup
- gimbal device information
- flags lock
- check sanity of string

add support for CMD_DO_GIMBAL_MANAGER_ATTITUDE

stream GimbalDeviceAttitudeStatus for dummy gimbals
- add uROB gimbal_attitude_status
- fill status in vmount output_rc for dummy gimbals not able to send the
status themselves
- stream mavlink GimbalDeviceAttitudeStatus

better handle the request for gimbal infomation request

clean up

bring gimbal information back on vmount init

add new gimbal message to mavlink normal stream

fix publication of gimbal device information

rename gimbal_attitude_status to gimbal_device_attitude_status

stream gimbal_manager_status at 5Hz

mavlink: send information only on request

Sending the information message once on request should now work and we
don't need to keep publishing it.

mavlink: debug output for now

make sure to copy over control data

mavlink: add missing copyright header, pragma once

mavlink: address review comments

mavlink: handle stream not updated

Our answer does not just depend on whether the stream was found but
whether we actually were able to send out an update.

mavlink: remove outdated comment

vmount: add option for yaw stabilization only

The stabilize flag is used for gimbals which do not have an internal IMU
and need the autopilot's attitude in order to do stabilization. These
gimbals are probably quite rare by now but it makes sense to keep the
functionality given it can e.g. be used by simple servo gimbals for
sensors other than highres cameras.

The stabilize flag can also be re-used for gimbals which are capable of
stabilizing pitch and roll but not absolute yaw (e.g. locked to North).
For such gimbals we can now set the param MNT_DO_STAB to 2.

We still support configuring which axes are stabilized by the
MAVLink command DO_MOUNT_CONFIGURE, however, this is generally not
recommended anymore.

vmount: fix incorrect check for bit flag

mavlink_messages: remove debug message

Signed-off-by: Claudio Micheli <claudio@auterion.com>

use device id

remove debug print

gimbal attitude fix mistake

clang tidy fix

split:
- gimbal_attitude -> gimbal_device_set_attitude, gimbal_manager_set_attitude
- gimbal_information -> gimbal_device_informatio, gimbal_manager_information

add gimbal protocol messages to rtps msg ids

support set attitude for gimbal directly speaking mavlink

clean up gimbal urob messages

vmount: address a few small review comments

vmount: split output into v1 and v2 protocol

This way we can continue to support the MAVLink v1 protocol. Also, we
don't send the old vehicle commands when actually using the new v2
protocol.

vmount: config via ctor instead of duplicate param

vmount: use loop to poll all topics

Otherwise we might give up too soon and miss some data, or run too fast
based on commands that have nothing to do with the gimbal.

typhoon_h480: use gimbal v2 protocol, use yaw stab

Let's by default use the v2 protocol with typhoon_h480 and enable yaw
lock mode by stabilizing yaw.
2021-02-17 13:54:34 -05:00
Daniel Agar
ab0d0fd0be
uORB move to PX4 platform layer 2021-02-17 11:25:56 -05:00
Daniel Agar
a416731656 drivers/heater: add logging and minor improvements
- new heater_status logging message
 - run continously at low rate until configured sensor is found
 - fix px4io fd bugs (fd open/close/ioctl must be same thread)
2021-02-16 15:16:19 -05:00
Daniel Agar
5abf29d93c
commander: auto TAKEOFF to LOITER/MISSION minor fix to avoid failsafe confusion
- base on nav_state rather than main_state
2021-02-16 13:02:14 -05:00
Ramon Roche
15392f8e53 silent success and log failures
Co-authored-by: Nuno Marques <n.marques21@hotmail.com>
2021-02-15 20:28:19 +01:00
CAI Dongcai
2ad1cb24cc fix empty log file "micrortps_bridge.log" 2021-02-15 20:28:19 +01:00
Tim
540e4f9464
Uuv position control extension (#16688)
* Commit for the Integration of a position controller for the a Underwater vehicle.
This module is an extension of the uuv_att_control to control an Underwater vehicle to any position, given by the SET_POSITION_TARGET_LOCAL_NED which includes x y z yaw.
Since the position control is designed for a 6DOF Robot, the roll and pitch angle are controlled to be 0.
Additionally there is a stabilization control, which holds the robot at a defined depth, and not move in any direction.

In general the idea is to have this position module to control the position of the uuv. The position module reseives the desired position of the uuv and sends appropriate attitude setpoints to the uuv_attitude_control module.

Additionally the mixer file is adapted, to include the 6 different inputs(x y z roll pitch yaw).

* Commit for the Integration of a position controller for the a Underwater vehicle.
This module is an extension of the uuv_att_control to control an Underwater vehicle to any position, given by the SET_POSITION_TARGET_LOCAL_NED which includes x y z yaw.
Since the position control is designed for a 6DOF Robot, the roll and pitch angle are controlled to be 0.
Additionally there is a stabilization control, which holds the robot at a defined depth, and not move in any direction.

In general the idea is to have this position module to control the position of the uuv. The position module receives the desired position of the uuv and sends appropriate attitude setpoints to the uuv_attitude_control module.

Additionally the mixer file is adapted, to include the 6 different inputs(x y z roll pitch yaw).

Currently not solved/missing:
 - Problem with gazebo model(propeller moving chaotically).
 - Mixer correct gazebo vs real life (has to be tested in the future)
 - correct integration in uuv.apps (when choose which module)
 - very basic controller chosen (could be improved a lot in the future)

* Remove error caused by unused variables and a different build error

* added better description of the parameter. Additionally the group is changed.

* added better description of the parameter. Additionally the group is changed.
Fixed bug about parameter

* Added EOF to the files.

* Removed parameter for direct position control for safety reasons.

* small bugfix
2021-02-15 18:40:28 +01:00
Daniel Agar
0618f048f2
commander: use control mode flags and cleanup arm_disarm
- keep `vehicle_control_mode` last state in commander and use appropriate flags in place of various main_state and nav_state checks
 - consolidate scattered arming requirements in `arm_disarm()`
   - there were a number of different requirements from arming via RC vs Mavlink that don't make any sense
        - if geofence enabled require valid home before arming
        - throttle requirements for manual modes
 - remove unnecessary mavlink feedback that differs between arming interfaces (mavlink vs RC)
      - let the preflight/prearm checks respond directly in most cases 

Co-authored-by: Matthias Grob <maetugr@gmail.com>
2021-02-15 12:03:21 -05:00
Daniel Agar
40a452dcd2 ekf2: selector improve timeout handling and reporting
- relax estimator_status timeout unless attitude hasn't published recently
2021-02-14 21:08:56 -05:00
Lorenz Meier
4c5d2363d4 Rover control: Use roll sticks
It is more intuitive to use the roll stick as lateral control input given that drones defined this category, plus this is how consumer car / rover radio controls have been working already.
2021-02-14 11:17:28 +01:00
Lorenz Meier
2be482c5ae Sensors: New parameter for baro priority
This allows to give external barometers priority if they are present.
2021-02-14 11:17:28 +01:00