OCCRA
Go to Post Your attribute of personal sacrifice is very noble, but FIRST needs YOU to be successful first. - DanKein [more]
Home
Go Back   Chief Delphi > Technical > Technical Discussion
CD-Media  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 09-20-2018, 09:50 PM
Aaron Li's Avatar
Aaron Li Aaron Li is offline
Seeking knowledge
FRC #1665 (Weapons of Mass Construction)
Team Role: Driver
 
Join Date: Aug 2018
Rookie Year: 2017
Location: New York
Posts: 99
Aaron Li will become famous soon enoughAaron Li will become famous soon enough
Programming languages

How do different programming languages benefit over another? We have always been on Java but other elite teams in our region use python and c++ with gyros and such. Just wondering.

Sent from my Galaxy S8 using Tapatalk
__________________

Reply With Quote
  #2   Spotlight this post!  
Unread 09-20-2018, 09:52 PM
asid61's Avatar
asid61 asid61 is offline
Design Simple
AKA: Anand Rajamani
FRC #1072 (Harker Robotics)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Cupertino, CA
Posts: 3,135
asid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond repute
Re: Programming languages

Changing languages won't magically make you better, although it can help you in going from "better" to "best". We use Java and it seems to do everything we want, as fast as we want it. If you switch to C++, you'll get better performance at the cost of being harder to teach and not usually having classes at the school that correspond to it. But unless you have a great need for more computational power, Java works fine.
Java can use gyros too. C++ and Java have the same interface capabilities (AFAIK, anyway).
Python is interesting but there's not widespread support for it compared to C++ and Java.
__________________
Team 1072 2017-present
Team 299 2017
Team 115 2013-2016 (student)

2018 Davis Finalists (w/ 6474 and 3880), 2018 Roebling Winners (w/ 3476, 1323, and 1778)

Reply With Quote
  #3   Spotlight this post!  
Unread 09-20-2018, 09:55 PM
Aaron Li's Avatar
Aaron Li Aaron Li is offline
Seeking knowledge
FRC #1665 (Weapons of Mass Construction)
Team Role: Driver
 
Join Date: Aug 2018
Rookie Year: 2017
Location: New York
Posts: 99
Aaron Li will become famous soon enoughAaron Li will become famous soon enough
Quote:
Originally Posted by asid61 View Post
Changing languages won't magically make you better, although it can help you in going from "better" to "best". We use Java and it seems to do everything we want, as fast as we want it. If you switch to C++, you'll get better performance at the cost of being harder to teach and not usually having classes at the school that correspond to it. But unless you have a great need for more computational power, Java works fine.
Java can use gyros too. C++ and Java have the same interface capabilities (AFAIK, anyway).
Python is interesting but there's not widespread support for it compared to C++ and Java.
We dont look at other languages as the only person on our team who knows how to program is the programmer. Curiosity can be helpful 😛.

Sent from my Galaxy S8 using Tapatalk
__________________

Reply With Quote
  #4   Spotlight this post!  
Unread 09-21-2018, 12:09 AM
jtrv's Avatar
jtrv jtrv is offline
Registered User
AKA: Justin
FRC #5254 (HYPE)
Team Role: Mascot
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Rochester, NY
Posts: 680
jtrv has a reputation beyond reputejtrv has a reputation beyond reputejtrv has a reputation beyond reputejtrv has a reputation beyond reputejtrv has a reputation beyond reputejtrv has a reputation beyond reputejtrv has a reputation beyond reputejtrv has a reputation beyond reputejtrv has a reputation beyond reputejtrv has a reputation beyond reputejtrv has a reputation beyond repute
Re: Programming languages

Hi Aaron,

I'm from the Albany area, and I'm not quite sure what teams are using C++ or Python from that area. Most teams I know use Java (like 2791 or 20 or 3044 or 5881).

I highly recommend you stick with Java. C++ can be pretty unforgiving to beginner programmers (as most high school students are) and Python is not officially supported, so if you are having problems, the CSAs can't guarantee they'll be able to help diagnose the issue. Plus, Java is on the AP Computer Science exam (if Hudson offers that).

