Pages

Monday 30 January 2012

File structure

In response to a comment asking for more detail on the csv file structure... ...here is some detail, my arm is not here right now so this is largely from memory and the notes I have and not tested:

Each line in the file should consists of seven values separated by commas.  The first six values should be 0, 1 or 2.  The last value is a floating point value (e.g. 0.3).

The first five values on each line indicate the direction that the shoulder, elbow, wrist, grip, rotation: 0 = no movement, 1=move in one direction, 2=move in the opposite direction.

The sixth value should turns the light on (1) or off (0).

The seventh value is the time in seconds that the motors should move at this combination of settings.

The file can be created in any text editor (e.g. notepad, leafpad etc.), or probably in MS Excel etc (by saving as CSV).

A file with the single line:

1, 1, 1, 0, 0, 0 0.5

Would move the shoulder, elbow & wrist motors of half a second with the light turned off.

Whilst this line:

0, 0, 0, 1, 1, 0, 0.75

Would move the grip and turn the light on for 0.75 seconds.

So the file:

1, 1, 1, 0, 0, 0, 0.5
2, 2, 2, 0, 0, 1, 0.5

Should move the shoulder, elbow & wrist motors of half a second with the light turned off, then move them back in the opposite direction for the same time - this time with the light on.

Whilst this moves the arm one motor at a time, flashes the light then moves all motors back at the same time:

1, 0, 0, 0, 0, 0, 0.6
0, 1, 0, 0, 0, 0, 0.6
0, 0, 1, 0, 0, 0, 0.6
0, 0, 0, 1, 0, 0, 0.6
0, 0, 0, 0, 1, 0, 0.6
0, 0, 0, 0, 0, 1, 1.0
0, 0, 0, 0, 0, 0, 0.5
0, 0, 0, 0, 0, 1, 1.5
0, 0, 0, 0, 0, 0, 0.25
0, 0, 0, 0, 0, 1, 0.65
0, 0, 0, 0, 0, 0, 0.33
2, 2, 2, 2, 2, 0, 0.6


I hope that helps any newcomers trying to set up files for the first time.  You should be able to copy and paste those examples into your own text editor.  You can call the file anything you want, and as you specify the extension you don't need to call it a .csv - but you may need to select the correct file format when saving.

No comments:

Post a Comment