15 Commits

Author SHA1 Message Date
Daniel Agar
883624d915 lib/geo: move from ecl 2021-07-15 10:38:24 -04: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
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
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
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
97fc1db768 vehicle_local_position: rename yaw -> heading and add reset logic
- vehicle_global_position yaw removed (redundant)
2020-08-10 11:42:03 +02:00
Julian Oes
5836edc586 vmount: first step to support absolute angles
The mavlink spec now supports absolute angles as well, see:
https://github.com/mavlink/mavlink/pull/944
2020-01-06 16:24:36 +01:00
Daniel Agar
faae5feecc vmount update orb usage 2019-11-30 15:52:53 -05:00
Julian Oes
a36a3d6c5c vmount: remove commented out code 2019-11-22 16:48:17 +01:00
Beat Küng
3198610f85 src/platforms: move all headers to platforms/common/include/px4_platform_common
and remove the px4_ prefix, except for px4_config.h.

command to update includes:
for k in app.h atomic.h cli.h console_buffer.h defines.h getopt.h i2c.h init.h log.h micro_hal.h module.h module_params.h param.h param_macros.h posix.h sem.h sem.hpp shmem.h shutdown.h tasks.h time.h workqueue.h; do for i in $(grep -rl 'include <px4_'$k src platforms boards); do sed -i 's/#include <px4_'$k'/#include <px4_platform_common\/'$k/ $i; done; done
for in $(grep -rl 'include <px4_config.h' src platforms boards); do sed -i 's/#include <px4_config.h/#include <px4_platform_common\/px4_config.h'/ $i; done

Transitional headers for submodules are added (px4_{defines,log,time}.h)
2019-10-30 11:48:47 +01:00
Matthias Grob
93ef70c43d vmount: add missing yaw wrap at the end of a ROI update 2019-02-25 11:03:04 -05:00
Matthias Grob
35409b4079 vmount: refactor ROI position update for readability 2019-02-25 11:03:04 -05:00
Beat Küng
ef54bff4ed vmount: avoid reading uninitialized value
matrix::Quatf() calls sinf(), which caused a valgrind warning
2019-01-17 09:39:30 +01:00
Daniel Agar
bbab66d974 move vmount to modules (it's not a driver) 2018-12-04 01:06:54 -05:00