Just about anything that C++ or Python can do in FRC, Java can too. Right now, there is very little benefit to swapping away from Java for probably 95% of teams. (At least, not until Python is officially supported, which may be never.)
__________________
2791 - 2012-17 | 340 - 2018 | 5254 - 2018-*
My opinions do not reflect those of my team(s).
Reply With Quote
  #5   Spotlight this post!  
Unread 09-21-2018, 06:05 AM
phurley67's Avatar
phurley67 phurley67 is offline
Programming Mentor
AKA: Patrick Hurley
FRC #0862 (Lightning Robotics)
Team Role: Mentor
 
Join Date: Apr 2014
Rookie Year: 2013
Location: Canton, Michigan
Posts: 200
phurley67 is a name known to allphurley67 is a name known to allphurley67 is a name known to allphurley67 is a name known to allphurley67 is a name known to allphurley67 is a name known to all
Re: Programming languages

Personally I and the other mentors prefer C++, but we switched to Java (from LabVIEW) two years ago and could not be happier. We left LabVIEW for the following reasons:
  • Large (and ever growing) programming sub-group. LabVIEW version control and merging was difficult.
  • Frequent deploy issues
  • FTC feeder programs moving to Java
  • Ease of finding (and incorporating) code from other teams/previous years

Reasons we used Java over C++
  • High school AP programming course was in Java
  • Informative stack traces on exceptions
  • TalonSRX -- almost all the reasons to need the bit of extra speed available in C++ over Java can be mitigated by moving control loops to the Talon (or some other external processor (i.e. vision))
  • Superior IDE integrations (we have been using IntelliJ) compared to C++ (although this gap is closing)

And you can certainly find world class teams using C++ you do not have to look too far to find some using Java too. Both languages are capable of supporting high quality robot code. The real trick is learning enough of the underlying concepts that are exactly the same regardless of language to use them in your code. Read other people's code, it is an amazing resource. Ask questions here, there is a wealth of amazing people here always happy to answer good questions. Quit worrying about the language, what matters are the algorithms.
__________________
Lightning Robotics -- Give me an Aaaaaaa


Reply With Quote
  #6   Spotlight this post!  
Unread 09-21-2018, 07:09 AM
gerthworm's Avatar
gerthworm gerthworm is offline
Making the 1's and 0's
FRC #1736 (Robot Casserole)
Team Role: Mentor
 
Join Date: Jan 2015
Rookie Year: 2015
Location: Peoria, IL
Posts: 744
gerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond repute
Re: Programming languages

Quote:
Originally Posted by asid61 View Post
... it can help you in going from "better" to "best".
This is probably the best summary. A different programming language has the ability to shift the ceiling upward to allow you to perform better, but it won't make you get there.

As far as migration goes, I'd recommend sticking with what you know as of Jan 1 for your language that year. Don't try to learn a new language during the season.

If you want to pick a new language up, try re-writing the previous year's robot's code in the new language as a summer/offseason project. If it goes well and you feel comfortable, make the switch the following season.

Good choice of language helps you build the best robot. Often, the "best" robot is the one with the fewest software-induced functionality limitations. Choose a language that doesn't force you to limit what you can do during the season.
Reply With Quote
  #7   Spotlight this post!  
Unread 09-21-2018, 07:26 AM
Aaron Li's Avatar
Aaron Li Aaron Li is offline
Seeking knowledge
FRC #1665 (Weapons of Mass Construction)
Team Role: Driver
 
Join Date: Aug 2018
Rookie Year: 2017
Location: New York
Posts: 99
Aaron Li will become famous soon enoughAaron Li will become famous soon enough
Quote:
Originally Posted by jtrv View Post
Hi Aaron,

I'm from the Albany area, and I'm not quite sure what teams are using C++ or Python from that area. Most teams I know use Java (like 2791 or 20 or 3044 or 5881).

I highly recommend you stick with Java. C++ can be pretty unforgiving to beginner programmers (as most high school students are) and Python is not officially supported, so if you are having problems, the CSAs can't guarantee they'll be able to help diagnose the issue. Plus, Java is on the AP Computer Science exam (if Hudson offers that).

