Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   LabView Drive Simmulatior Practice (http://www.chiefdelphi.com/forums/showthread.php?t=69677)

comphappy 21-10-2008 19:18

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.

Jon236 22-10-2008 00:08

Re: LabView Drive Simmulatior Practice
 
Very nice!

comphappy 22-10-2008 02:36

Re: LabView Drive Simmulatior Practice
 
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.

mluckham 23-10-2008 15:07

Re: LabView Drive Simmulatior Practice
 
5 Attachment(s)
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.

Joe Ross 23-10-2008 15:32

Re: LabView Drive Simmulatior Practice
 
That's really cool.

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

comphappy 24-10-2008 00:10

Re: LabView Drive Simmulatior Practice
 
Quote:

Originally Posted by mluckham (Post 771740)
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.

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.

kamocat 24-10-2008 01:48

Re: LabView Drive Simmulatior Practice
 
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.

Michael Hill 24-10-2008 09:52

Re: LabView Drive Simmulatior Practice
 
Why not create your own polar to cartesian VI?

It's not exactly difficult

x = r*cos(theta)
y = r*sin(theta)

boom, there you go!

Russ Beavis 24-10-2008 09:56

Re: LabView Drive Simmulatior Practice
 
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

kamocat 24-10-2008 20:48

Re: LabView Drive Simmulatior Practice
 
In that case, you can go to
Code:

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".

comphappy 25-10-2008 21:43

Re: LabView Drive Simmulatior Practice
 
If you use your trig identities and make things proportional to create your functions it is possible to avoid almost all the additional trig.


All times are GMT -5. The time now is 08:00.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi