![]() |
How to make a "Custom VI" in Java?
Hello all,
In the past, our team has used LABView to program our robots. This year, we have switched over to Java. In LV, I could make custom vi's to do, for example, ramping. I have a small understanding of the concepts needed to do this in java, but it is very, very hazy, so if anyone could point me to a tutorial or other documentation on how to do this, I would much appreciate it. Thanks, Zaque |
Re: How to make a "Custom VI" in Java?
Not a tutorial, but a "custom VI" in Java would essentially be a method/function. Further, you can spread your methods across several classes to group them (such as a 'shooter' class, or a 'vision targeting' class).
Hope this points you in a helpful direction (too close to bed to find a good tutorial for you). |
Re: How to make a "Custom VI" in Java?
You can take a look at the WPI site:
http://wpilib.screenstepslive.com/s/3120/m/7885 Another resource is the samples that are installed with NetBeans. In NetBeans, go to: File -> New Project -> Samples -> FRC Java There are three basic "styles" of programming a robot in Java: BasicRobot, IterativeRobot, and CommandBased. I will let you read about the differences elsewhere, but I thought you should know that there are three different paradigms. Finally, if you do a search on ChiefDelphi, you will find other teams that link to tutorials on their sites. Good luck! |
Re: How to make a "Custom VI" in Java?
Here's a rate limiter we had in our code from last year.
Code:
/**Code:
newLeftSpeed = rateLimit(newLeftSpeed, currentLeftSpeed, 0.15, 0.15);Also note, that the code uses the term speed to refer to the commanded value sent out to the motor controller (between 1.0 and -1.0). This is really just the voltage the motor controller will be commanded to output and doesn't have any direct correlation to the speed of travel of the robot. This code doesn't, and isn't intended to, make use of any sensor values in the rate limiter. If you can post what type of java project you're working in (Simple Robot, Iterative Robot, or Command Based) we could help suggest how to integrate the code a little better. |
Re: How to make a "Custom VI" in Java?
Thanks for all the responses! Since this is our first year with java, we figured we should start with SimpleRobot and learn iterative or command-based during the off-season.
|
| All times are GMT -5. The time now is 02:30. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi