|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: Simulate robot drive
How do you make your code work? both the default and final picture are blank.
|
|
#2
|
||||
|
||||
|
Re: Simulate robot drive
I made this when I was first learning LabVIEW, so I apologize that it's not very intuitive.
First set your initial position. (300,300) is a good place to start. Start the VI with "continuous run". Now click "initialize". This will clear the image, and reset the robot position. Click it again to commence the movement. To move, use the "speeds" sliders. It appears that the left and right are mixed up, so you may want to fix this. One thing to note: At this point in time, I would not consider this an example of impeccable code. It works, and it's readable, but it's not intuitive, and the way it plots points on the picture is inefficient. If it would help to have a better example, I will fix this up for you. |
|
#3
|
|||
|
|||
|
Re: Simulate robot drive
If you could fix up the code I think that would help tremendously. Also would you mind describing what is happening in the relative movement vi? I really appreciate this, I feel like I'm really good at programming hardware in intuitive ways but terrible at creating virtual simulations of what it should do.
But yes I understand sin, cosine, and tangent. But not well enough to fully figure out the swerve drive quite yet (That can wait for awhile since we don't even have a swerve drive built yet). |
|
#4
|
||||
|
||||
|
Re: Simulate robot drive
Okay, here's an improved version.
I made an some options for it to be controlled via Joysticks, but I haven't implemented that yet. (The appropriate VIs are in the HID pallette. Make sure you're targeted to your computer; Human Interface Device drivers aren't available for the cRIO, and so that palette will be hidden.) EDIT: It's still not impeccably documented, but it should be clear what each section does, if not why it works. Last edited by kamocat : 01-04-2011 at 02:34. |
|
#5
|
|||
|
|||
|
Re: Simulate robot drive
Well I now feel stupid w/e seems like a very useful tool. Thanks for all of the hard work that was put into this hopefully I'll get to using it.
|
|
#6
|
||||
|
||||
|
Re: Simulate robot drive
I'm not sure how much it will help with autonomous; anything it can show can be calculated using a drawing.
However, it might be useful as a little code debugger. Run "autonomous independent" while targeted to your computer, and it runs through this? That might be fun. Remember: a simulation is only as realistic as you make it. Don't forget to "check your work" and make sure it describes what is actually happening with the robot on the field. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|