Go to Post Mentors can never receive enough thanks from us students, who don't know even half of what they put into our teams. - Katie_UPS [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 19-10-2010, 01:26
zombiezen's Avatar
zombiezen zombiezen is offline
Registered User
AKA: Ross Light
FRC #0973 (Greyhound Robotics)
Team Role: College Student
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Atascadero
Posts: 12
zombiezen is a jewel in the roughzombiezen is a jewel in the roughzombiezen is a jewel in the roughzombiezen is a jewel in the rough
Announcing FIRSTLua

Hello, teams!

I would like to announce a project that we (Team 973) have been working on during the off-season: FIRSTLua. FIRSTLua is a fully functioning Lua interpreter that can be used for developing robot control code.

Some advantages of using Lua:
  • Lua is (arguably) easier to learn than C
  • Live code reloads
  • Errors won't crash the robot
  • Lua provides automatic garbage collection
  • WindRiver isn't needed after the base code is installed. Just a text editor and an FTP client.

This is beta-quality software: we have had success using Lua on our robot, but your mileage may vary. Examples and documentation are included. We are announcing this project now in the hopes that other teams will find it useful and will want to test it and contribute to it. By the time build season comes around, we'd like this to be a viable option for writing FIRST control code. Please help us out by reporting any bugs you find, and happy coding!

Project Page:
http://redmine.zombiezen.com/projects/firstlua

README:
http://redmine.zombiezen.com/project...try/README.txt

Download:
http://redmine.zombiezen.com/projects/firstlua/files

FIRSTLua is released under an MIT Open Source License, as detailed in the README.
__________________
Cheers,
Ross Light

http://www.zombiezen.com/
  #2   Spotlight this post!  
Unread 19-10-2010, 01:28
AdamHeard's Avatar
AdamHeard AdamHeard is offline
Lead Mentor
FRC #0973 (Greybots)
Team Role: Mentor
 
Join Date: Oct 2004
Rookie Year: 2004
Location: Atascadero
Posts: 5,526
AdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond repute
Send a message via AIM to AdamHeard
Re: Announcing FIRSTLua

We'll be running two different and unique robots in 1323's offseason in November running Lua to fully test it out.
  #3   Spotlight this post!  
Unread 19-10-2010, 02:14
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: 268
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: Announcing FIRSTLua

What a great idea and great work putting it all together! Since you're using SWIG, given the work you've done so far, it will make life easier for people who want to try adding other scripting languages in the future (Python anyone?).
__________________
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)
  #4   Spotlight this post!  
Unread 19-10-2010, 12:00
zombiezen's Avatar
zombiezen zombiezen is offline
Registered User
AKA: Ross Light
FRC #0973 (Greyhound Robotics)
Team Role: College Student
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Atascadero
Posts: 12
zombiezen is a jewel in the roughzombiezen is a jewel in the roughzombiezen is a jewel in the roughzombiezen is a jewel in the rough
Re: Announcing FIRSTLua

Quote:
Originally Posted by Peter Johnson View Post
What a great idea and great work putting it all together! Since you're using SWIG, given the work you've done so far, it will make life easier for people who want to try adding other scripting languages in the future (Python anyone?).
I would love to see Python working on the cRIO! I am a hard-core Python user and advocate, and that's what we first tried, but we ran into some troubles with that. Not to say that Python is impossible to get working or shouldn't be done, but let me give you a little history of the FIRSTLua project.

Before settling on Lua, one of our first attempts was getting the Python 3 interpreter working. However, Python rather heavily depends on having Unicode strings, which vxWorks doesn't provide. Along with that and a multitude of other compiler and linker errors to sort out, we decided we didn't have the development time to get it done. It's certainly possible to get Python working (and I'd love to see it), but after evaluating the performance characteristics and necessary development time, we settled on Lua.

We also found that Lua gives some flexibility that Python doesn't offer (though it pains me to admit it). Lua's core library is small, so it gives the team the option to pick what they need. Also, Lua's handling of modules is more favorable when trying to implement live code reloading (it can be done in Python, but it would be less straightforward). All of that aside, Lua is also designed to work on a smaller footprint than Python. The bulk of the code size when fully built is the WPILib wrapper (~20K lines of generated code), not Lua.

None of this is to say teams shouldn't try to get Python working. I would love that. I just would like to warn everybody of some of the difficulties we ran into while trying to do it.
__________________
Cheers,
Ross Light

http://www.zombiezen.com/
  #5   Spotlight this post!  
