Go to Post I'm still thinking about the 1114 469 doomsday.. I mean, that alliance has national champion written all over it. - Joel J [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 Rating: Thread Rating: 4 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 01-07-2014, 09:21
jkoritzinsky jkoritzinsky is offline
Registered User
AKA: Jeremy Koritzinsky
FRC #4786 (Nicolet F.E.A.R.)
Team Role: Mentor
 
Join Date: Apr 2014
Rookie Year: 2014
Location: Glendale, Wisconsin
Posts: 78
jkoritzinsky will become famous soon enoughjkoritzinsky will become famous soon enough
C# and .NET for FRC on RoboRIO

Hey guys! I saw on a previous thread that there was some interest in coding a robot in C#.

Since the new control system runs Linux on ARM and the Mono runtime supports that configuration, it seems very possible. I'm all for trying to get it to work, but if anyone would like to help me that would be great.

Is there still any interest in coding up a .NET robotics library (same idea as robotpy)?
  #2   Spotlight this post!  
Unread 01-07-2014, 09:31
Gdeaver Gdeaver is offline
Registered User
FRC #1640
Team Role: Mentor
 
Join Date: Mar 2004
Rookie Year: 2001
Location: West Chester, Pa.
Posts: 1,370
Gdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond repute
Re: C# and .NET for FRC on RoboRIO

Which is more important? Managed code or real time?
  #3   Spotlight this post!  
Unread 01-07-2014, 10:18
jkoritzinsky jkoritzinsky is offline
Registered User
AKA: Jeremy Koritzinsky
FRC #4786 (Nicolet F.E.A.R.)
Team Role: Mentor
 
Join Date: Apr 2014
Rookie Year: 2014
Location: Glendale, Wisconsin
Posts: 78
jkoritzinsky will become famous soon enoughjkoritzinsky will become famous soon enough
Re: C# and .NET for FRC on RoboRIO

Real time is important for building a robot, but the really nice thing about managed runtimes is the memory management (which I must admit C++ does well if you have access to a library that correctly uses smart pointers, which WPILib does not). Also, we have already somewhat passed by the real-time requirement with the use Java. Additionally, C# has a number of language features that simplify writing code.

If people want to focus on real-time exclusively and want to avoid managed code (which I would understand) then they still have that choice with C++.

This library/runtime would give teams more choices as to what languages to use (specifically, every CLS compliant language that can run on Mono).
__________________
Nicolet F.E.A.R. (Team 4786) - Aerial Assist - Programming Manager
Nicolet F.E.A.R. (Team 4786) - 2015+ - Junior Mentor

SuperScouter for FRC Developer
  #4   Spotlight this post!  
Unread 01-07-2014, 10:53
Thad House Thad House is offline
Volunteer, WPILib Contributor
no team (Waiting for 2021)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Thousand Oaks, California
Posts: 1,107
Thad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond repute
Re: C# and .NET for FRC on RoboRIO

Mono just recently got working on ARM within the past year on hard float editions, and the fix is sort of a hack. I would not be comfortable with using that new of a library to program an FRC robot. Also, for FRC, C# and java are actually fairly close, and I would much rather have them work on just one language then split over 2.
__________________
All statements made are my own and not the feelings of any of my affiliated teams.
Teams 1510 and 2898 - Student 2010-2012
Team 4488 - Mentor 2013-2016
Co-developer of RobotDotNet, a .NET port of the WPILib.
  #5   Spotlight this post!  
Unread 01-07-2014, 11:18
jkoritzinsky jkoritzinsky is offline
Registered User
AKA: Jeremy Koritzinsky
FRC #4786 (Nicolet F.E.A.R.)
Team Role: Mentor
 
Join Date: Apr 2014
Rookie Year: 2014
Location: Glendale, Wisconsin
Posts: 78
jkoritzinsky will become famous soon enoughjkoritzinsky will become famous soon enough
Re: C# and .NET for FRC on RoboRIO

