Excavator strings programming.

Good morning to everybody.
I'm a student of master degree in psychology at the university of Padua (Italy). Im running some researches in neuropsychology using two modified joysticks to control an excavator on a virtual reality simulator.
The two (now renamed) cloches requires string programming in arduino. The strings requested are ti make the excavator moving in the simulator. Going deeper movements required are:
1- take both cloches together straight to get it going straight
2- take both cloches together back to get it going back
3- take back right cloche and straight the left one to go at right
4- take back left cloche and straight the right one to at left
5- all the commands requires to be progressive
the progressive necessity command is caused by the required to give more force or less when necessary.
Can anybody gives me some help on this?
Thank you very much.
Good afternoon.
Best regards.
Nicolo'

Maybe try the Italian section of the forum as the translation of your post to English is not a good one.

Or explain what you mean by a "cloche" and by "string".

Do you mean the sort of string that you use to tie parcels (and which might be part of a model excavator in place of hydraulics) or strings of characters in a computer program or what?

..R

So. I've developed a new interface which is made by two joysticks. These two are the substitute of the two excavator cloches.
I have to take my interface link it to arduino (as input) in order to have an input from my interface and an output which goes into to the usb port of my macbook pro.
The output will be used to control my excavator in a virtual environment with a specific software (videogame).
Have I been clear enough?
Thank you.
Good afternoon.
Nicolò

for strings I mean all the commands will be used by arduino to turn the interface input (go straight, go back, turn left, turn right, take up the carriage, take down the carriage, open the blade, close the blade) into electrical output for computer and software in virtual reality.
Is enought?
Thank you and good afternoon.
Nicolò

What is a "cloche"?

jremington:
What is a "cloche"?

He's meaning the handle of the joystick (I think)

In essence - if I am understanding everything correctly - he's needing code to allow two joysticks (left and right) control the left and right motors of a virtual excavator (ie - differentially steered tank-like vehicle); the speed of the tracks/motors needs to be proportional to the joystick(s) position - so closer to the center equals little movement, while at the extremes means fast movement. Both stick forward - go forward; both stick backwards, go in reverse. One stick forward, the other backward - spin/turn/etc.

Really - the code to do this is dead simple; if you can get one joystick to control a single motor, you just duplicate that and off you go:

  1. Read joystick input (analogRead() - value 0 - 1023)

  2. Map that value to positive/neg values (most likely) - so map() to -512 to +511, for instance.

  3. Send those values out the serial port, and the code on the other end (VR API interface or whatnot) will need to interpret them and apply them to the transformation matrix of the excavator object and/or camera (all will depend on how the software works, scene graph, etc - but that goes beyond this discussion)

  4. Do that for each joystick - then send a serial stream data packet indicating the values

Actually - you could eliminate step 2 - just send the values of the joysticks directly to the API, and do the mapping of values on the PC end.

TBH - I am very surprised that you couldn't just hook up the pots to a standard USB controller, plug that in, then config the VR system/library to make use of the USB HID device(s) as needed...no Arduino is really needed for this project - it just makes a solution more difficult, not less, IMHO.

Good afternoon cr0sh. Yes I mean that. the cloche is here intended as the handle of the joystick. And as you said I need the code to let joysticks to control the left and right motors in a virtual reality excavator. And rightly as the two joysticks come close to the center the virtual excavator decreases the speed viceversa with increasing of distance from the center.
The code for the turn (right and left) needs to be done in order to permits the user to (take close right joystick and contemporary move forward the left one) turn right and viceversa to do the left turn.
To go straight with excavator (is a Bobcat T180) the joysticks requests to take both forward and viceversa to go back.
Upon each joystick I've installed a playstation stick. The principle is to let user controlling the blade (opening, closure) with right stick -upon the right joystick-. The second stick is set upon the left joystick to control the carriage (up an down movements).
The two sticks has to go just straight and back. Thats it.
You said right could be dead simple but It's my first experience with arduino and I've used Makey Makey till now. The makey makey problem is that it's just 0-1 input command and 0-1 command which clearly produce problem when user starts to use it.
Further theres also another thing. To let the sticks functioning you need a progressive command which makey doesn't have forcing you to buy another type of command.

The last and most important one is the simulator requires to press contemporary the mouse and the specific button to control blade or the carriage. As easily understandable this created an incredible frustration in the user when he has to control these movements.
My first solution has been to put in front of a joystick a button he has to press contemporary at the blade (or carriage) button. Is a real problem cause this create worst frustration.
My desire is to let the software understand that code (take close right joystick+take forward the left one) means right turn and viceversa for left turn.
For upper sticks the code needs to be (take forward right stick=open the blade), (take backward right stick=close the blade). For left upper stick (take forward left stick=take up the carriage), (take backward left stick=take down the carriage).
I hope this could be clear enought. I understand this might me not so easy to understand but unfortunately I can't tell here everything I'm doing on this product.
Thank you anyway cr0sh I understand that this can't be always clear but, you know where you're working on something you can't say everything, everything. Cr0sh if somenthing might be not clear tell it me.
So thank you all anyway.
Nicolo'

