Advertisement

Joystick for flight simulator.

Started by February 02, 2018 06:09 AM
2 comments, last by Nik02 6 years, 9 months ago

Hi guys,

I am working in a flight simulator project where I am integrating HOTAS-Warthog throttle and joystick to fly the aircraft. I am using SDL_joystick to read joystick axis data and passing that axis to a flight model library to fly the aircraft. The flight model library provide physically accurate flight behaviour.

My joystick axis values are ranging from ~ negative 32000 to 32000. I am normalizing tat value from -1 to 1 before passing that to my flight model.However, I am having some issue where my aircraft showing some unexpected behaviour. When I try to roll my air craft, the aircraft change its pitch slightly. What is happening is, while moving my joystick through x axis to roll the aircraft, the joystick giving some small value in its y axis too.

Which resulting some minor pitch changes in my aircraft. I have a dead zone configure but this is not helping and I guess it is only normal that from usability point of view, an analog joystick may give out some small value in different axis even though I am not intending to move to that axis.

My question is, is there any way to make the flight experience better by removing unexpected value from the other axis that I am not moving? The challenges here is the code should be able to filter any minor y axis value if I am moving the joystick to x axis and vice versa.

Or is there any better way to achieve my goal? Any thought?

 

Thanks!

M      

  

 

Have you tested to make sure the dead zone you configured is actually being applied? I seem to recall SDL_joystick not necessarily respecting externally-configured dead zones.

If you are implementing the dead zone in your own code, you might experiment with implementing the dead zone for each axis separately. It'll cause a slight snapping behaviour to cardinal directions, but it might work all right.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

Advertisement

In airplanes without flight plane auto correction, rolling actually causes the pitch of the airplane to decrease because the lift is not applied in the neutral (upwards) direction. :) This is often compensated by adjusting engine throttle and using tail elevator+rudder flaps and/or other control surfaces so as to keep the altitude unchanged.

In this case, though, it's probably the joystick's fault.

Niko Suni

This topic is closed to new replies.

Advertisement