Go to Post Arguing about the rules doesn't change them. Fighting doesn't change them-and neither does feeling righteous. - David66 [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Events   CD-Media   CD-Spy   FRC-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!  
Unread 04-05-2010, 05:47 PM
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
Coding in jython

Have any teams tried to code the FRC robot in jython?

I was thinking about trying this to help explain coding to the new programmers, but I don't know if it works. Has anyone tried it?
Reply With Quote
  #2   Spotlight this post!  
Unread 04-05-2010, 11:25 PM
FRC4ME FRC4ME is offline
Registered User
FRC #0339
 
Join Date: Feb 2008
Rookie Year: 2007
Location: Fredericksburg, VA
Posts: 324
FRC4ME has a brilliant futureFRC4ME has a brilliant futureFRC4ME has a brilliant futureFRC4ME has a brilliant futureFRC4ME has a brilliant futureFRC4ME has a brilliant futureFRC4ME has a brilliant futureFRC4ME has a brilliant futureFRC4ME has a brilliant futureFRC4ME has a brilliant futureFRC4ME has a brilliant future
Re: Coding in jython

Quote:
Originally Posted by Robototes2412 View Post
Have any teams tried to code the FRC robot in jython?

I was thinking about trying this to help explain coding to the new programmers, but I don't know if it works. Has anyone tried it?
I would be interested in hearing about this as well. It sounds like it could work - supposedly jython compiles directly to Java bytecode, and a JVM won't be able to tell the difference. But I wonder if our use of Java ME and CLDC affects that.

Not that I'd use it, personally; I don't see how Python makes "explaining coding" to new programmers easier than any other language, contrary to popular opinion.
__________________
Go directly to queue. Do not pass pit.
Reply With Quote
  #3   Spotlight this post!  
Unread 04-05-2010, 11:38 PM
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: Coding in jython

THink, no brackets, no semicolins, no parentheses unless they are req'd, its easier
Reply With Quote
  #4   Spotlight this post!  
Unread 04-06-2010, 03:21 AM
spartango spartango is offline
Registered User
FRC #0192 (GRT)
Team Role: Alumni
 
Join Date: Nov 2009
Rookie Year: 2008
Location: Palo Alto, CA
Posts: 43
spartango is an unknown quantity at this point
Re: Coding in jython

I've been working on a Jython interpreter port (alongside a rhino JS interpreter)...
It's a little tricky however, because these things are all written for Java 5/6 and have to be retrowoven/hacked back to be 1.3 compliant...
The bigger issue, however, is getting java bindings working(which you will need if you want to use anything in WPILibJ) because J2ME does not allow dynamic class loading...something both rhino and jython rely on in their java bindings.
Thus, my rhino intepreter works but it pretty much justs prints stuff for the moment...Jython is a bit more tricky to work with.
Reply With Quote
  #5   Spotlight this post!  
Unread 04-06-2010, 08:57 AM
cybiko123's Avatar
cybiko123 cybiko123 is offline
TechMaster
AKA: Josh Anders
FRC #1086 (Blue Cheese)
Team Role: Leadership
 
Join Date: Mar 2008
Rookie Year: 2007
Location: Richmond
Posts: 16
cybiko123 is an unknown quantity at this point
Send a message via ICQ to cybiko123 Send a message via AIM to cybiko123 Send a message via MSN to cybiko123 Send a message via Yahoo to cybiko123 Send a message via Skype™ to cybiko123
Re: Coding in jython

If you're trying to explain code to new programmers, shouldn't you use a language that is well-supported?

In other words, I don't know many FIRST teams (or anybody, really) using Jython. What if they have problems?
Reply With Quote
  #6   Spotlight this post!  
Unread 04-06-2010, 01:08 PM
FRC4ME FRC4ME is offline
Registered User
FRC #0339
 
Join Date: Feb 2008
Rookie Year: 2007
Location: Fredericksburg, VA
Posts: 324
FRC4ME has a brilliant futureFRC4ME has a brilliant futureFRC4ME has a brilliant futureFRC4ME has a brilliant futureFRC4ME has a brilliant futureFRC4ME has a brilliant futureFRC4ME has a brilliant futureFRC4ME has a brilliant futureFRC4ME has a brilliant futureFRC4ME has a brilliant futureFRC4ME has a brilliant future
Re: Coding in jython

Quote:
Originally Posted by Robototes2412 View Post
THink, no brackets, no semicolins, no parentheses unless they are req'd, its easier
Getting new programmers to remember their brackets, semicolons, and parentheses is by far the easiest part of teaching them to be good programmers. The difficult is getting them to use simple and effective design patterns, which Python (/Jython) does not do a good job of encouraging, IMO.
__________________
Go directly to queue. Do not pass pit.
Reply With Quote
  #7   Spotlight this post!  
Unread 04-07-2010, 12:25 AM
LukeS LukeS is offline
Registered User
AKA: Luke Shumaker
FRC #1024 (Kil-A-Bytes)
Team Role: Programmer
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Indianapolis, IN
Posts: 59
LukeS is an unknown quantity at this point
Re: Coding in jython

Quote:
Originally Posted by FRC4ME View Post
Not that I'd use it, personally; I don't see how Python makes "explaining coding" to new programmers easier than any other language, contrary to popular opinion.
Python is very close to pseudo-code (and if that means that we get close-to-pseudo-code-but-actually-work-examples in Python instead of BASIC, I'm not complaining). This makes it fairly easy to understand what the code is doing, without having a ton of experience with coding.

However, I do feel that using high-level languages and not having to deal with the low-level stuff is something you can only do properly after you are capable of actually doing that stuff yourself.
Reply With Quote
  #8   Spotlight this post!  
Unread 04-08-2010, 01:51 AM
spartango spartango is offline
Registered User
FRC #0192 (GRT)
Team Role: Alumni
 
Join Date: Nov 2009
Rookie Year: 2008
Location: Palo Alto, CA
Posts: 43
spartango is an unknown quantity at this point
Re: Coding in jython

I'd say that the rationale for python should not be that it is syntatically easier for students to learn, but more that as a dynamically typed and fully interpreted language it allows advanced developers to utilize some neat python features...
Reply With Quote
  #9   Spotlight this post!  
Unread 04-08-2010, 12:17 PM
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: Coding in jython

I can't say i don't agree. I did port this year's code to jython:

Code:
from edu.wpi.first.wpilibj import SimpleRobot, Timer
from com.shadowh511.mayor.inputs import Xbox, Switch, DomBoard, GreenAsia
from com.shadowh511.mayor.outputs import Driver, FiringThread

class RobotMain(SimpleRobot):
    """
    This is the main robot class, hopefully the robot is smart enough to load
    it :S
    """
    def __init__ (self):
        """
        Makes the robot class variables
        """
        self.driver = Xbox(1)
        self.gunner = GreenAsia(2)
        self.motors = Driver(1,2,3,4,True)
        self.firing = FiringThread()
        self.switch = Switch(4,4)
        self.DomBoard = DomBoard()
        self.watchDog = SimpleRobot.getWatchdog()

    def robotInit(self):
        self.watchDog.setEnabled(False)
        self.watchDog.kill()

    def autonomous(self):
        robotInit()
        print "Autonomous Starting"
        balls = 2

        while SimpleRobot.isEnabled() and balls > 0:
            if switch.ternaryGet():
                self.motors.stop()
                self.firing.autoFire()
                Timer.delay(3)
                balls -=1
            else:
                self.motors.drive(0.5)

        self.motors.stop()

    def operatorControl(self):
        robotInit()
        print "Starting Teleop"

        while SimpleRobot.isEnabled():
            self.motors.mecanumDrive(driver)

            if self.gunner.getCross():
                self.firing.autoFire()
            elif self.gunner.getSquare():
                self.firing.autoTap()
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Coding Question ZP8892 Programming 1 01-18-2010 07:04 PM
Pneumatics coding Nguyen Programming 19 02-14-2008 07:47 PM
C coding ExarKun666 General Forum 12 12-21-2007 01:13 PM
Photoswitch coding magical hands Programming 0 01-17-2006 08:20 PM
Coding conventions Anthony Kesich Programming 20 01-08-2004 09:50 AM


All times are GMT -5. The time now is 11:11 AM.

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


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi