Go to Post The worst that happens is we try our best and lose. And there's no shame in that. - pfreivald [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

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Old 03-01-2017, 16:41
JohnGaby JohnGaby is offline
Registered User
FRC #2102
 
Join Date: Jan 2014
Location: Encinitas
Posts: 24
JohnGaby is an unknown quantity at this point
Programming website

I am the programming mentor for team 2102, Team Paradox. We have put together a programming website that others may find useful:

http://programming.sdarobotics.org/

This site contains some tutorials which we use to teach programming to new members of the team. The programming is done using small inexpensive robots that we have designed, but we use Eclipse and Java and the programming environment is very similar to that used to program the FRC robots in Java.

In addition, last year we used a Raspberry Pi to do vision processing. Since this might be useful to anyone who might be considering doing something like this we are providing the code we used. To make this as easy to use as possible, we have downloads for Raspberry Pi system images that you can write to a micro SD card and not have to worry about figuring out how to install all of the necessary pieces. The Pi images contain an installed version of Eclipse (that runs on the Pi) which has C++ projects to do vision processing:

http://programming.sdarobotics.org/m...on-processing/

We are looking at possibly moving our vision processing to the NVIDIA board this year, and to that end we have done some preliminary work which we would like to share.

http://programming.sdarobotics.org/m...on-processing/

There are also two Eagle Cad files for custom boards that we may use this year. One is a breakout board for the TALON SRX and the second is a board to read a gyro using an Arduino:

http://programming.sdarobotics.org/more/downloads/

Any feedback on this material would be welcome.

John Gaby

Last edited by JohnGaby : 03-01-2017 at 16:45.
Reply With Quote
  #2   Spotlight this post!  
Old 03-01-2017, 17:40
cbf cbf is offline
Registered User
FRC #2877
 
Join Date: Feb 2012
Location: Newton, MA
Posts: 74
cbf is just really nicecbf is just really nicecbf is just really nicecbf is just really nicecbf is just really nice
Re: Programming website

Your site looks really interesting. But the most interesting part to me is that you seem to have put together an environment that emulate WPILib and associated tools on a Raspberry Pi, so writing robot code to run on your Raspberry Pi looks very much like programming the RoboRio.

This may be just what we need for some small projects, and as a software testbed for our competition robot.

Do you emulate things like CANTalon classes? (I know -- at this point, I should probably unpack it and find out for myself.)

Thanks!
Reply With Quote
  #3   Spotlight this post!  
Old 03-01-2017, 17:46
JohnGaby JohnGaby is offline
Registered User
FRC #2102
 
Join Date: Jan 2014
Location: Encinitas
Posts: 24
JohnGaby is an unknown quantity at this point
Re: Programming website

I am afraid I have not figured out the CAN bus yet. I have a CAN bus module, and have looked into it, but it is quite complicated. It is even more complicated by the fact that the FRC Talons are apparently encrypted and it appears that you need to download a non-encrypted version from the manufacturer's website. Even given that you get that version, the code to control it is quite complex.

If anyone can figure it out, I would love to add it to the software.
Reply With Quote
  #4   Spotlight this post!  
Unread 03-01-2017, 19:07
cbf cbf is offline
Registered User
FRC #2877
 
Join Date: Feb 2012
Location: Newton, MA
Posts: 74
cbf is just really nicecbf is just really nicecbf is just really nicecbf is just really nicecbf is just really nice
Re: Programming website

Well, I didn't necessarily mean driving actual Talon SRX motor controllers (although that could be useful). But your site says you use Arduino-based motor controllers. What I was thinking was implementing something like the CRTE CANTalon class, but actually have it implement the operations on your Arduino motor controllers.

Do you have docs for your Arduino motor controllers?
Reply With Quote
  #5   Spotlight this post!  
Unread 03-01-2017, 21:07
JohnGaby JohnGaby is offline
Registered User
FRC #2102
 
Join Date: Jan 2014
Location: Encinitas
Posts: 24
JohnGaby is an unknown quantity at this point
Re: Programming website

The motor controllers it can currently handle use PWM, both simple a PWM signal which controls the duty cycle of the motor (via an H-Bridge), or a servo like PWM signal where the pulse width controls both the speed and direction of the motor.

I am not familiar with CAN bus controllers other than the TALON SRXs used by FRC.

Documentation for the Java classes can be found on the website:

http://programming.sdarobotics.org/R...annotated.html
Reply With Quote
  #6   Spotlight this post!  
Unread 04-01-2017, 10:07
cbf cbf is offline
Registered User
FRC #2877
 
Join Date: Feb 2012
Location: Newton, MA
Posts: 74
cbf is just really nicecbf is just really nicecbf is just really nicecbf is just really nicecbf is just really nice
Re: Programming website

Ah, if I'd discovered this sooner, we might have been tempted to try to add CAN bus support. Maybe post-season.

In the meantime, for reference: Here's a tutorial on setting up CAN bus for Raspberry PIs and Arduino's (and Intel Galileo). The hardware is a little clunky though (DB9s are a little big for the robot. I'd rather just have terminals for twisted pair.
Reply With Quote
  #7   Spotlight this post!  
Unread 04-01-2017, 10:30
JohnGaby JohnGaby is offline
Registered User
FRC #2102
 
Join Date: Jan 2014
Location: Encinitas
Posts: 24
JohnGaby is an unknown quantity at this point
Re: Programming website

Thanks for the link, but I have actually already seen it. The problem isn't so much figuring out how to talk on the CAN bus, but figuring out how to properly talk to the TALON SRX. As I said, in researching the topic (I had hoped I could find someone who had already done it) I discovered that the FRC TALONs use an encrypted keep-alive signal that is impossible to reproduce outside the FRC framework. Fortunately, the TALON manufacture provides alternate firmware that you can flash the TALONs with that gets around this problem. However I looked at the FRC source code for handling the TALONs and it is quite involved and I simply have not had the time to try and sort it out.

Last edited by JohnGaby : 04-01-2017 at 10:34.
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 09:59.

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