How to control the ah1s in unreal engine #659
Replies: 22 comments 47 replies
-
This topic is neither a bug report nor a feature request, it will be addressed in the Discussion tab. Regarding your question, you'll need to hack the UE plugin to interface it with an helicopter (see issue #625 for a similar issue). |
Beta Was this translation helpful? Give feedback.
-
I personally plan to add support for helicopters in the UE plugin. But it will be a few weeks-months before I get around to it, including multiplayer, etc. Mostly likely someone will add support soon. |
Beta Was this translation helpful? Give feedback.
-
In UE5,I set JSBSimMovement Aircraft model is ah1s and play the level.I try to control the helicopter take off and land, but press the keyboard 4, the throttle is full, it is still on the ground, press the forward keyboard 8, the nose is tilted forward on the ground and spins in place. I want to know how it controls the helicopter take-off and landing and normal flight forward and backward. |
Beta Was this translation helpful? Give feedback.
-
What keyboard input have you connected to the helicopter's collective? |
Beta Was this translation helpful? Give feedback.
-
And what is the key mapping to the collective control of the helicopter? |
Beta Was this translation helpful? Give feedback.
-
If you're planning on flying a helicopter you need to understand what the collective control is. Then in terms of the UE-JSBSim plug-in you need to figure out what the keyboard mapping if any there is between the keyboard and the collective control. jsbsim/aircraft/ah1s/Systems/rotor_control.xml Lines 68 to 72 in 5fa0a2f |
Beta Was this translation helpful? Give feedback.
-
Yep, but anyone can add support for it in the meantime.
Have you looked at my comments about understanding the helicopter controls in general and then making sure you have a mapping from keyboard to the relevant inputs in the helicopter model? Also take a look through the AH1S files to familiarize yourself on how the model works in terms of the required inputs etc. I did post one relevant snippet above. Also have you taken a look at the AH1S sample script that is included in the repo which includes script commands to start the helicopter and have it take-off etc.? https://github.com/JSBSim-Team/jsbsim/blob/master/scripts/ah1s_flight_test.xml |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
What do you mean? The other option as opposed to adding a new method to |
Beta Was this translation helpful? Give feedback.
-
I only meant I don't know which is the preferred or ideal method, ie should I do a pull request adding helicopter controls to jsbsim. But this Property Manager sounds interesting, I will have to see if I can find an example of use case that will fit UE plugin. |
Beta Was this translation helpful? Give feedback.
-
Take a look at - #627 (comment) for some example Property Manager code. |
Beta Was this translation helpful? Give feedback.
-
Thank you sir! And lol there is a lot of properties. I'll probably make a command/menu UI out of this. |
Beta Was this translation helpful? Give feedback.
-
Sure, but only a handful that are pilot inputs. If you were writing a generic flight simulator then you would typically present some UI to allow the user to map keyboard, joystick axes, joystick buttons etc. to pilot inputs. |
Beta Was this translation helpful? Give feedback.
-
I found the AH1S is so difficult to fly, I turn the governor to 0.1 and increase the collective, and when the RPM is up to 7000, the helicopter lifts up, and to left a bit. When the helicopter is in the sky, it is so difficult to keep it in balance |
Beta Was this translation helpful? Give feedback.
-
Welcome to helicopter flying 😉 If you want to make it simpler to fly then add a AFCS (Automated Flight Control System) to the model, e.g. you could implement one that maps pilot input on the yaw pedals to a yaw rate, so if there is no pilot input on the yaw pedals, e.g. the pilot only moves the collective then the AFCS will automatically output yaw pedal movements to keep the yaw rate = 0. |
Beta Was this translation helpful? Give feedback.
-
I wasn't aware of https://github.com/JSBSim-Team/jsbsim/blob/master/systems/afcs.xml But looking at https://github.com/JSBSim-Team/jsbsim/blob/master/aircraft/ah1s/ah1s.xml it looks like it's already included by the AH1S model. So I suggest you read through - https://github.com/JSBSim-Team/jsbsim/blob/master/aircraft/ah1s/Systems/rotor_control.xml and Or as the comment in
|
Beta Was this translation helpful? Give feedback.
-
I'm curious, could I download this AH1s for unreal and have a look at it ? I'm thinking I could steer you in the right direction. |
Beta Was this translation helpful? Give feedback.
-
Do you mean @hongzhou91's Unreal blueprint mapping user keyboard etc. inputs to the AH1S's control inputs? The AH1S model is the one that's included in the JSBSim repo. |
Beta Was this translation helpful? Give feedback.
-
"The AH1S model is the one that's included in the JSBSim repo." Where would I find this then ? |
Beta Was this translation helpful? Give feedback.
-
I'm not aware of any pre-built JSBSim-Unreal binaries with the AH1S model included and working. So your best bet would be to clone the repo, follow the instructions to build the Unreal components, test that you can run and fly the default airliner model. Then look into switching to the AH1S model by either modifying the Unreal blueprint etc. or ask @hongzhou91 for the changes they made. |
Beta Was this translation helpful? Give feedback.
-
@bomber64 As for everyone else that reads and comments here. As for why I never mentioned it is flyable: I'm not here to hand hold someone into making a helicopter video game using JSBSim. The Unreal plugin/project is a reference and a starting point. It's not really meant for beginners to programming or game development. Anyways, as for using the AFCS I couldn't find any real world data on how the AH1S's stability system works or how a pilot would generally make use of it. I mean the stability forces/values to be used, etc. I looked through the real world AH1S manual and it's a general overview of the stability controls. Obviously a pilot can do whatever he wants while in flight and completely turn it off. For example you can turn on all the AFCS related settings and take off vertically with just some pilot corrections. But then you need to disable or turn down the value of certain AFCS settings in order to full control again in flight. I didn't want to show someone how to fly the AH1S with AFCS only to be asked MORE questions. If people can't figure out certain things on their own, well, I'm not going to do everything for them. I apologize for my ranting. So now that I had my quick rant, here are the generic controls enabling and disabling a few of the AFCS commands which will allow stable flight with the AH1S. As seen in the picture, I use a simple button/key press to enable and and disable the following AFCS commands: There are other ap and afcs related commands and settings for even greater control/stability, if you just spend some time researching. Also these commands can have for example values of between 0 and 1. So you can have full strength stabilization at 1, at the expense of less pilot control. Or you can have a weak stabilization using 0.2 or 0.5 and allow for more pilot control. Generally speaking you keep them enabled at full strength for take off, landing, and general forward flight. And disable it to make extreme maneuvers. I'll also now mention the AH1S was basically the first(second) helicopter created for JSBSim, developed by one guy over 10 years ago. He laid the ground work but not much has happened since and there's little to no documentation. If you read flightgear forums, JSBSim helicopters are a controversial topic. There are a few newer JSBSim helicopter models for flightgear if you search, that could be edited to work with Unreal/JSBSim and would likely be easier to fly than the AH1S. There is a R22 even on github if you search. |
Beta Was this translation helpful? Give feedback.
-
Another link http://www.thejabberwocky.net/viewforum.php?f=15&sid=a79c6865d24d4702239b35f891877cce |
Beta Was this translation helpful? Give feedback.
-
I was set the aircraft model ah1s,but it cant control it. It need set some new keymapping?
Beta Was this translation helpful? Give feedback.
All reactions