Unread 19-10-2010, 13:15
AustinSchuh AustinSchuh is offline
Registered User
FRC #0971 (Spartan Robotics) #254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Feb 2005
Rookie Year: 1999
Location: Los Altos, CA
Posts: 803
AustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond repute
Re: Announcing FIRSTLua

Quote:
Originally Posted by zombiezen View Post
I would love to see Python working on the cRIO! I am a hard-core Python user and advocate, and that's what we first tried, but we ran into some troubles with that.
If you are interested in working on getting Python working some time, let me know. I'd love to use Python for testing out algorithms. And nice work getting Lua to run!
  #6   Spotlight this post!  
Unread 19-10-2010, 14:49
Dustin Shadbolt's Avatar
Dustin Shadbolt Dustin Shadbolt is offline
In a server room somewhere...
AKA: Dustin Shadbolt
FRC #1555 (Team PULSE)
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Monticello,Indiana
Posts: 320
Dustin Shadbolt is on a distinguished road
Re: Announcing FIRSTLua

Amazing idea! I hope it goes well.

Last edited by Dustin Shadbolt : 19-10-2010 at 15:58.
  #7   Spotlight this post!  
Unread 19-10-2010, 16:07
demosthenes2k8's Avatar
demosthenes2k8 demosthenes2k8 is offline
Graduated but not gone
AKA: Matt Soucy
FRC #0166 (Chop Shop 166)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2007
Location: Merrimack, NH
Posts: 590
demosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to behold
Send a message via AIM to demosthenes2k8 Send a message via Yahoo to demosthenes2k8
Re: Announcing FIRSTLua

YES! Now I have an excuse to learn Lua!
__________________


GSR Dean's List Finalist 2011
  #8   Spotlight this post!  
Unread 19-10-2010, 20:12
lynca's Avatar
lynca lynca is offline
Andrew Lynch
FRC #2587 (DiscoBots)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2001
Location: Houston, TX
Posts: 1,613
lynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond repute
Send a message via AIM to lynca
Re: Announcing FIRSTLua

Quote:
Originally Posted by zombiezen View Post

Before settling on Lua, one of our first attempts was getting the Python 3 interpreter working. However, Python rather heavily depends on having Unicode strings, which vxWorks doesn't provide. Along with that and a multitude of other compiler and linker errors to sort out, we decided we didn't have the development time to get it done. It's certainly possible to get Python working (and I'd love to see it), but after evaluating the performance characteristics and necessary development time, we settled on Lua.

We also found that Lua gives some flexibility that Python doesn't offer (though it pains me to admit it). Lua's core library is small, so it gives the team the option to pick what they need. Also, Lua's handling of modules is more favorable when trying to implement live code reloading (it can be done in Python, but it would be less straightforward). All of that aside, Lua is also designed to work on a smaller footprint than Python. The bulk of the code size when fully built is the WPILib wrapper (~20K lines of generated code), not Lua.

None of this is to say teams shouldn't try to get Python working. I would love that. I just would like to warn everybody of some of the difficulties we ran into while trying to do it.
Thank you for writing this, I was waiting for Python to be ported but sadly too many hurdles for now.

Regardless, Lua is also an interpreted language that will open up programming to a much broader audience than C++/Java

Universities teach Computer Science freshmen interpreted Languages (Scheme, Python) with great success.
__________________
History: 624 - Cryptonite --> 118 - Robonauts --> 2158 - AusTIN CANS --> 2587 DiscoBots
Bio: Andrew Lynch "How I Work" ---- LinkedIn , Facebook, Twitter
  #9   Spotlight this post!  
Unread 19-10-2010, 22:21
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: Announcing FIRSTLua

Can this interpreter be adapted to use perl grammar?
  #10   Spotlight this post!  
Unread 19-10-2010, 23:55
davidthefat davidthefat is offline
Alumni
AKA: David Yoon
FRC #0589 (Falkons)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2010
Location: California
Posts: 792
davidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud of
Re: Announcing FIRSTLua

Oh man, our team is a mess... I think I will be the only full time competent programmer in our team. I would have to teach rest of the programmers. One guys didn't know C++ had classes -__- I know, thats pretty bad. I been talking about off season work ever since the end of the competition, it never happened, especially me working on the autonomous mode of the robot. So I also had the plan of creating a LUA interpretor for the robot, but you guys did it for me, thank you, I am not sure if I would be using it but thank you in advance and I will give you credit if I ever use it
__________________
Do not say what can or cannot be done, but, instead, say what must be done for the task at hand must be accomplished.
  #11   Spotlight this post!  
