Go to Post FRC competitions are fun, people. If you honestly need a video game system to keep you interested, you're ignoring a tremendous experience. - Mr. Pockets [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rating: Thread Rating: 5 votes, 5.00 average. Display Modes
  #31   Spotlight this post!  
Unread 24-01-2012, 00:09
otherguy's Avatar
otherguy otherguy is offline
sparkE
AKA: James
FRC #2168 (The Aluminum Falcons)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: CT
Posts: 434
otherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to behold
Re: CANJaguar

Quote:
Originally Posted by Kodiak View Post
Yup, he is right, you having that is like pretty much trying to make two jaguars of the same variable name, and in any programming language you can't simply do that.
Just to be clear, you CAN do that in java, you're just not going to be referring to the same variable throughout the program. If every variable name had to be completely unique, you wouldn't be able to use the same variable names as any of the variables used in the classes you import. For any large scale program it would get difficult pretty quickly to keep track of what variable names were used where.

His code will compile and run as it was, it's just not going to do what he expected it to.
__________________
http://team2168.org
Reply With Quote
  #32   Spotlight this post!  
Unread 24-01-2012, 09:55
Kodiak's Avatar
Kodiak Kodiak is offline
Registered User
AKA: Boston
FRC #3325 (Chaos Order)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2010
Location: Texas
Posts: 13
Kodiak is an unknown quantity at this point
Re: CANJaguar

Quote:
Originally Posted by otherguy View Post
Just to be clear, you CAN do that in java, you're just not going to be referring to the same variable throughout the program. If every variable name had to be completely unique, you wouldn't be able to use the same variable names as any of the variables used in the classes you import. For any large scale program it would get difficult pretty quickly to keep track of what variable names were used where.

His code will compile and run as it was, it's just not going to do what he expected it to.
True, I did not clarify correctly, I have a problem of doing that, my bad, haha
Reply With Quote
  #33   Spotlight this post!  
Unread 25-01-2012, 14:39
emusteve's Avatar
emusteve emusteve is offline
Registered User
AKA: Steve Martin
#0470 (Alpha Omega)
 
Join Date: Jan 2004
Location: Ypsilanti
Posts: 66
emusteve is just really niceemusteve is just really niceemusteve is just really niceemusteve is just really nice
Re: CANJaguar

Could someone kindly tell me where you found documentation on using CAN under Java? I've searched in the "Getting Started with JAVA", "WPI Robotics Library User’s Guide", and "WPI Library Cookbook" publications, but have somehow missed it if it is in there. Went back to First Forge, but couldn't locate any additional documentation that seemed like it would point me in the right direction.

If anyone knows of an example project, that would be appreciated as well.

Thanks,
Steve
Reply With Quote
  #34   Spotlight this post!  
Unread 25-01-2012, 18:36
nickpeq nickpeq is offline
Turing-complete
FRC #1255 (Blarglefish)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Baytown, TX
Posts: 60
nickpeq is an unknown quantity at this point
Re: CANJaguar

Quote:
Originally Posted by emusteve View Post
Could someone kindly tell me where you found documentation on using CAN under Java? I've searched in the "Getting Started with JAVA", "WPI Robotics Library User’s Guide", and "WPI Library Cookbook" publications, but have somehow missed it if it is in there. Went back to First Forge, but couldn't locate any additional documentation that seemed like it would point me in the right direction.

If anyone knows of an example project, that would be appreciated as well.

Thanks,
Steve
This is the most I've ever been able to find: https://decibel.ni.com/content/docs/DOC-14865
Reply With Quote
  #35   Spotlight this post!  
Unread 25-01-2012, 20:39
Kodiak's Avatar
Kodiak Kodiak is offline
Registered User
AKA: Boston
FRC #3325 (Chaos Order)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2010
Location: Texas
Posts: 13
Kodiak is an unknown quantity at this point
Re: CANJaguar

Quote:
Originally Posted by emusteve View Post
Could someone kindly tell me where you found documentation on using CAN under Java? I've searched in the "Getting Started with JAVA", "WPI Robotics Library User’s Guide", and "WPI Library Cookbook" publications, but have somehow missed it if it is in there. Went back to First Forge, but couldn't locate any additional documentation that seemed like it would point me in the right direction.

If anyone knows of an example project, that would be appreciated as well.

Thanks,
Steve
http://www.wbrobotics.com/javadoc/in...e-summary.html

That should also help some what.
Reply With Quote
  #36   Spotlight this post!  
Unread 25-01-2012, 21:31
emusteve's Avatar
emusteve emusteve is offline
Registered User
AKA: Steve Martin
#0470 (Alpha Omega)
 
Join Date: Jan 2004
Location: Ypsilanti
Posts: 66
emusteve is just really niceemusteve is just really niceemusteve is just really niceemusteve is just really nice
Re: CANJaguar

Thanks guys, I downloaded the NI doc and will look at that tonight.

I had found the wrobotics site via Google, but as I'm new to Java, it is still a bit cryptic to my eyes. I'm wondering where they found that reference. I do wish it gave some examples. Looks like it originated at WPI, but scouring FIRST Forge turned up nada. Thanks to them for putting it up.

I'll keep watching this thread to see what success you have. Share ours as well (assuming we achieve some.)

Thanks again,
Steve
Reply With Quote
  #37   Spotlight this post!  
Unread 25-01-2012, 22:55
otherguy's Avatar
otherguy otherguy is offline
sparkE
AKA: James
FRC #2168 (The Aluminum Falcons)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: CT
Posts: 434
otherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to behold
Re: CANJaguar

the info posted on the wrobotics site is called a JavaDoc, and it's a standard form of documentation that can be generated from JAva code automatically (as long as it'a commented properly). The JAvadocs for WPILib is distributed with the plugin package that you installed.

You can access these files locally on your machine by clicking the first logo in the bar at the top of NetBeans (Assuming that's what you're using), it should be the first link on the page that loads.

Check out some helpful guides on my teams site on:
Getting started with Java: Lecture 1, Lecture 2
JavaDocs: Intro/Setup, Use
CAN Jaguars

You're going to want to focus on the CANJaguar class.

Use is as simple as placing the following lines in the right places in your code.
Code:
import edu.wpi.first.wpilibj.CANJaguar;
CANJaguar leftMotor = new CanJaguar(12); //where 12 is the CAN ID assigned to the motor controller
leftMotor.set(x.x);    //where x.x is a value between -1.0 and 1.0 (or your joystick axis...)
Note the default mode of operation is %VBus, which is comparable to PWM, read up on our site and the NI docs to learn about the other modes of operation if that's your goal.
__________________
http://team2168.org
Reply With Quote
Reply


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


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

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