Browse Source

Fixed performance problems in simulation

QGC4.4
pixhawk 15 years ago
parent
commit
460aef7a6d
  1. 2
      src/comm/MAVLinkSimulationLink.cc
  2. 4
      src/input/JoystickInput.cc

2
src/comm/MAVLinkSimulationLink.cc

@ -116,7 +116,7 @@ void MAVLinkSimulationLink::run()
} }
last = MG::TIME::getGroundTimeNow(); last = MG::TIME::getGroundTimeNow();
} }
msleep((rate / 20)); MG::SLEEP::msleep(2);
} }
} }

4
src/input/JoystickInput.cc

@ -104,7 +104,7 @@ void JoystickInput::init()
// Wait for joysticks if none is connected // Wait for joysticks if none is connected
while (numJoysticks == 0) while (numJoysticks == 0)
{ {
msleep(200); MG::SLEEP::msleep(200);
// INITIALIZE SDL Joystick support // INITIALIZE SDL Joystick support
if (SDL_InitSubSystem(SDL_INIT_JOYSTICK | SDL_INIT_NOPARACHUTE) < 0) if (SDL_InitSubSystem(SDL_INIT_JOYSTICK | SDL_INIT_NOPARACHUTE) < 0)
{ {
@ -276,7 +276,7 @@ void JoystickInput::run()
} }
// Sleep, update rate of joystick is approx. 50 Hz (1000 ms / 50 = 20 ms) // Sleep, update rate of joystick is approx. 50 Hz (1000 ms / 50 = 20 ms)
msleep(20); MG::SLEEP::msleep(20);
} }

Loading…
Cancel
Save