Go to Post Tell the truth - that's really a small barbecue grill on that robot isn't it. - Tom Line [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 02-05-2010, 22:50
ozrien's Avatar
ozrien ozrien is offline
Omar Zrien
AKA: Omar
no team
Team Role: Mentor
 
Join Date: Sep 2006
Rookie Year: 2003
Location: Sterling Heights, MI
Posts: 531
ozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond repute
2CAN C# Example

I have posted a Visual Studio 2005 C# example that can be used to control Jaguars using only a 2CAN. The app sockets to the 2CAN and sends voltage throttles over UDP. The 2CAN then in turn updates the Jaguars on the bus. The throttles are read from an attached USB Gamepad or Joystick. This is basically the example that was demoed at the AndyMark booth at Atlanta.

The entire solution (with release built exe) can be downloaded by clicking the "C# Application Example (Updated 5/2/2010)" link at...
http://www.crosstheroadelectronics.com/2CAN.htm

For those of you interested in creating your own apps I recommend looking at 2CANComm.cs as it has the c# and C style definition of the data sent to the 2CAN. A formal communication spec is in the works. Hopefully this will suffice in the meantime.

Be sure to use the non-FIRST Jaguar firmware. I have been using Jaguar version 5450 and 2CAN version 1.6. Also be sure to read through the ReadMe.txt file as it contains important information for compiling/debugging the C# app.
  #2   Spotlight this post!  
Unread 09-05-2010, 00:36
drakesword drakesword is offline
Registered User
AKA: Bryant
FRC #0346 (Robohawks)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: USA
Posts: 200
drakesword is on a distinguished road
Re: 2CAN C# Example

I have build a java command line program that does the same thing but without direct-x, joysticks, or a GUI. Source will be released soon!
  #3   Spotlight this post!  
Unread 09-05-2010, 17:53
Robototes2412's Avatar
Robototes2412 Robototes2412 is offline
1 * 4 != 14
FRC #2412 (Robototes)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2007
Location: Bellevue
Posts: 312
Robototes2412 is on a distinguished road
Re: 2CAN C# Example

you can control can with something like an arduino, right?
  #4   Spotlight this post!  
Unread 09-05-2010, 19:45
drakesword drakesword is offline
Registered User
AKA: Bryant
FRC #0346 (Robohawks)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: USA
Posts: 200
drakesword is on a distinguished road
Re: 2CAN C# Example

As long as you can send serial data then I do not see why not. You have to remember though, the Jags are looking for a packet and if none is received within a 100ms time period they trip the watchdog which disables them. There is a pdf that describes the packet structure on the manufacturers website.

OTOH I would recommend using a 2CAN instead because it handles just about all of the conversions for you!
  #5   Spotlight this post!  
Unread 10-05-2010, 10:51
Robototes2412's Avatar
Robototes2412 Robototes2412 is offline
1 * 4 != 14
FRC #2412 (Robototes)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2007
Location: Bellevue
Posts: 312
Robototes2412 is on a distinguished road
Re: 2CAN C# Example

can has link?
  #6   Spotlight this post!  
Unread 10-05-2010, 11:11
Robototes2412's Avatar
Robototes2412 Robototes2412 is offline
1 * 4 != 14
FRC #2412 (Robototes)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2007
Location: Bellevue
Posts: 312
Robototes2412 is on a distinguished road
Re: 2CAN C# Example

Never mind, remember to read the frakken thread in the future
  #7   Spotlight this post!  
Unread 12-05-2010, 12:26
David Doerr's Avatar
David Doerr David Doerr is offline
Registered User
FRC #4478 (Materia Oscura)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2002
Location: Milford, Michigan, USA
Posts: 75
David Doerr has much to be proud ofDavid Doerr has much to be proud ofDavid Doerr has much to be proud ofDavid Doerr has much to be proud ofDavid Doerr has much to be proud ofDavid Doerr has much to be proud ofDavid Doerr has much to be proud ofDavid Doerr has much to be proud of
Re: 2CAN C# Example

Quote:
Originally Posted by ozrien View Post
Be sure to use the non-FIRST Jaguar firmware. I have been using Jaguar version 5450...
Omar,

Where can one obtain the non-FIRST Jaguar firmware?

Does the non-FIRST firmware have working support for current-control and speed-control modes? (Apparently there were bugs that were fixed in FIRST version 91.)

Would it be possible to include a compiled proprietary module that could be used with one's own PC-based software -- like the C# software you've posted -- so that you wouldn't have to switch firmware when changing from cRIO-based to PC-based control (and back again)? That way trusted mode could be used with PC-based control without spilling the beans on trusted mode.

Thanks,
Dave
  #8   Spotlight this post!  
Unread 12-05-2010, 17:40
Hugh Meyer's Avatar
Hugh Meyer Hugh Meyer is offline
Registered User
FRC #1741 (Red Alert Robotics)
Team Role: Mentor
 
Join Date: Feb 2009
Rookie Year: 2008
Location: Greenwood Indiana
Posts: 158
Hugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud of
Re: 2CAN C# Example

The built in HTTP server in the 2CAN works really well also. Just hit the 2CAN IP address with a browser and you get all sorts of nice stuff.
  #9   Spotlight this post!  
Unread 12-05-2010, 17:52
rrossbach rrossbach is offline
Registered User
AKA: Ron R
FRC #2607 (RoboVikings)
Team Role: Mentor
 
Join Date: Nov 2008
Rookie Year: 2008
Location: Warrington PA
Posts: 90
rrossbach is a splendid one to beholdrrossbach is a splendid one to beholdrrossbach is a splendid one to beholdrrossbach is a splendid one to beholdrrossbach is a splendid one to beholdrrossbach is a splendid one to beholdrrossbach is a splendid one to behold
Re: 2CAN C# Example

Quote:
Originally Posted by DaveD View Post

Where can one obtain the non-FIRST Jaguar firmware?

Does the non-FIRST firmware have working support for current-control and speed-control modes? (Apparently there were bugs that were fixed in FIRST version 91.)
The non-FRC firmwares are included in the freely available development software from TI - there are separate ones for the grey Jags and black Jags.

Grey Jag kit: http://www.luminarymicro.com/products/rdk_bdc.html

Black Jag kit: http://www.luminarymicro.com/products/rdk_bdc24.html

Scroll down to the "Software Updates" section of those pages, and you'll see download links for the Firmware Development Package Software - you need to register to download. After you install the software, you'll see the firmware sources and binaries under INSTALL_DIR\boards\rdk-bdcXX. The Grey Jag firmware is qs-bdc; the Black Jag firmware is qs-bdc24.

Latest rev of the non-FRC firmwares is apparently 5961; the latest we've used is 5821 but have never had problems with any of the control modes in any of the non-FRC firmware.

As a side note our team (#2607) also ported the 2CAN cRIO plugin to run under Windows, and we use that to control the 2CAN from the PC. We've requested a firstforge project to post the code but it hasn't been approved/created yet.

Hope that helps!

- Ron
Team #2607 controls mentor
  #10   Spotlight this post!  
Unread 12-05-2010, 21:44
Dale's Avatar
Dale Dale is offline
Head Coach & Mentor
AKA: Dale Yocum
FRC #1540 (Flaming Chickens)
Team Role: Coach
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Portland, OR
Posts: 504
Dale has much to be proud ofDale has much to be proud ofDale has much to be proud ofDale has much to be proud ofDale has much to be proud ofDale has much to be proud ofDale has much to be proud ofDale has much to be proud ofDale has much to be proud of
Re: 2CAN C# Example

Often the mechanical folks want to test some aspect of the robot without asking the software folks to stop what they're doing and write a little test program.

If someone is industrious it would be great to have a windows program that you could load on a laptop to control of all the Jaguars on the bus without needing to have the cRIO involved.

Even better would be for the 2CAN web interface itself to allow you to set direction and power settings for various Jaguars.
__________________
2016 PNW Championship Chairman's; 2016 Winner Oregon City District, 2015 PNW Championship Chairman's; 2015 PNW District Engineering Inspiration; 2015 PNW District Finalist; 2014 PNW Championship Chairman's; 2014 Championship Innovation in Controls; 2013 Chairman's (Oregon); 2013 Finalist (OKC); 2012 Winner (OKC); 2012 Chairman's (OKC); 2012 Woody Flowers (Oregon); 2011 Volunteer of the Year (Oregon); 2011 Finalist & Captain (San Diego); 2011 Innovation in Control (San Diego); 2010 & 2007 Chairman's (Oregon); 2010 Regional Champions (Colorado); 2010 Innovation in Control (Colorado); 2009 & 2008 Engineering Inspiration (Oregon); 2008 Regional Champions (Oregon); 2007 Regional Finalist (Oregon); 2005 Rookie Inspiration (PNW)
  #11   Spotlight this post!  
Unread 12-05-2010, 22:53
Radical Pi Radical Pi is offline
Putting the Jumper in the Bumper
AKA: Ian Thompson
FRC #0639 (Code Red Robotics)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2010
Location: New York
Posts: 655
Radical Pi has a spectacular aura aboutRadical Pi has a spectacular aura aboutRadical Pi has a spectacular aura about
Re: 2CAN C# Example

Quote:
Originally Posted by Dale View Post
If someone is industrious it would be great to have a windows program that you could load on a laptop to control of all the Jaguars on the bus without needing to have the cRIO involved.
For Serial bridge users that would be BDC-Comm (a little hard to use). For 2CAN jags that's not really possible without doing re-flashing of all of them for that one test and then re-flashing them to work with the cRIO (which means even more programmer time) because of the safety system put in by FIRST
__________________

"To have no errors would be life without meaning. No strugle, no joy"
"A network is only as strong as it's weakest linksys"
  #12   Spotlight this post!  
Unread 12-05-2010, 23:41
Peter Johnson Peter Johnson is offline
WPILib Developer
FRC #0294 (Beach Cities Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Redondo Beach, CA
Posts: 264
Peter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud of
Re: 2CAN C# Example

Quote:
Originally Posted by Radical Pi View Post
For Serial bridge users that would be BDC-Comm (a little hard to use). For 2CAN jags that's not really possible without doing re-flashing of all of them for that one test and then re-flashing them to work with the cRIO (which means even more programmer time) because of the safety system put in by FIRST
I've successfully driven FIRST firmware jags with BDC-Comm, at least in voltage/%speed mode (current mode doesn't seem to work). Oops, re-read your post; you're right that over 2CAN it doesn't work with FIRST firmware.
__________________
Author of cscore - WPILib CameraServer for 2017+
Author of ntcore - WPILib NetworkTables for 2016+
Creator of RobotPy - Python for FRC

2010 FRC World Champions (294, 67, 177)
2007 FTC World Champions (30, 74, 23)
2001 FRC National Champions (71, 294, 125, 365, 279)
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
2CAN API Dweller CAN 4 12-03-2011 21:07
2CAN vs. Serial-to-CAN ajd CAN 9 24-04-2010 21:33
Plugin update for 2CAN ozrien CAN 3 01-02-2010 16:26
2CAN Plugin Released Mike Copioli Control System 16 24-01-2010 03:31
Legality of the 2CAN Geek 2.0 FRC Control System 9 19-01-2010 20:51


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

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