Unread 20-10-2010, 00:54
zombiezen's Avatar
zombiezen zombiezen is offline
Registered User
AKA: Ross Light
FRC #0973 (Greyhound Robotics)
Team Role: College Student
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Atascadero
Posts: 12
zombiezen is a jewel in the roughzombiezen is a jewel in the roughzombiezen is a jewel in the roughzombiezen is a jewel in the rough
Re: Announcing FIRSTLua

Quote:
Originally Posted by Robototes2412 View Post
Can this interpreter be adapted to use perl grammar?
No, not directly. The interpreter being used is just a patched version of off-the-shelf Lua; you would have to get Perl working from scratch. I haven't looked at the Perl codebase too extensively, but it looks like it would be an effort.

The only thing that may be of use from here (if you were determined) is the SWIG interface file that I assembled from the WPILib headers.
__________________
Cheers,
Ross Light

http://www.zombiezen.com/
  #12   Spotlight this post!  
Unread 24-10-2010, 01:02
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: 268
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: Announcing FIRSTLua

Quote:
Originally Posted by zombiezen View Post
I would love to see Python working on the cRIO! I am a hard-core Python user and advocate, and that's what we first tried, but we ran into some troubles with that.
I was inspired by your work and... ported Python to the cRIO. It's working well enough to initialize and print sys.modules.keys() using PyRun_SimpleString(). Next steps: load and run a .py file rather than using PyRun_SimpleString(), and port your SWIG WPILib wrappers to Python.

Not yet ready for prime time like your Lua port is, but I wanted to let folks know I've got it at least minimally running. I'll make another announcement when I've got WPILib-using code running and it's ready for other people to really experiment with.

Git repo at: http://git.tortall.net/cgit.cgi/RobotPy.git/
I recommend TortoiseGit for getting a copy on Windows.

On another note: you may want to rename your project to not use the FIRST name. FIRST recently became more sensitive about such things as they've trademarked the "FIRST" name and thus have to protect it from dilution. I named my Python port "RobotPy" for this reason; you might want to rename yours to "RobotLua" or something similar.
__________________
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)

Last edited by Peter Johnson : 24-10-2010 at 01:08. Reason: Add note about TortoiseGit
  #13   Spotlight this post!  
Unread 24-10-2010, 01:06
AustinSchuh AustinSchuh is offline
Registered User
FRC #0971 (Spartan Robotics) #254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Feb 2005
Rookie Year: 1999
Location: Los Altos, CA
Posts: 803
AustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond repute
Re: Announcing FIRSTLua

Quote:
Originally Posted by Peter Johnson View Post
I was inspired by your work and... ported Python to the cRIO. It's working well enough to initialize and print sys.modules.keys() using PyRun_SimpleString().
Thanks a bunch for doing this! I'm very excited! While I don't have access to a robot to try to help right now, I'd love to help test it and fix it up. Unfortunately, I'm probably booked until the semester ends. Please keep me/us updated.
  #14   Spotlight this post!  
Unread 24-10-2010, 18:26
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: Announcing FIRSTLua

Python? <3

I can finally teach the freshmen how to do more with less.

see http://teddziuba.com/2010/10/taco-bell-programming.html
  #15   Spotlight this post!  
Unread 24-10-2010, 18:50
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: Announcing FIRSTLua

sorry for the double-post, but I can't get it compile.

it spat out this:
Code:
MainRobot.cpp:28:20: Python.h: No such file or directory
MainRobot.cpp: In member function `virtual void PyRobot::StartCompetition()':
MainRobot.cpp:75: error: `Py_SetPythonHome' undeclared (first use this function)
MainRobot.cpp:75: error: (Each undeclared identifier is reported only once for each function it appears in.)
MainRobot.cpp:76: error: `Py_Initialize' undeclared (first use this function)
MainRobot.cpp:79: error: `PyRun_SimpleFile' undeclared (first use this function)
MainRobot.cpp:86: error: `Py_Finalize' undeclared (first use this function)
make: *** [PPC603gnu_DEBUG/MainRobot.o] Error 1
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
Announcing Project Falafel/FLFL RandomStyuff General Forum 0 28-08-2010 07:53
Announcing of Penalties ShaniL Rules/Strategy 3 16-03-2009 21:27
Announcing penalties GaryVoshol General Forum 8 11-03-2008 16:47
Announcing BattleCry@WPI 8! WernerNYK Off-Season Events 90 28-08-2007 13:03
Announcing Brunswick Eruption V3.0 Mike Schroeder Off-Season Events 2 26-05-2004 23:12


All times are GMT -5. The time now is 03:47.

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