Go to Post wood is the original carbon fibre! - dtengineering [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 24-01-2010, 14:37
Carmello Carmello is offline
Registered User
no team
 
Join Date: Jan 2010
Location: Connecticut
Posts: 5
Carmello is an unknown quantity at this point
Any ideas on simulating robot to prototype code

Hi
I'm teaching students to program our robot cRIO in Java. The robot isn't always available to write and test code so I'd like to have a simulator for the students. So far we are thinking of building a test bed with all the hardware but that could get expensive.

I searched for simulating a robot in the forums and found that the 'FRC Robot Modeling and Simulation Toolkit ' has been discontinued. I thought that was a great way to allow the programmers to develope and test code without requiring the hardware in case the robot is not ready or currently in use.

I'm sure there are a few ways to do this. I thought if the WPI java libs could disable the hardware that might allow me to purchase just a cRIO. Of course a client application that would accept commands from our java robot would be even better.

Does anything like this exist? Any ideas would be appreciated.
Thanks
  #2   Spotlight this post!  
Unread 24-01-2010, 15:56
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: Any ideas on simulating robot to prototype code

I don't know how well Java would adapt to this, but I have written simulators in LabVIEW capable of testing the higher-level code for a robot arm. I could set positions of a state machine from the virtually-running code, then have the drawing loop draw each segment of the arm to an XY graph.

In 2007, we had code on the robot that needed an array of sensor positions for a state machine. We had a simulator in VBA (Excel) to allow us to set the end height of the arm, then slide it in and out and get the sensor values.

In LabVIEW, you could write an abstraction layer to have all calls to the WPIlib handled in common places and save/write them to global variable files, then you could run the VI's that actually do the work run by themself and test the IO by manipulating the global variables on the Front Panel. In Java, it would be trickier. This really depends on what you want to simulate; if you want to test your PID code then you really really need the real robot. If you want to simulate some code that handles semi-automatic robot arms, then you could simulate it in LabVIEW and then swap out the drawing code with PID code.

You cant disable the hardware, but you can just not listen to the hardware. If you have just a cRio, you can just not connect the IO and write it as if it was the real hardware. Then your code could do stuff and output it to the Dashboard, and collect data from the Joysticks, but not act on it. If you are not using the kit chassis, you could assemble the kit chassis with transmissions and only need to buy a new cRio, Jaguars, and motors, leaving you with a simple skid-steer drivetrain to test things that don't depend on shifting or specific traction, like testing some parts of the camera code or such. Depending on how old your team is, you could use a past robot and put a cRio in it, to test code not dependent on the physical robot (camera code is the best example). You need to remember that even a duplicate robot will not be exactly like the competition robot, so make sure it is easy to change parameters like PID gains for when you have the real robot. You might even consider having a "New Robot" variable that switches from one set of gains to another, those from the practice robot and those from the competition robot.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
  #3   Spotlight this post!  
Unread 24-01-2010, 16:18
jmanela's Avatar
jmanela jmanela is offline
+1 is BIGGER than -1
AKA: Joshua Manela
FRC #2586 (Fondy Fire)
Team Role: College Student
 
Join Date: Aug 2008
Rookie Year: 2009
Location: Michigan
Posts: 314
jmanela is a splendid one to beholdjmanela is a splendid one to beholdjmanela is a splendid one to beholdjmanela is a splendid one to beholdjmanela is a splendid one to beholdjmanela is a splendid one to beholdjmanela is a splendid one to behold
Re: Any ideas on simulating robot to prototype code

If you want to just test out logic, you can write a quick GUI program (java applet or swing) with text boxes to enter data or some other value. For example, if you are writing a joystick scaler program, you would have a textbox to enter the simulated joystick value, then another box or label would show the output of your logic (the scaled joystick).

This is similar to writing LabView code and simulating it on the Front Panel.
__________________
||2009|| Entrepeneurship Award, QF - Traverse City | Rookie All Star, QF - Detroit | Highest Rookie Seed, Rookie All Star, QF - Michigan State Championship | Finalist - MARC ||2010|| Engineering Inspiration, Website Award, SF- Kettering | Judges Award, Website Award, SF - Detroit | Website Award, Winner, Michigan State Champ //Thank you 469 and 1918!! | Finalist - MARC ||2011|| Engineering Inspiration, Website - Kettering | Entrepreneurship, Website, Finalist - Waterford | Website - MSC
  #4   Spotlight this post!  
Unread 25-01-2010, 21:02
insplore insplore is offline
Registered User
no team
 
Join Date: Jan 2010
Location: Vancouver BC
Posts: 5
insplore is an unknown quantity at this point
Re: Any ideas on simulating robot to prototype code

Does the simulator have to use Java? If not, if you are testing out concepts, the insplore.com simulator might work for you.
  #5   Spotlight this post!  
Unread 27-01-2010, 18:23
Carmello Carmello is offline
Registered User
no team
 
Join Date: Jan 2010
Location: Connecticut
Posts: 5
Carmello is an unknown quantity at this point
Re: Any ideas on simulating robot to prototype code

We have built a testbed with another crio that will allow the programmers to develop and debug their code. I hope to have an led strip to verify the outputs go on as expected and a set of switches to verify they advance to the correct state.

Now I just have to figure out how to connect the hardware. I'm searching for that now, I hope I won't have to come back and ask you guys.

Thanks apalrd and the others.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Any Ideas? kcreager Technical Discussion 5 13-01-2010 09:17
Any ideas for an "art robot" ninratmny General Forum 11 11-11-2004 20:25
Any ideas for a robot name? Ryan M. Chit-Chat 20 10-02-2004 23:36
Any Ideas? Jonathanb Motors 3 16-04-2003 20:00
any ideas?!?!?!?!?!? Tyler Olds 3D Animation and Competition 0 26-11-2002 09:19


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

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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