LabView Drive Simmulatior Practice

So I have been trying to get a feel for LabView and I did this

HTML
www.shsfirst.org/files/drivesim/
and the VIs
www.shsfirst.org/files/drivesim/vi/

I would like any feedback I can get.

Thank you.

Very nice!

One key thing that does not show up is the false case for the case statement on the left. You will notice a delay when you rotate, this is proportional to the amount of turn requested, there is a constant that changes the amplification of it. This is to simulate the time that it takes a robot to turn in place.

My hope is next week to add some NXT to this and see how it works out, who knows this might end up working as part of a nice OI robot feedback.

Excellent comphappy, here is my own attempt at something similar - I haven’t tried your sim yet, but judging from the programming techniques used you are way more familiar with Labview than I.

The VIs were developed with Labview 8.6, but I saved them as 8.5 so everyone can use them.

draw_robot_on_field.vi (32.4 KB)
rotate_polygon.vi (16.2 KB)






draw_robot_on_field.vi (32.4 KB)
rotate_polygon.vi (16.2 KB)



That’s really cool.

You could even use a joystick as an input (connectivity -> input device)

This is interesting, I am working on something like this as well. My code works for turning inplace only, but the next version will have only forward, reverse turning as well as being on an NXT.

I do like the idea of hooking a joystick up to it, but I do not have a USB one so that will have to wait.

One thing that might help all of you is that there is a polar to cartesian converter in Labview, found at Mathematics > Numeric > Complex (or Programming > Numeric > Complex).
Unfortunately, it is true this is not included in the NXT toolkit.

Why not create your own polar to cartesian VI?

It’s not exactly difficult

x = rcos(theta)
y = r
sin(theta)

boom, there you go!

It’s a little trickier going from cartesian to polar, however, since you need to account for arccos and arcsin having having “+/-” output possibilities. But it’s not too difficult.

Russ

In that case, you can go to

Mathematics > Elementary & Special Functions > Trigonometric Functions

and select the atan2 VI.
Personally, I would just do this processing on the computer itself, not the NXT. It’s not like transmitting each move will be much more data than transmitting the current location. However, I would (if it doesn’t already) treat it like packets, and number each one make sure that data isn’t lost. I suppose the location data could be sent back to the NXT in autonomous mode, to help with navigation.
For determining how far the 'bot has turned, the angle turned (in degrees or radians) is directly proportional the the “distance left drive has travelled” subtracted from the “distance right drive has travelled”.

If you use your trig identities and make things proportional to create your functions it is possible to avoid almost all the additional trig.