LeJOS Java for Lego RCX
Download
1 / 24

Agenda - PowerPoint PPT Presentation


  • 147 Views
  • Uploaded on

LeJOS Java for Lego RCX 2-12-2005 CJ Chung Associate Professor of Computer Science Director of Robofest Assistants Maurice Tedder Steven Kryskalla Rick Dudley. Agenda. 9:00 am - Introduction to LeJos Java Programming using Eclipse 9:15 am – Installation of Java, Eclipse, and LeJos

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Agenda' - dahlia


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

LeJOS Java for Lego RCX2-12-2005CJ ChungAssociate Professor of Computer ScienceDirector of RobofestAssistantsMaurice TedderSteven KryskallaRick Dudley


Agenda
Agenda

  • 9:00 am - Introduction to LeJos Java Programming using Eclipse

  • 9:15 am – Installation of Java, Eclipse, and LeJos

  • 9:45 am – LeJOS Java Programming Workshop

  • 11:00 am – Mini Challenge

  • 11:45 am - Wrap-up



2 million dollar prize 2005
2 Million Dollar Prize, 2005

142 Miles, within 10 hours


Weaponized robot, also known as SWORDS in Iraq, Jan. 14, 2005

Many of the vehicles being developed will have some autonomy, meaning they'll navigate rough terrain, avoid obstacles and make decisions about certain tasks on their own

The Pentagon's research arm, the Defense Advanced Research Projects Agency, also recently awarded contracts to aid research of robots that one day could be dropped into combat from airplanes


Your rj roverbot jr
Your RJ (Roverbot Jr.) 2005

  • Two motors

    • Left A

    • Right C

  • One light sensor on input port no. 1

  • One touch sensor on input port no. 2

  • One brain: H8 microprocessor, 16MHz



Why java
Why Java? 2005

  • Write Once, Run Anywhere

  • AP CS A and AB using Java since 03-04 year

  • Pure OO (Object Oriented) language

  • Standardized

  • Free


Characteristics of java
Characteristics of Java 2005

  • Simple: automatic memory allocation and garbage collection. # of language Construct is small.

  • Portable

  • Robust (Reliable): “exception handling”

  • Multithreaded

  • Interpreted

  • Distributed

  • Secure

  • Architecture Neutral

  • Dynamic: You can freely add methods in a class at runtime)


Lejos for lego
LeJOS for Lego 2005

  • LeJOS [Ley-J-oss]

  • http://lejos.sourceforge.net

  • Replacement Firmware for Lego RCX brick – JVM for RCX

  • Size: 16KB

  • around 12 KB for user-programs

  • Download for Free

  • Can be thought of as J2ME (Java 2 Micro Edition) for smaller devices such as pagers, cell phones, and handheld PCs.


Lejos memory map

User Programs 2005

(12 KB)

leJos JVM

(16 KB)

ROM

(16 KB)

LeJos Memory Map

Routines for ROM

(4 KB)


Advantages of using java for lego instead of nqc or c
Advantages of using Java for Lego instead of NQC (or C++) 2005

  • Pure Object Oriented. Enormous APIs

  • Floating point numbers: vital for navigation

  • Recursion

  • Threads

  • Simple Event Model

  • You can use custom made sensors, easily

  • Powerful networking APIs

  • Web control of your robot

  • Everything is for free

  • However, no Garbage collection yet (?)



How to install lejos programming environment
How to Install LeJos programming environment 2005

  • Using DOS

    • Start | Control Panel | System | Advanced | Environment Variables

    • Add c:\lejos\bin to the system PATH, if leJos was installed at c:\lejos

  • IDE

    • Eclipse: the best free Java tool

    • www.robofest.net resources button


Uploading jvm to rcx using dos
Uploading JVM to RCX using DOS 2005

  • Fast mode: lejosfirmdl –f

  • Slow mode: lejosfirmdl

  • It takes about one minutes

  • After the download, you should see a number on the LCD representing the battery voltage


Compile upload and run using dos

Program 0 2005

Program 1

Compile, Upload, and Run using DOS

  • Compile: lejosc <filename>.java

  • Upload: lejos <filename>

  • Press the green button

  • Uploading more than one program

    lejos <filename>,<filename>


Workshop topics
Workshop Topics 2005

  • Eclipse programming environment

  • Learning Java Basics with Lego RCX

    • Repetition – while and for

    • Decision – if, if else

    • Methods

    • Variables

    • Sensors

    • IR Packet Communications

  • Mini Challenge: a part of Robofest Challenge, RoboRelay


Robofest 2005
Robofest 2005 2005

  • Junior Division (5-9th)

  • Senior Division (9th-12th)

  • Exhibition Division

  • 13 regional competitions

  • Top winning teams to World Robofest at LTU on April 23.

  • MPC laptops to the best team for each division


Class mission 1
Class Mission 1 2005

  • Do forever

    • Beep when the light sensor sees the bright light


Class mission 2
Class Mission 2 2005

  • Go forward until the robot detects the edge of the white board. Stop at the edge of the board


Class mission 3
Class Mission 3 2005

  • Go forward while counting N black lines. Stop right after the Nth black line


Mini challenge a part of robofest game
Mini Challenge (a part of Robofest Game) 2005

  • Start when the lamp under the board is on

  • Follow the black line until it detects the end of the line (edge detection)

  • Turn around

  • Coming back to the home base

  • Stop when the bumper (touch senor) is hit


ad