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.
This commit is contained in:
Julian Oes
2017-04-10 15:13:06 +02:00
committed by Beat Küng
parent 809fec8c05
commit caf69b290a
10 changed files with 193 additions and 180 deletions
+3 -3
View File
@@ -1,6 +1,6 @@
/****************************************************************************
*
* Copyright (c) 2016 PX4 Development Team. All rights reserved.
* Copyright (c) 2016-2017 PX4 Development Team. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -43,7 +43,7 @@
namespace vmount
{
int InputBase::update(unsigned int timeout_ms, ControlData **control_data)
int InputBase::update(unsigned int timeout_ms, ControlData **control_data, bool already_active)
{
if (!_initialized) {
int ret = initialize();
@@ -60,7 +60,7 @@ int InputBase::update(unsigned int timeout_ms, ControlData **control_data)
return 0;
}
return update_impl(timeout_ms, control_data);
return update_impl(timeout_ms, control_data, already_active);
}
void InputBase::control_data_set_lon_lat(double lon, double lat, float altitude, float roll_angle,