mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-18 03:52:11 +01:00
Ground/UAVControl: Throttle rate of messages when using GCS controller. Still
too high. git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1848 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
9165fb87b2
commit
aa50cf836b
@ -83,16 +83,29 @@ void GCSControlGadget::manualControlCommandUpdated(UAVObject * obj) {
|
||||
|
||||
void GCSControlGadget::sticksChangedLocally(double leftX, double leftY, double rightX, double rightY) {
|
||||
ManualControlCommand * obj = getManualControlCommand();
|
||||
obj->getField("Roll")->setDouble(rightX);
|
||||
obj->getField("Pitch")->setDouble(-leftY);
|
||||
obj->getField("Yaw")->setDouble(leftX);
|
||||
obj->getField("Throttle")->setDouble(rightY);
|
||||
obj->updated();
|
||||
double oldRoll = obj->getField("Roll")->getDouble();
|
||||
double oldPitch = obj->getField("Pitch")->getDouble();
|
||||
double oldYaw = obj->getField("Yaw")->getDouble();
|
||||
double oldThrottle = obj->getField("Throttle")->getDouble();
|
||||
|
||||
double newRoll = rightX;
|
||||
double newPitch = -leftY;
|
||||
double newYaw = leftX;
|
||||
double newThrottle = rightY;
|
||||
|
||||
if((newThrottle != oldThrottle) || (newPitch != oldPitch) || (newYaw != oldYaw) || (newRoll != oldRoll)) {
|
||||
obj->getField("Roll")->setDouble(newRoll);
|
||||
obj->getField("Pitch")->setDouble(newPitch);
|
||||
obj->getField("Yaw")->setDouble(newYaw);
|
||||
obj->getField("Throttle")->setDouble(newThrottle);
|
||||
obj->updated();
|
||||
}
|
||||
}
|
||||
|
||||
void GCSControlGadget::gamepads(quint8 count)
|
||||
{
|
||||
sdlGamepad.setGamepad(0);
|
||||
sdlGamepad.setTickRate(40);
|
||||
}
|
||||
|
||||
void GCSControlGadget::buttonState(ButtonNumber number, bool pressed)
|
||||
|
Loading…
x
Reference in New Issue
Block a user