Just about anything that C++ or Python can do in FRC, Java can too. Right now, there is very little benefit to swapping away from Java for probably 95% of teams. (At least, not until Python is officially supported, which may be never.)
Im pretty sure 2791 (Shaker) used python in 2017 in one of the regionals. I wasnt able to scout this year so i cant say. I do know that some teams have gyros and we've never had one of those. Hudson does not offer any programming/ coding classes. Our technology electives are taken for granted.

Sent from my Galaxy S8 using Tapatalk
__________________

Reply With Quote
  #8   Spotlight this post!  
Unread 09-21-2018, 07:36 AM
Aaron Li's Avatar
Aaron Li Aaron Li is offline
Seeking knowledge
FRC #1665 (Weapons of Mass Construction)
Team Role: Driver
 
Join Date: Aug 2018
Rookie Year: 2017
Location: New York
Posts: 99
Aaron Li will become famous soon enoughAaron Li will become famous soon enough
Quote:
Originally Posted by gerthworm View Post
If you want to pick a new language up, try re-writing the previous year's robot's code in the new language as a summer/offseason project. If it goes well and you feel comfortable, make the switch the following season.
I've tried to get a mentor to decide on an offseason comp especially for the new members joining. This way, they can at least get a hint of what happens at a competition. But we wont do that since we are a team full of people that arent as dedicated as other teams so our fundraisers dont go very far. Tbh, i was part of this group my rookie year. I know that we have the potential to be a world class team but we need the key to turn that into kinetic.

Sent from my Galaxy S8 using Tapatalk
__________________

Reply With Quote
  #9   Spotlight this post!  
Unread 09-21-2018, 07:47 AM
gerthworm's Avatar
gerthworm gerthworm is offline
Making the 1's and 0's
FRC #1736 (Robot Casserole)
Team Role: Mentor
 
Join Date: Jan 2015
Rookie Year: 2015
Location: Peoria, IL
Posts: 744
gerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond repute
Re: Programming languages

Quote:
Originally Posted by Aaron Li View Post
I've tried to get a mentor to decide on an offseason comp especially for the new members joining. This way, they can at least get a hint of what happens at a competition. But we wont do that since we are a team full of people that arent as dedicated as other teams so our fundraisers dont go very far. Tbh, i was part of this group my rookie year. I know that we have the potential to be a world class team but we need the key to turn that into kinetic.

Sent from my Galaxy S8 using Tapatalk
I should say, I know teams have had success switching languages mid-season. It's possible. I just personally don't recommend it if you can avoid it.
Reply With Quote
  #10   Spotlight this post!  
Unread 09-21-2018, 09:40 AM
jtrv's Avatar
jtrv jtrv is offline
Registered User
AKA: Justin
FRC #5254 (HYPE)
Team Role: Mascot
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Rochester, NY
Posts: 680
jtrv has a reputation beyond reputejtrv has a reputation beyond reputejtrv has a reputation beyond reputejtrv has a reputation beyond reputejtrv has a reputation beyond reputejtrv has a reputation beyond reputejtrv has a reputation beyond reputejtrv has a reputation beyond reputejtrv has a reputation beyond reputejtrv has a reputation beyond reputejtrv has a reputation beyond repute
Re: Programming languages

Quote:
Originally Posted by Aaron Li View Post
Im pretty sure 2791 (Shaker) used python in 2017 in one of the regionals. I wasnt able to scout this year so i cant say. I do know that some teams have gyros and we've never had one of those. Hudson does not offer any programming/ coding classes. Our technology electives are taken for granted.

Sent from my Galaxy S8 using Tapatalk
We used Python on an offboard coprocessor for vision. But the robot code was in Java.
__________________
2791 - 2012-17 | 340 - 2018 | 5254 - 2018-*
My opinions do not reflect those of my team(s).
Reply With Quote
  #11   Spotlight this post!  
Unread 09-21-2018, 09:46 AM
Aaron Li's Avatar
Aaron Li Aaron Li is offline
Seeking knowledge
FRC #1665 (Weapons of Mass Construction)
Team Role: Driver
 
Join Date: Aug 2018
Rookie Year: 2017
Location: New York
Posts: 99
Aaron Li will become famous soon enoughAaron Li will become famous soon enough
Quote:
Originally Posted by jtrv View Post
We used Python on an offboard coprocessor for vision. But the robot code was in Java.
How does this work?