This simple Joystick Demo may help to get you started in the right direction.

...R

The software (in virtual reality) requires user to contemporary click left mouse and press a specific letter on the keyboard to control the blade or carriage, the real mess is this. You can't ask an user to divide attention on two sources and contemporary to control two different input.
My request is let the software understand that - single stick control (forward, backward)= press left mouse click+press specific letter-.
The same for the turn movements - take close right joystick+take forward laft joystick (right turn)= press letters (w+d), -take close left joystick+ take forward right joystick (left turn)= press letters (w+s).

OK, here's a commercial product:

.
The "cloches" or "bells" are the control levers.

It becomes pretty clear to start with that this is a non-Arduino project as it makes immeasurably more sense not to re-invent the wheel but to use a commercial (gaming - not that one) two-handled joystick assembly.

Thank you Paul. I see now what you posted about Hardline but as I read in many scientific papers many of these hardware are not tested with psychological tests which might evaluate also biological aspects...
If I would have bought the hard-line simulator I would't have had the possibility of understand what goes well what goes wrong on that type of product.
In fact none simulator nor excavators started from a biological and psychological inspection. Regrettably I can't write more about this. In any case this is the reason why I've begin these projects Paul.
I hope you understand this.
For you Robin you've been of help, as soon as I finish my exams I will restart work on this. In any case thanks a lot.
Nicolo'

I think you need to write down in a list the sequence of input moves of the joystick and the outputs that you want. For example

full forward = xxa
half forward = xxb
centre = xxc

etc.

Then you can plan more easily how the Arduino can translate one into the other.

You may get some other ideas from planning and implementing a program

...R

Good evening.
So thank (especially to you robin and cr0sh). At the end of the exams I'll work on it. I was wondering : Will arduino substitute the keyboard as makey makey did? I mean makey makey is projected to be the substitute of the keyboard so that output might be recognised by the software as a keyboard input. Does the arduino board do as makey makey the keyboard substitute or will its output not recognised by the software?
Thank you.
Nicolo'

I'm a student of master degree in psychology at the university of Padua (Italy). Im running some researches in neuropsychology using two modified joysticks to control an excavator on a virtual reality simulator.

What is the function of this simulator? Is it to duplicate the hydraulic controls of an excavator, or is it some type of eye/hand coordination test simulator? Probably a significant difference between the two.

ConradJoseph:
The software (in virtual reality) requires user to contemporary click left mouse and press a specific letter on the keyboard to control the blade or carriage, the real mess is this. You can't ask an user to divide attention on two sources and contemporary to control two different input.
My request is let the software understand that - single stick control (forward, backward)= press left mouse click+press specific letter-.
The same for the turn movements - take close right joystick+take forward laft joystick (right turn)= press letters (w+d), -take close left joystick+ take forward right joystick (left turn)= press letters (w+s).

If I'm understanding you correctly then this sounds like a job for the Leonardo as it can look like a HID keyboard and mouse to the computer it's plugged into so could read digital joysticks and convert there movement into key sequences that the PC software expects.

ConradJoseph:
Will arduino substitute the keyboard as makey makey did?

I know nothing about makey makey.
If you can explain what it is / what it does I can probably answer your question.

And, seeing @Riva's post, you should be aware that the Leonardo is now obsolete. I think the Micro is the nearest equivalent.

...R

Good morning ZoomCat.
The target of the simulator usage is to experiment the consequencies of divide the commands direction (straight, back, turn right, turn left) from the separated control ( for blade and carriage) into executive functions divided attention and substained attention neuropsychological functions.
For Riva: Yes I think it should be a thing like Leonardo which can be the sobstitute of a keyboard input. Pratically digital joysticks movements have to be converted in key sequencies which software (farming simulator) pc installed aspects to give input to the virtual excavator.
For Robin here you are a link to its official page where you can see everything you need.

Substantially is an electronic board which has 4 arrows commands, a left and an a right click input from a side and on other you have the pin or gate (as you define that) for 12 inputs. Pratically its a keyboard substitute usefull for protypes. It has the string programming part at the terminal but its as simplified as limited.
What type of board do you (robin) think its better to use?
Thank you all.
Nicolo'

ConradJoseph:
What type of board do you (robin) think its better to use?

I confess I am rather lost.

I thought you wanted to connect a pair of joysticks to an Arduino and have it send commands to something.

Now there seems to be a keyboard involved?
Is that instead of, or as well as the joysticks?

There are several keypads available that work with Arduinos. Or you make your own.

Any or all of these combinations are perfectly feasible.

What you have so far not told us is how the simulator would be connected to the Arduino and what sort of communication it requires. That could be a show-stopper.

...R