UE4Duino - Arduino to UE4 plugin Release!

Hi - I have a wheeled vehicle and I’m controlling its steering using an external Arduino Pot Sensor (like a volume knob).
Currently if the ‘pot’ is turned anticlockwise it outputs -1 and if its turned clockwise it outputs +1.
These sensor values are being passed onto the “InputAxis MoveRight” node and replicating what the A/D keys would do for keyboard control.
While this method works it doesn’t make for a very smooth game play. The issue being slight latency. If I remove the delay in my arduino sketch Unreal can’t seem to cope with the rapid data signal.
I was wondering if:

  1. anyone has done something similar whereby the actual ‘degrees of rotation’ value of the arduino pot has been mapped onto the steering column of a wheeled vehicle ?
  2. Has anyone managed to get around the latency/delay issue for faster realtime feedback - what is the optimum delay setting in a sketch and if it can be set to ‘0’ how do you tweak unreal to cope with the data?
    Any advice would be great.

@joeycampbell As I mentioned I use a wheeled vehicle to simulate ATV riding. To map your arduino bit values onto a true angle value I use a two step process. I first have a calibration segment where I run until a button is pressed. During this segment the maximum bit values of the potentiometer are (highest and lowest) by turning the handle bars to their maximums. Those values are used in the map() function which takes a maximum and minimum bit value, the maximum and minimum angle value (or otherwise, I map mine onto a -1000 to 1000 scale and divide that value by 1000 because map only returns integers and that seems to be the activation range of unreal engine steering), and the current bit value, which returns it on mapped onto the new scale. I send the new value to unreal engine as my steering value. I use a 5 millisecond delay and it is reasonable.

As far as mounting your potentiometer I would suggest making a rigid frame to mount to the head tube of the frame and fix your potentiometer to the top of the headset. The rigid frame will allow the potentiometer to change values as the headset rotates.

@joeycampbell

As I mentioned, I use a wheeled vehicle to simulate ATV riding. To map your arduino bit values onto a true angle value I use a two step process. I first have a calibration segment where I run until a button is pressed. During this segment the maximum bit values of the potentiometer are (highest and lowest) by turning the handle bars to their maximums. Those values are used in the map() function which takes a maximum and minimum bit value, the maximum and minimum angle value (or otherwise, I map mine onto a -1000 to 1000 scale and divide that value by 1000 because map only returns integers and that seems to be the activation range of unreal engine steering), and the current bit value, which returns it on mapped onto the new scale. I send the new value to unreal engine as my steering value. I use a 5 millisecond delay and it is reasonable.

As far as mounting your potentiometer I would suggest making a rigid frame to mount to the head tube of the frame and fix your potentiometer to the top of the headset. The rigid frame will allow the potentiometer to change values as the headset rotates.

Hi thanks for the info. I understand the mapping and calibration…can you let me know what node or steering parameter you applied this arduino value to on your vehicle?

I used the Set Steering Input Node. It receives a target which is the “vehicle movement” of your bicycle and a float for the steering value.

Thanks - I’m finding it a bit unstable taking in two values simulateously so I have decided to control my wheel steering using a MakeyMakey instead. Thanks for all your help though.

How are you taking in your two variables? I bring in 5 at a time, so I’m interested in your instability you’re experiencing.

I’m updating the 4.10 to support 4.11

[MENTION=41593][/MENTION].
Great!! Do let us know the progress and are you working on a Win 10 system?

Hello guys,
I recompiled UE4Duino for 4.12Preview and it works.
So here is the short instruction how to do it by yourself:

  1. Create new project in UE4.12
  2. Add new C++ class (None->next)
  3. Save project
  4. Close it
  5. Create folder “Plugins” in the project folder and put here UE4Duino plugin
  6. Open again your project and UE will ask you to recomplile UE4Duino plugin - you should press YES.
  7. When recompilation will be done, you can close UE and copy UE4Duino from that project to other project. It will work.

I’m sure this method is useful with UE4.11.

Hope it will be helpful :slight_smile:

@Stupzow
Which Plugin version did you use?
Are you on a Win10 machine?

Yes, win 10

@sidhants
I used plugin version 4.10
No, I’m om 8.1, but I guess it will work on win 10

[MENTION=41593][/MENTION]
Great! looking forward.

@Stupzow
Cool. I will try it out on Win 10 end of this week.

@sidhants i’m a little out of time because of the school, maybe in a week i finish it

[MENTION=41593][/MENTION]
No problem. It will help. great effort.

Any we could get Android support?

Cant find the problem. Serial write is working perfect but serial read not working at all. read is not receiving any data.
I try with different engines 4.10, 4.11, its not working :frowning:

Windows 10 version works on 4.11 engine. Juhuuuuuuu SOLVED :slight_smile: