Go to Post There is no offseason. - Jeff Rodriguez [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: 3 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 07-04-2015, 20:52
weaversam8 weaversam8 is offline
Team Captain
AKA: Sam Weaver
FRC #4534 (Wired Wizards)
Team Role: Leadership
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Wilmington, North Carolina
Posts: 137
weaversam8 is a splendid one to beholdweaversam8 is a splendid one to beholdweaversam8 is a splendid one to beholdweaversam8 is a splendid one to beholdweaversam8 is a splendid one to beholdweaversam8 is a splendid one to behold
Javascript Robots!

I develop full stack Node.JS professionally, and I've seen the power in Javascript. Would anyone be open to building a collaborative framework for the RoboRIO to code in Javascript?

Seems rather promising to me...
__________________
ORB Haow!

  #2   Spotlight this post!  
Unread 07-04-2015, 20:57
g_sawchuk's Avatar
g_sawchuk g_sawchuk is online now
Hmm.
AKA: Griffin Sawchuk
FRC #4476
 
Join Date: Jul 2014
Rookie Year: 2013
Location: Canada
Posts: 333
g_sawchuk is just really niceg_sawchuk is just really niceg_sawchuk is just really niceg_sawchuk is just really niceg_sawchuk is just really nice
Re: Javascript Robots!

And I thought this was going to be #teamjavascript
Oh thank you Kamen.
__________________
FRC 2013-2015 (K-Botics #2809)
VEX 2015 - 2016 (W.A.F.F.L.E.S. #4476)
FLL 2015 - ??? (MechMasters #16931)
FRC 2016 - ??? (W.A.F.F.L.E.S. #4476)
2016 Dean's List Finalist

My thoughts and ideas do not necessarily reflect those of my team.
  #3   Spotlight this post!  
Unread 07-04-2015, 21:25
nickbrickmaster's Avatar
nickbrickmaster nickbrickmaster is online now
Not Allowed Near Power Tools
AKA: Nick Schatz
FRC #3184 (Blaze Robotics)
Team Role: Leadership
 
Join Date: Jan 2015
Rookie Year: 2014
Location: Eagan MN
Posts: 149
nickbrickmaster is an unknown quantity at this point
Re: Javascript Robots!

It wouldn't be that hard if you built it on top of Java's Nashorn interpreter. Summer project?
__________________
I have approximate knowledge of many things.

FRC 3184: 2014-, FTC 10648: 2015-
  #4   Spotlight this post!  
Unread 08-04-2015, 00:15
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,041
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: Javascript Robots!

Quote:
Originally Posted by weaversam8 View Post
I develop full stack Node.JS professionally, and I've seen the power in Javascript. Would anyone be open to building a collaborative framework for the RoboRIO to code in Javascript?

Seems rather promising to me...
I've definitely considered doing it, and would love to see someone do it.

RobotPy (the python port) is pure python this year, only interfacing to the robot at the HAL layer. If you're going to do this, I would highly recommend going that route instead of trying to write bindings for WPILib. Expect to spend 2 months of effort translating WPILib into Javascript if you want to do a full port. We did C++-based bindings for a number of years, but having everything be pure python (or js) means you can run the actual robot code on your laptop, which is great for testing + simulation.

There's a lot you can learn by looking at how RobotPy is implemented -- and if you implement HAL the same way we did, then you can use our HTML/JS simulator interface (not quite ready, but almost there)!

If you want to write a robot dashboard in HTML/JS, we've got that covered.
__________________
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
  #5   Spotlight this post!  
Unread 08-04-2015, 07:37
Jacob4564 Jacob4564 is offline
It's always the programmers fault!
FRC #4564 (Orange Chaos)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2014
Location: Brewer, ME
Posts: 5
Jacob4564 is an unknown quantity at this point
Re: Javascript Robots!

It's not entirely implausible, we built our own version of java script to use in autonomous coding.
  #6   Spotlight this post!  
Unread 08-04-2015, 07:53
weaversam8 weaversam8 is offline
Team Captain
AKA: Sam Weaver
FRC #4534 (Wired Wizards)
Team Role: Leadership
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Wilmington, North Carolina
Posts: 137
weaversam8 is a splendid one to beholdweaversam8 is a splendid one to beholdweaversam8 is a splendid one to beholdweaversam8 is a splendid one to beholdweaversam8 is a splendid one to beholdweaversam8 is a splendid one to behold
Interesting. Ill definitely look into the HAL interfacing, since Node is extremely capable.
__________________
ORB Haow!

  #7   Spotlight this post!  
Unread 08-04-2015, 13:54
connor.worley's Avatar
connor.worley connor.worley is offline
Registered User
FRC #0973 (Greybots)
Team Role: Mentor
 
Join Date: Mar 2011
Rookie Year: 2010
Location: Berkeley/San Diego
Posts: 601
connor.worley has a reputation beyond reputeconnor.worley has a reputation beyond reputeconnor.worley has a reputation beyond reputeconnor.worley has a reputation beyond reputeconnor.worley has a reputation beyond reputeconnor.worley has a reputation beyond reputeconnor.worley has a reputation beyond reputeconnor.worley has a reputation beyond reputeconnor.worley has a reputation beyond reputeconnor.worley has a reputation beyond reputeconnor.worley has a reputation beyond repute
Re: Javascript Robots!

By all means, go for it, but I wouldn't use it.

From: http://nodeguide.com/convincing_the_boss.html

Quote:
But please be careful here, since JavaScript is a dynamic / garbage collected language, your response times may sometimes vary depending on how often and long the garbage collection kicks in (at which point your program is stopped). So don't try to build hard realtime systems in node, that require consistent response times. Erlang is probably a better choice for these kinds of applications.
__________________
Team 973 (2016-???)
Team 5499 (2015-2016)
Team 254 (2014-2015)

Team 1538 (2011-2014)
2014 Driver (25W 17L 1T)
日本語でOK
  #8   Spotlight this post!  
Unread 08-04-2015, 14:23
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,041
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: Javascript Robots!

Quote:
Originally Posted by connor.worley View Post
By all means, go for it, but I wouldn't use it.

From: http://nodeguide.com/convincing_the_boss.html
Python has similar issues, and it works just fine for what most FRC teams create. Java has potentially similar GC issues.
__________________
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
  #9   Spotlight this post!  
Unread 08-04-2015, 14:57
AlexanderTheOK AlexanderTheOK is offline
Guy
no team
 
Join Date: Jan 2014
Rookie Year: 2012
Location: Los Angeles
Posts: 146
AlexanderTheOK is just really niceAlexanderTheOK is just really niceAlexanderTheOK is just really niceAlexanderTheOK is just really nice
Re: Javascript Robots!

Quote:
Originally Posted by virtuald View Post
Python has similar issues, and it works just fine for what most FRC teams create. Java has potentially similar GC issues.
That explains the 250ms lag spikes I've been seeing every once in a while. Any standard way to mitigate this?
  #10   Spotlight this post!  
Unread 08-04-2015, 15:38
Jonathan Norris Jonathan Norris is offline
Jno
FRC #0610 (Crescent Robotics)
Team Role: Mentor
 
Join Date: Nov 2005
Rookie Year: 2004
Location: Toronto
Posts: 1,080
Jonathan Norris has a reputation beyond reputeJonathan Norris has a reputation beyond reputeJonathan Norris has a reputation beyond reputeJonathan Norris has a reputation beyond reputeJonathan Norris has a reputation beyond reputeJonathan Norris has a reputation beyond reputeJonathan Norris has a reputation beyond reputeJonathan Norris has a reputation beyond reputeJonathan Norris has a reputation beyond reputeJonathan Norris has a reputation beyond reputeJonathan Norris has a reputation beyond repute
Re: Javascript Robots!

Quote:
Originally Posted by connor.worley View Post
By all means, go for it, but I wouldn't use it.

From: http://nodeguide.com/convincing_the_boss.html
Java has the same garbage collection issues, and it seems to me that most teams use it... If that's a concern teams should be using C++.

I'd be willing to help out, I write Node/JS every day (in addition to Java/Objective-C), the event'ed/streams Javascript model could be really useful for robot programing.
__________________
Co-Founder of Taplytics.com
2013 World Champions (1241, 1477, 610)
Crescent Robotics Team 610 Mentor
K-Botics Team 2809 Founding Mentor ('09-'11)
Queen's University Mechanical Engineering, Applied Science '11

Crescent Robotics Team 610 Alumni
  #11   Spotlight this post!  
Unread 08-04-2015, 16:19
weaversam8 weaversam8 is offline
Team Captain
AKA: Sam Weaver
FRC #4534 (Wired Wizards)
Team Role: Leadership
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Wilmington, North Carolina
Posts: 137
weaversam8 is a splendid one to beholdweaversam8 is a splendid one to beholdweaversam8 is a splendid one to beholdweaversam8 is a splendid one to beholdweaversam8 is a splendid one to beholdweaversam8 is a splendid one to behold
Quote:
Originally Posted by Jonathan Norris View Post
Java has the same garbage collection issues, and it seems to me that most teams use it... If that's a concern teams should be using C++.



I'd be willing to help out, I write Node/JS every day (in addition to Java/Objective-C), the event'ed/streams Javascript model could be really useful for robot programing.

Yeah, I'm not concerned with Garbage Collection. It actually really helped with Recycle Rush this year (sorry .)

Excellent John, I'd probably set this up as a collaboration-able repo, so I'll definitely contact you if this gets started.

EDIT: Nobody caught the pun?
__________________
ORB Haow!


Last edited by weaversam8 : 08-04-2015 at 19:55. Reason: Added pun-ch line. OH! There's another one!
  #12   Spotlight this post!  
Unread 08-04-2015, 16:39
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,041
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: Javascript Robots!

Quote:
Originally Posted by weaversam8 View Post
Yeah, I'm not concerned with Garbage Collection. It actually really helped with Recycle Rush this year (sorry .)

Excellent John, I'd probably set this up as a collaboration-able repo, so I'll definitely contact you if this gets started.
Setup a github organization. Then you can expand to lots of little projects, instead of just a single repo.
__________________
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
  #13   Spotlight this post!  
Unread 08-04-2015, 17:04
Bryan Herbst's Avatar
Bryan Herbst Bryan Herbst is offline
Registered User
AKA: Bryan
FRC #2052 (KnightKrawler)
Team Role: Mentor
 
Join Date: Sep 2007
Rookie Year: 2007
Location: Minneapolis, Minnesota
Posts: 544
Bryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond repute
Re: Javascript Robots!

Quote:
Originally Posted by AlexanderTheOK View Post
That explains the 250ms lag spikes I've been seeing every once in a while. Any standard way to mitigate this?
Memory management is complicated, so there isn't really a silver bullet you can apply to make it better. To minimize garbage collection, you need to understand why things get garbage collected and why things don't get garbage collected.

Garbage collection generally occurs when Java decides it needs more memory for new allocations. Objects that are no longer referenced are eligible to be collected.

If you feel as though the garbage collector is running too often, it is likely because you are allocating too many objects too frequently. For example, if you have a loop that creates a new instance of an object in every iteration, those objects can pile up quickly.
__________________
Team 2052- Knightkrawler
Mentor and volunteer

Last edited by Bryan Herbst : 09-04-2015 at 09:44.
  #14   Spotlight this post!  
Unread 09-04-2015, 02:12
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: 485
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: Javascript Robots!

Quote:
Originally Posted by AlexanderTheOK View Post
That explains the 250ms lag spikes I've been seeing every once in a while. Any standard way to mitigate this?
1) Use a language implementation whose runtime doesn't do garbage collection (this may or may not exist for your language of choice)
2) Use a specially-tuned "low latency" garbage collector implementation (you probably need to test that it actually works properly for your application's usage pattern though)
3) Avoid heap allocation (to the extent that you can - just running the required libraries may produce a considerable amount of garbage, you'd need to check this)

You might also consider manually triggering a collection frequently so that less work is done each time it runs. For example, you could have it so that every time the robot got a packet from the driver station it would run an iteration of the control code and then do a GC. You would have to see how long the pause is to see if that would be acceptable.
  #15   Spotlight this post!  
Unread 13-04-2015, 11:21
gixxy's Avatar
gixxy gixxy is offline
Programming and Arduino Mentor
AKA: Gustave Michel III
FRC #3946 (Tiger Robotics)
Team Role: Mentor
 
Join Date: Nov 2011
Rookie Year: 2012
Location: Ruston, LA
Posts: 207
gixxy is on a distinguished road
Re: Javascript Robots!

I AM GAME! I would love to run a Node.js application on the roboRIO and use our DriverStation.js (Node-Webkit) DS with it. (once we get the 2015 protocol unearthed...).
__________________
Programmer - A creature known for converting Caffeine into Code.
Studying Computer Science @ Louisiana Tech University
Associate Consultant @ Fenway Group

2012-13: 3946 - Head of Programming, Electrical and Web
2014 - 3468 - Programming Mentor
2015 - Present - Lurker
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 10:05.

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