I didn't notice that Mono didn't support armhf (hard float) until recently. (I just looked at the release notes and it's only in the most recent version, 3.4). That is definitely an issue.
__________________
Nicolet F.E.A.R. (Team 4786) - Aerial Assist - Programming Manager
Nicolet F.E.A.R. (Team 4786) - 2015+ - Junior Mentor

SuperScouter for FRC Developer
  #6   Spotlight this post!  
Unread 01-07-2014, 11:41
MamaSpoldi's Avatar
MamaSpoldi MamaSpoldi is offline
Programming Mentor
AKA: Laura Spoldi
FRC #0230 (Gaelhawks)
Team Role: Engineer
 
Join Date: Jan 2009
Rookie Year: 2007
Location: Shelton, CT
Posts: 307
MamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant future
Re: C# and .NET for FRC on RoboRIO

Quote:
Originally Posted by jkoritzinsky View Post
Real time is important for building a robot, but the really nice thing about managed runtimes is the memory management (which I must admit C++ does well if you have access to a library that correctly uses smart pointers, which WPILib does not). Also, we have already somewhat passed by the real-time requirement with the use Java. Additionally, C# has a number of language features that simplify writing code.

If people want to focus on real-time exclusively and want to avoid managed code (which I would understand) then they still have that choice with C++.

This library/runtime would give teams more choices as to what languages to use (specifically, every CLS compliant language that can run on Mono).
Quote:
Originally Posted by Thad House View Post
Also, for FRC, C# and java are actually fairly close, and I would much rather have them work on just one language then split over 2.
I strongly agree that supporting more languages simply to provide more choices is not a great idea for FRC. Stretching our support resources thinner to gain variety will not work in our favor.

It makes sense to support additional languages which provide unique features allowing teams to select a language that is at an appropriate level for their available expertise and their intended capabilities. However, adding what might be called redundant languages (eg. C# when Java is already supported) simply spreads the support to more tasks. This usually results in less consistent performance and reduced reliability.

It seems like the 3 languages currently supported provide a good variation in capabilities and features to make an appropriate choice available for every team.
__________________
  #7   Spotlight this post!  
Unread 01-07-2014, 21:18
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,756
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: C# and .NET for FRC on RoboRIO

It seems like a shorter path to get things working on the roboRIO, but changing languages, or supporting another, hasn't been a priority. It is possible that, like python, it will just happen in the community, but it is't a trivial amount of work.

As for the other languages, C++ now has protection and a faster reboot time. It is still a bit unkind to mistakes, but it is the most mature and most controllable language.

LabVIEW is a compiled language that doesn't use garbage collection and has specific realtime extensions. It has safe arrays and simple syntax. It also has objects, and plenty other features that WPILib doesn't make use of.

Java is now modern and has JIT support.

I agree with the other posts, that adding another language , especially C# doesn't really seem justified at this point. But I'd love to hear which language features you would like to use.

Greg McKaskle
  #8   Spotlight this post!  
Unread 01-07-2014, 21:45
Thad House Thad House is offline
Volunteer, WPILib Contributor
no team (Waiting for 2021)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Thousand Oaks, California
Posts: 1,107
Thad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond repute
Re: C# and .NET for FRC on RoboRIO

Quote:
Originally Posted by Greg McKaskle View Post
It seems like a shorter path to get things working on the roboRIO, but changing languages, or supporting another, hasn't been a priority. It is possible that, like python, it will just happen in the community, but it is't a trivial amount of work.

As for the other languages, C++ now has protection and a faster reboot time. It is still a bit unkind to mistakes, but it is the most mature and most controllable language.

LabVIEW is a compiled language that doesn't use garbage collection and has specific realtime extensions. It has safe arrays and simple syntax. It also has objects, and plenty other features that WPILib doesn't make use of.

Java is now modern and has JIT support.

I agree with the other posts, that adding another language , especially C# doesn't really seem justified at this point. But I'd love to hear which language features you would like to use.

Greg McKaskle
I'm just happy that Java got upgraded to a normal version instead of the limited version that will be on the cRIO. We are a labview team, but I remember using Java on the cRIO and there were some fairly large limitations.

Honestly, I would much rather see python become an officially supported language long before C#. Python is different enough to actually make sense in officially supporting.
__________________
All statements made are my own and not the feelings of any of my affiliated teams.
Teams 1510 and 2898 - Student 2010-2012
Team 4488 - Mentor 2013-2016
Co-developer of RobotDotNet, a .NET port of the WPILib.
  #9   Spotlight this post!  
Unread 01-07-2014, 23:14
RyanCahoon's Avatar
RyanCahoon RyanCahoon is offline
Disassembling my prior presumptions
FRC #0766 (M-A Bears)
Team Role: Engineer
 
Join Date: Dec 2007
Rookie Year: 2007
Location: Mountain View
Posts: 689
RyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond repute
Re: C# and .NET for FRC on RoboRIO

Also, since the RoboRIO can run Java SE, it should be theoretically possible to run alternative JVM languages like this one, Scala, etc. Are there any other JVM languages that support the features you're looking for?

Quote:
Originally Posted by Thad House View Post
Honestly, I would much rather see python become an officially supported language long before C#. Python is different enough to actually make sense in officially supporting.
Jython?
__________________
FRC 2046, 2007-2008, Student member
FRC 1708, 2009-2012, College mentor; 2013-2014, Mentor
FRC 766, 2015-, Mentor
  #10   Spotlight this post!  
Unread 02-07-2014, 09:26
jkoritzinsky jkoritzinsky is offline
Registered User
AKA: Jeremy Koritzinsky
FRC #4786 (Nicolet F.E.A.R.)
Team Role: Mentor
 
Join Date: Apr 2014
Rookie Year: 2014
Location: Glendale, Wisconsin
Posts: 78
jkoritzinsky will become famous soon enoughjkoritzinsky will become famous soon enough
Re: C# and .NET for FRC on RoboRIO

Quote:
Originally Posted by Greg McKaskle View Post
It is possible that, like python, it will just happen in the community, but it is't a trivial amount of work.
I was originally thinking of this being a community thing as well, which is why I made this post, to see if anyone else wanted this as well.
Quote:
Originally Posted by Greg McKaskle View Post
C++ now has protection and a faster reboot time. It is still a bit unkind to mistakes, but it is the most mature and most controllable language.
Does this mean that the WPILib will be written in C++11, or just that the C++ runtime library (such as libstdc++) and setup on roboRIO has just been made a little safer because it runs in user-space?

Quote:
Originally Posted by Greg McKaskle View Post
I agree with the other posts, that adding another language , especially C# doesn't really seem justified at this point. But I'd love to hear which language features you would like to use.
My first thoughts of C# language features to use was C#'s event system, lambda methods (which do exist in C++11 and Java 8), asynchronous abilities (async/await). I was looking at using Reactive Extensions (Rx) as a possible library that I would utilize.

Quote:
Originally Posted by RyanCahoon View Post
Also, since the RoboRIO can run Java SE, it should be theoretically possible to run alternative JVM languages like this one
Being able to utilize the JVM's ability to run multiple languages (Java, Scala, Clojure, etc.) is something I would love to see.
__________________
Nicolet F.E.A.R. (Team 4786) - Aerial Assist - Programming Manager
Nicolet F.E.A.R. (Team 4786) - 2015+ - Junior Mentor

SuperScouter for FRC Developer
  #11   Spotlight this post!  
Unread 02-07-2014, 09:34
MrRoboSteve MrRoboSteve is offline
Mentor
AKA: Steve Peterson
FRC #3081 (Kennedy RoboEagles)
Team Role: Mentor
 
Join Date: Mar 2012
Rookie Year: 2011
Location: Bloomington, MN
Posts: 582
MrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond repute
Re: C# and .NET for FRC on RoboRIO

Selecting an "alternative" programming language is a tradeoff -- while you get the opportunity to learn something new, you lose the large amount of support resources that are available for the three supported languages. For most teams, that tradeoff isn't worth it. And, even for teams that decide to go the alternate language route, it's unlikely to have any significant benefit on performance or development time -- the supported alternatives have those bases covered.

A more impactful use of teams' time would be to collaborate on developing an open source library, built on top of WPILib, that automates common robot tasks. Students would learn API design, which is a higher level skill than learning a language. The FRC community would benefit from having a shared codebase, developed and refined over the years, that would help more teams build more sophisticated robots.
__________________
2016-17 events: 10000 Lakes Regional, Northern Lights Regional, FTC Burnsville Qualifying Tournament

2011 - present · FRC 3081 Kennedy RoboEagles mentor
2013 - present · event volunteer at 10000 Lakes Regional, Northern Lights Regional, North Star Regional, Lake Superior Regional, Minnesota State Tournament, PNW District 4 Glacier Peak, MN FTC, CMP
http://twitter.com/MrRoboSteve · www.linkedin.com/in/speterson
  #12   Spotlight this post!  
Unread 02-07-2014, 10:03
jkoritzinsky jkoritzinsky is offline
Registered User
AKA: Jeremy Koritzinsky
FRC #4786 (Nicolet F.E.A.R.)
Team Role: Mentor
 
Join Date: Apr 2014
Rookie Year: 2014
Location: Glendale, Wisconsin
Posts: 78
jkoritzinsky will become famous soon enoughjkoritzinsky will become famous soon enough
Re: C# and .NET for FRC on RoboRIO

Quote:
Originally Posted by MrRoboSteve View Post
A more impactful use of teams' time would be to collaborate on developing an open source library, built on top of WPILib, that automates common robot tasks. Students would learn API design, which is a higher level skill than learning a language. The FRC community would benefit from having a shared codebase, developed and refined over the years, that would help more teams build more sophisticated robots.
I'm definitely all for doing that. Part of the reason I wanted to start development on this was because I wanted to develop a robotics API.
__________________
Nicolet F.E.A.R. (Team 4786) - Aerial Assist - Programming Manager
Nicolet F.E.A.R. (Team 4786) - 2015+ - Junior Mentor

SuperScouter for FRC Developer
  #13   Spotlight this post!  
Unread 02-07-2014, 22:51
virtuald's Avatar
virtuald virtuald is offline
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,102
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
Re: C# and .NET for FRC on RoboRIO

Given that the RoboRIO is an embedded system, using an unsupported language of your own choosing on the RoboRIO should be relatively easy task, particularly compared to getting one working on the cRIO.

The part that is 'hardest' is creating sufficient bindings for WPILib. However, SWIG wrappers already exist that were created for the LUA interpreter (obviously would need to update them), and SWIG can create bindings for a *lot* of languages, including C#. Should be easy enough to get it working for other languages.
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
  #14   Spotlight this post!  
Unread 02-07-2014, 23:52
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,756
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: C# and .NET for FRC on RoboRIO

I believe that the tools will support and default to using C++ v11.

My comment about safety was that the language is still persnickety. Raw pointers, careless array usage, and casting can still corrupt memory, but it can no longer corrupt other process or driver memory, only your own. Also, since the other elements of the OS are more protected, the reboot can be simplified to a SW restart of your process instead of a reboot of the entire OS.

As mentioned earlier, it is already pretty straightforward to use C# for the dashboard. Perhaps someone will succeed in getting it to work on the robots as well, but it is not an official project at this point.

Greg McKaskle
  #15   Spotlight this post!  
Unread 03-07-2014, 00:57
SoftwareBug2.0's Avatar
SoftwareBug2.0 SoftwareBug2.0 is offline
Registered User
AKA: Eric
FRC #1425 (Error Code Xero)
Team Role: Mentor
 
Join Date: Aug 2004
Rookie Year: 2004
Location: Tigard, Oregon
Posts: 487
SoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant future
Re: C# and .NET for FRC on RoboRIO

Quote:
Originally Posted by jkoritzinsky View Post
I'm definitely all for doing that. Part of the reason I wanted to start development on this was because I wanted to develop a robotics API.
This year 1425 basically created our own C++ API and it worked out nicely for us. It's a totally feasible project. Or, you could use ours.

Similarly, 1540 has their own Java API that they use and while I'm not totally onboard with how it does everything (or using Java), what I can tell it seems like it's better than WPIlib.
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


All times are GMT -5. The time now is 02:50.

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