Sent from my Galaxy S8 using Tapatalk
__________________

Reply With Quote
  #12   Spotlight this post!  
Unread 09-21-2018, 10:26 AM
Brian Michell's Avatar
Brian Michell Brian Michell is offline
Registered User
FRC #1817 (Llano Estacado RoboRaiders)
Team Role: Mentor
 
Join Date: Aug 2015
Rookie Year: 2015
Location: Houston
Posts: 155
Brian Michell is just really niceBrian Michell is just really niceBrian Michell is just really niceBrian Michell is just really niceBrian Michell is just really nice
Re: Programming languages

Quote:
Originally Posted by Aaron Li View Post
How does this work?
Speaking as an outsider looking in as I've never successfully done it, they probably have a co-processor such as a raspberry pi running a program that will communicate some form of data over NetworkTables.
__________________


*Any views I express are my own and do not reflect those of any organization I am currently or formerly associated with unless stated.
5416
2015-2016: Programming, Drive Coach
6488
2017: Programming, Drive Mentor
1817
2018-?: Programming Mentor
Reply With Quote
  #13   Spotlight this post!  
Unread 09-21-2018, 10:57 AM
jtrv's Avatar
jtrv jtrv is offline
Registered User
AKA: Justin
FRC #5254 (HYPE)
Team Role: Mascot
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Rochester, NY
Posts: 680
jtrv has a reputation beyond reputejtrv has a reputation beyond reputejtrv has a reputation beyond reputejtrv has a reputation beyond reputejtrv has a reputation beyond reputejtrv has a reputation beyond reputejtrv has a reputation beyond reputejtrv has a reputation beyond reputejtrv has a reputation beyond reputejtrv has a reputation beyond reputejtrv has a reputation beyond repute
Re: Programming languages

Quote:
Originally Posted by Aaron Li View Post
How does this work?

Sent from my Galaxy S8 using Tapatalk
Here are two relevant threads:

https://www.chiefdelphi.com/forums/s....php?p=1778852

https://www.chiefdelphi.com/forums/s...d.php?t=166460
__________________
2791 - 2012-17 | 340 - 2018 | 5254 - 2018-*
My opinions do not reflect those of my team(s).
Reply With Quote
  #14   Spotlight this post!  
Unread 09-21-2018, 11:04 AM
ColbyG's Avatar
ColbyG ColbyG is offline
Registered User
AKA: Colby
FRC #1777 (Viking Robotics)
Team Role: Programmer
 
Join Date: Aug 2017
Rookie Year: 2018
Location: Kansas City
Posts: 76
ColbyG is just really niceColbyG is just really niceColbyG is just really niceColbyG is just really niceColbyG is just really nice
Re: Programming languages

Quote:
Originally Posted by Aaron Li View Post
How does this work?
Our team is currently working on running our vision processing code on a Jetson TX1. We set up our Jetson to run the Python code on startup. It then transfers angle measurements to the RoboRIO using NetworkTables.

If you (or anyone else) has any questions about our code or the specific details on how to create something like this, send me a PM and I'll try my best to answer them.
__________________
The code should work!

Our team's GitHub organization

2018-current: FRC #1777 Viking Robotics
2018-current: Mentor for FTC #13161 Westridge Robotics Club


Reply With Quote
  #15   Spotlight this post!  
Unread 09-21-2018, 11:40 AM
techhelpbb's Avatar
techhelpbb techhelpbb is offline
Registered User
FRC #0011 (MORT - Team 11)
Team Role: Mentor
 
Join Date: Nov 2010
Rookie Year: 1997
Location: New Jersey
Posts: 1,832
techhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond repute
Re: Programming languages

As a CSA:

I use Python/Java almost daily at work (mostly bits and pieces as I manage enterprise scale automated international cloud computing systems), but the issue is if there's actually a problem under Python in the stuff you are using to get to the robot specific control subsystems and the like I would not be prepared at a competition to go that deep. So even if the CSA knows Python best to hope that the parts integrating it to the system are all really stable.

In the past FRC11 had Python on Ubuntu running on the vision coprocessors using OpenCV. Our team is Java on the RoboRio.

Last edited by techhelpbb : 09-21-2018 at 11:43 AM.
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 05:08 PM.

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


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi