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:
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 ?
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.
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?
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.
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