|
|
|
@ -222,6 +222,10 @@ void Joystick::_activeVehicleChanged(Vehicle* activeVehicle)
@@ -222,6 +222,10 @@ void Joystick::_activeVehicleChanged(Vehicle* activeVehicle)
|
|
|
|
|
setTXMode(mode); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
void Joystick::_flightModesChanged() |
|
|
|
|
{ |
|
|
|
|
_buildActionList(_activeVehicle); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void Joystick::_vehicleCountChanged(int count) |
|
|
|
|
{ |
|
|
|
@ -717,6 +721,7 @@ void Joystick::startPolling(Vehicle* vehicle)
@@ -717,6 +721,7 @@ void Joystick::startPolling(Vehicle* vehicle)
|
|
|
|
|
disconnect(this, &Joystick::gimbalControlValue, _activeVehicle, &Vehicle::gimbalControlValue); |
|
|
|
|
disconnect(this, &Joystick::emergencyStop, _activeVehicle, &Vehicle::emergencyStop); |
|
|
|
|
disconnect(this, &Joystick::gripperAction, _activeVehicle, &Vehicle::setGripperAction); |
|
|
|
|
disconnect(_activeVehicle, &Vehicle::flightModesChanged, this, &Joystick::_flightModesChanged); |
|
|
|
|
} |
|
|
|
|
// Always set up the new vehicle
|
|
|
|
|
_activeVehicle = vehicle; |
|
|
|
@ -740,6 +745,7 @@ void Joystick::startPolling(Vehicle* vehicle)
@@ -740,6 +745,7 @@ void Joystick::startPolling(Vehicle* vehicle)
|
|
|
|
|
connect(this, &Joystick::gimbalControlValue, _activeVehicle, &Vehicle::gimbalControlValue); |
|
|
|
|
connect(this, &Joystick::emergencyStop, _activeVehicle, &Vehicle::emergencyStop); |
|
|
|
|
connect(this, &Joystick::gripperAction, _activeVehicle, &Vehicle::setGripperAction); |
|
|
|
|
connect(_activeVehicle, &Vehicle::flightModesChanged, this, &Joystick::_flightModesChanged); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (!isRunning()) { |
|
|
|
@ -760,6 +766,7 @@ void Joystick::stopPolling(void)
@@ -760,6 +766,7 @@ void Joystick::stopPolling(void)
|
|
|
|
|
disconnect(this, &Joystick::centerGimbal, _activeVehicle, &Vehicle::centerGimbal); |
|
|
|
|
disconnect(this, &Joystick::gimbalControlValue, _activeVehicle, &Vehicle::gimbalControlValue); |
|
|
|
|
disconnect(this, &Joystick::gripperAction, _activeVehicle, &Vehicle::setGripperAction); |
|
|
|
|
disconnect(_activeVehicle, &Vehicle::flightModesChanged, this, &Joystick::_flightModesChanged); |
|
|
|
|
} |
|
|
|
|
_exitThread = true; |
|
|
|
|
} |
|
|
|
|