Commit Graph

36 Commits

Author SHA1 Message Date
Daniel Agar 9ce83f2208 fix all sign-compare warnings 2018-07-01 09:36:55 +00:00
Beat Küng 48edaa7ef6 vmount: remove output rate-limiting
It causes missed input changes.
This reverts 73d23742ea.
2018-01-21 15:41:30 +01:00
Beat Küng 5e826eaa27 Revert "vmount: fix new input getting lost in throttling"
This reverts commit b7404ad6c1.
2018-01-21 15:41:30 +01:00
Julian Oes b7404ad6c1 vmount: fix new input getting lost in throttling
This fixes the case where a new gimbal input gets lost in the output
throttling.

This is required because an input is potentially set only once and
then not computed again. In the failure case, control_data is set
to nullptr in subsequent calls and therefore not used for the output
calculation ever.
2018-01-18 11:09:17 +01:00
Daniel Agar 14fefca85e vmount delete InputTest on error
- fixes CID 139488
2017-10-31 08:12:12 +01:00
Matthew Dailey bcb8852c99 Use fabsf instead of fabs for floats 2017-10-29 12:57:10 +01:00
Matthew Dailey e95410882b Fix type of MNT_OB_LOCK_MODE and MNT_OB_NORM_MODE parameters
Fixes issue #8178
2017-10-29 12:57:10 +01:00
Matthew Edwards 335c319b2e vmount: Use MNT_DO_STAB parameter for defaults in InputMavlinkCmdMount as well. 2017-10-25 11:30:31 +02:00
Matthew Edwards fdf4eb0bd6 vmount: Store offset in radians and calculated scale factor in OutputConfig instead of raw parameters. 2017-10-25 11:30:31 +02:00
Matthew Edwards 2f40bc3a78 vmount: Add parameters for servo range and offset and whether to stabilize (#8120).
Adds MNT_DO_STAB for whether to stabilize by default.
Adds MNT_RANGE_{PITCH,ROLL,YAW} for the output range of each output channel in AUX mode (instead of hardcoded 360 degrees).
Adds MNT_OFF_{PITCH,ROLL,YAW} for adjusting the zero point of each output channel.
2017-10-25 11:30:31 +02:00
Daniel Agar f282f50cff vmount run at default priority 2017-08-23 08:06:20 +02:00
Nicolas de Palezieux 55a2930cdb vmount: reduce stack size to 1900 as recommended by @bkueng (maximum used memory observed: 1552) 2017-08-11 14:37:48 +02:00
Nicolas de Palezieux 281ee5e5af vmount: increase stack size 2017-08-11 14:37:48 +02:00
Beat Küng 4eb0ffc554 vmount: update control_data if already_active is true
control_data needs to be able to be set to nullptr in case if the input
is already active. Otherwise the output will think there's always new
requests and reset it's state.
2017-08-11 14:37:48 +02:00
Beat Küng 73d23742ea vmount: rate-limit the update of the outputs
This avoids a busy-loop if the input is listening for vehicle commands and
the output publishes vehicle commands.
2017-08-11 14:37:48 +02:00
Beat Küng fd05c09447 vmount: fix param types, use int32_t 2017-08-11 14:37:48 +02:00
Beat Küng 47073e9c32 vmount: add module documentation 2017-07-14 11:57:11 +02:00
Beat Küng f42a626527 vmount: fix null-pointer access if invalid output mode was selected
In case of an invalid output mode, thread_data.output_obj was null.
2017-04-24 16:49:26 +02:00
Julian Oes 349a468f81 vmount: add to startup script, disable by default
vmount is now added to the startup script, however, it will only start
if the param MNT_MODE_IN is set to anything but -1.
2017-04-19 16:59:48 +02:00
Beat Küng c20ff1737c vmount: poll only on active input
To reduce latency of the output update when mode is set to auto.
2017-04-19 16:59:48 +02:00
Beat Küng 9ed21afd59 vmount: simplify initialization 2017-04-19 16:59:48 +02:00
Beat Küng 021b808f6c vmount: fix null-pointer access by iterating only over the used objects 2017-04-19 16:59:48 +02:00
Julian Oes f4b1623550 vmount: wrong pointer was passed to update 2017-04-19 16:59:48 +02:00
Julian Oes 87d5b41b84 vmount: fixed wrong index 2017-04-19 16:59:48 +02:00
Julian Oes ec36bdcd10 vmount: always initialize
MNT_MODE_IN 0 now means to automatically check all inputs.
2017-04-19 16:59:48 +02:00
Julian Oes caf69b290a vmount: refactor to auto-select between all inputs
It is not convenient having to change a parameter to change a gimbal
from RC input to mavlink input mode or back. This refactor changes the
behaviour to use whatever is available, RC or mavlink commands.

Once a mavlink command is followed, control can be taken back using RC,
however, this requires a clear stick change.
2017-04-19 16:59:48 +02:00
Daniel Agar 6631e72d6f clang-tidy modernize-redundant-void-arg 2017-02-01 22:15:50 -05:00
Daniel Agar e927f3e040 clang-tidy modernize-use-nullptr 2017-02-01 22:15:50 -05:00
Daniel Agar f0cde91220 astyle src/drivers/vmount 2017-01-29 01:18:32 +01:00
Lorenz Meier 1857a16e90 vmount: Header cleanup, do not build param file 2016-12-27 21:00:51 +01:00
Julian Oes 18d69698a0 vmount: publish mount_status
We need feedback in mavlink about the attitude of the gimbal. Therefore
the gimbal output angles are published in vmount.
2016-11-09 10:23:34 +01:00
Beat Küng 44520522ac vmount: make sure the test command works, even if MNT_MODE_IN is 0 2016-09-06 11:39:22 +02:00
Beat Küng 41913c4a80 vmount: fix print status output, adjust stack size, improve error handling 2016-09-06 11:33:18 +02:00
Beat Küng 0a95c447b0 vmount: add 'vmount test' command to set a specific angle 2016-09-06 11:33:18 +02:00
Beat Küng 94dbf358bd vmount: refactor architecture & use C++
This splits vmount into inputs and outputs modules with a small API in
between. It allows for greater flexibility, as any input method can be
combined with any output method. At the same time it is easy to add a new
input or output module.
2016-09-06 11:33:18 +02:00
Leon faebdeedcf vmount: add mount and ROI implementation
MavLink spec implementation

implemented vehicle_roi topic

rename old gimbal to rc_gimbal

little changes

corrected RC Gimbal group

Starting ROI implementation in commander

implementation done, needs to be tested

uhm..

add todo

Change to float32 for x,y and z

remove mission topic again, not needed

change roi coordinates to lat, lon and alt

adjust to float64

starting mount implementation

correcting small mistakes, compiles now

add todos

further progress

implementing parameters

adjust default parameters

started implementation of mavlink

fix typo

change to lat, lon and alt

fix typo :D

change to double (to represent float64)

add global_position_

add mount topic

commander mount implementation done

cleanup

almost finished

little fix

codestyle fixes

leave pitch at 0 degrees

added pitch calculation

codestyle changes

Undo vehicle_mount, react to updated parameters, parsing of CMD_DO_MOUNT_* in mount.cpp

start implementing mode override

forgot a semikolon.

add debug

Finish implementation of mount override and manual control.

fix codestyle

correct cleanup

rename to vmount

works now

fix rebase error

fix polling

refactoring and custom airframe for gimbal

couple changes

remove warnx

almost done

finally

What is going on?

change back to actuator_controls_2

working

bump parameter version number and some clarification

fix submodules
2016-09-06 11:33:18 +02:00