leJOS statemachine development toolkit available

Post your NXJ projects, project ideas, etc here!

Moderators: roger, 99jonathan, imaqine

leJOS statemachine development toolkit available

Postby ft.zimmermann » Thu Jan 17, 2008 6:43 pm

Hi folks,

I just opened a update site for an new eclipse feature.
The feature allows visual modelling of leJOS applications based on statemachines as indicated in a previous post.
Generated code runs with leJOS 0.5.

Includes manual with several examples (sorry german only).

Requirements:
1) Tested on Windows XP and Vista. For use under linux (ubuntu) see later post.
2) Based on eclipse europa classic 3.3.1.1.
3) The gmf feature available from the europa discovery site need to be installed first.
4) The oAW classic feature is required from updatesite
http://www.openarchitectureware.org/upd ... e/site.xml
5) Can be installed from updatesite
http://fermat.nordakademie.de/update/site.xml

Have fun.
Last edited by ft.zimmermann on Wed Feb 06, 2008 5:31 pm, edited 1 time in total.
ft.zimmermann
Novice
 
Posts: 35
Joined: Sat Sep 01, 2007 7:18 pm
Location: Hamburg, Germany

Fantastic Idea!!!

Postby esmetaman » Mon Jan 21, 2008 7:10 pm

This plugin open many possibilities as Robot Design for example and UML Process
Juan Antonio Breña Moral
http://www.juanantonio.info/lejos-ebook/
http://www.roboticaenlaescuela.es
User avatar
esmetaman
Advanced Member
 
Posts: 201
Joined: Wed Sep 13, 2006 12:16 am
Location: Madrid, Spain

Youtube video

Postby ft.zimmermann » Tue Jan 22, 2008 4:47 pm

I you have any questions reguarding the plugin, please don't hesitate to post your question. The plugin defintely needs some testing.


BTW you can have a look on a robot's active state animation on youtube.

And here the CatChaser.

And this is the Brick Sorter.
Last edited by ft.zimmermann on Fri Feb 01, 2008 5:55 pm, edited 1 time in total.
ft.zimmermann
Novice
 
Posts: 35
Joined: Sat Sep 01, 2007 7:18 pm
Location: Hamburg, Germany

Postby esmetaman » Sun Jan 27, 2008 2:16 pm

I saw your video, Fantastic work
Juan Antonio Breña Moral
http://www.juanantonio.info/lejos-ebook/
http://www.roboticaenlaescuela.es
User avatar
esmetaman
Advanced Member
 
Posts: 201
Joined: Wed Sep 13, 2006 12:16 am
Location: Madrid, Spain

Postby edalquist » Sun Jan 27, 2008 3:01 pm

I tried it out on OSX and it kind of works. I can use the plugin to model the state machine but I have to run nxjc and nxj from the command line on the generated code.
edalquist
Novice
 
Posts: 48
Joined: Sun Apr 08, 2007 5:55 pm

Playing OSX

Postby ft.zimmermann » Mon Jan 28, 2008 5:59 pm

Hi edalquist,

do you mean that the is no .nxj file generated? It should be in the in subdirectory of the project. Switch to the navigator view and refresh the project directory to verify.

Honestly I stopped trying the plugin on OSX myself.
The GMF generated Diagrams have some trouble showing more than one line of code in the diagram. Eclipse likes to crash on mac too. I posted this in the GMF newgroup, and they say it will be better for Eclipse next release Ganymede. I havn't succeded yet using Ganymede.
ft.zimmermann
Novice
 
Posts: 35
Joined: Sat Sep 01, 2007 7:18 pm
Location: Hamburg, Germany

Postby dark » Sun Feb 03, 2008 11:24 am

Hi all.

I've downloaded the plugin to use it in a university course and it seems very good to me, congrats ;)
Do you plan to release a English version of the instruction manual? While using the interface is intuitive, a more in-depth knowledge of the plugin would be very useful to me.

I'm asking also because, apart drawing, I'm not able to complete any action. Whatever action on the right-click menu I choose, the outcome is always: "An internal error occurred during <action name>". No .java/.class/.nxj file is generated at all.
I'm using the 1.0.0 version of the plugin (that I guess is the latest) on Eclipse 3.2.1, under Linux.

Thanks
dark
New User
 
Posts: 2
Joined: Wed Jan 30, 2008 10:03 am

English Instructions

Postby ft.zimmermann » Sun Feb 03, 2008 12:08 pm

Hi dark,

to answer your question first:

Do not install anything (neither eclipse nor the workspace) in a path, that contains blanks, exclamation marks, colons and other weird stuff. Also rnning eclipse from a memory stick did not work. Please let me know if this was your Problem. And: The plugin runs on Windows XP or Vista.


thank you for your interest. Again sorry, that there is only a german instruction. You are right, when you say, that you need a more detailed information about the semantics of the statemachines. I gave a course on Mindstorms programming yesterday, and there are quite a few things to tell. Despite from some bluetooth in the beginning stress everything worked as it should. The task was to build a line follower, which stops, when it sees an obstacle and waits until it is removed. I was hoping to get a couple of robots to drive on an eight without running into each other, but we did not get that far. But avoiding running into eack other worked well on all machines. (Honestly I think the students would have liked to play sumobot instead.)

The models are UML alike, but not UML conform, which is not a problem, since a DSL is required to meet the domains needs and not UML conformity.

States have three actions: entry, do and exit action.

Their execution order use is pretty much self explaining, but you need to know, that a do action can be interrupted. The standard java thread.interrupt() mechanism is used for this. As a consequence of this, entry and exit should only contain short computations and no movements. the do action can contain long lasting computations and motor movements, but should regularly check Thread.isInterrupted() to see if the action needs to terminate. This termination is done by throwing a Interrupted exception. If your students are familiar with Java Thread Communication this should sound more or less natural to them. The Wrapperclass ZPilot delegates to Pilot, but checks isInterrupted() permanently during movements. So if you use the ZPilot in do actions everythings works fine. As you can see on the videos the state changes work pretty fast using this mechanism.

The most common problem for my students was, that the statemachine stops if no follow up state can be determined. This happens if the do/entry/exit actions contain code, that terminates quickly. Sometimes you need states which just wait for some things to happen, like removement of an obstacle, pressing of a button etc. In this case it is easiest to programm a Thread.sleep(60000) in the do action. The robot waits for 60 s and if nothing happens it stops.

The start state marks the intialisation of the machine. There may be one ore more state executing threads started. Therefore you can start more than one separate Statemachine. The programmer has to take care of race conditions when he starts more than one state. I used it in the CatChaser and Dog Example to read the UltrasonicSensor (Sound) every 200 ms. See the german manual for this.

Transitions my be explicit or implicit.

Explicit transitions are checked in an own thread, with and will depend on the sensor measurements in general.
If you want you can program time or loop conditions etc. . If a condition of a explicit transition is meet (ie a measurement will meet a required value range or a timeout occurred), the transition check thread interrupts the state execution thread. A statetransfer will occur. See the BumperCar or LineFollower example for a use of explicit transiotions.
Implicit transitions will occur when a do action ends normally. They can be by a guard condition, to determine the next state. To avoid race conditions a delay may be given with the transition. (To make sure, that the ultrasonic sensor delivers the next measurement correctly. See the SetUpSonic state in the catChaser example. I also used a delay in the catChaser example to build some dramaturgical tension. See the CatChaser example delay of 1500 ms between HeadToCat and JumpAttack)

If the transition thread cannot find a next state, the engine stops. See example Exit transition in BumperCar or LineFollower for this.

There are some possibilities in the Preferences Menu you should have a look at.


Hope you can use this information. For more info please pm me. For some material I culd mail the Tex sources.
ft.zimmermann
Novice
 
Posts: 35
Joined: Sat Sep 01, 2007 7:18 pm
Location: Hamburg, Germany

Plugin on Linux

Postby ft.zimmermann » Mon Feb 04, 2008 10:22 pm

Hi dark,

The plugin has never been developed or tested against Linux.


I installed it on Ubuntu 7.10. Gusty Gibon (running in Parallels on a OSX Leopard).

You have to use Eclipse Europa and you have to make sure, that the added plugins are installed into the ECLIPSE_HOME directory. If your plugins are installed in a user home directory the required leJOS libraries will not be found. Just copy them to the ECLIPSE_HOME.

Generating the .nxj actually worked on my machine as intended. Note, that the .nxj File is generated into the bin folder by default. You need to change to the navigator view to see it. There is a preference page, where you can change the folder, where the .nxj is generated into. Make sure, the folder exists. Upload must definitely fail on Linux because the BlueZ lib is not yet included. It will take me a while to include it, because I need to get this Bluetoothstick running under Parallels.


Yours Frank
ft.zimmermann
Novice
 
Posts: 35
Joined: Sat Sep 01, 2007 7:18 pm
Location: Hamburg, Germany

Statemachine under Linux

Postby ft.zimmermann » Wed Feb 06, 2008 5:25 pm

Hi all,

now that my Ubuntu runs, I realized that you can use the plugin under Linux with a little extension.

The only thing to do is, that you need to copy the two compiled libs libjbluez.so and libjlibnxt.so somewhere into the java.library.path which includes on my machine /usr/lib/jvm/java-1.5.0-sun-1.5.0.13-sun/jre/lib/i386/client:/usr/lib/jvm/java-1.5.0-sun-1.5.0.13/jre/lib/i386
as well as my home directory /home/frank.

Since these files are compiled against every individual linuxbox I do not think that they should be included in the plugin. Just having downloaded a simple HelloWorld it might be a little bit premature, but I am tempted to say to my very surprise, that the plugin is fully functional under Linux.:-)

Frank
ft.zimmermann
Novice
 
Posts: 35
Joined: Sat Sep 01, 2007 7:18 pm
Location: Hamburg, Germany

Postby mat_jack1 » Fri Feb 08, 2008 6:40 pm

hi, the project is very good and we managed to let it work under Linux (Gentoo & Debian) and windows as well!

We'll do some documentation to install it in english and post it somewhere...

Are you thinking to build a site for this project?
mat_jack1
New User
 
Posts: 1
Joined: Fri Feb 08, 2008 6:16 pm

Site for statemachine project

Postby ft.zimmermann » Sun Feb 10, 2008 11:56 am

Hi,


Up to now I am using fermat.nordakademie.de


Why don't you pm me.


Frank
ft.zimmermann
Novice
 
Posts: 35
Joined: Sat Sep 01, 2007 7:18 pm
Location: Hamburg, Germany

Tutorial in English available

Postby esmetaman » Wed Feb 20, 2008 12:39 am

Hi friends,

I have released the first english tutorial about LeJOS statemachine development toolkit.

I will update the document with examples and more as soon as possible.

http://www.juanantonio.info/jab_cms.php?id=146
Juan Antonio Breña Moral
http://www.juanantonio.info/lejos-ebook/
http://www.roboticaenlaescuela.es
User avatar
esmetaman
Advanced Member
 
Posts: 201
Joined: Wed Sep 13, 2006 12:16 am
Location: Madrid, Spain

Postby roger » Wed Mar 05, 2008 4:34 am

Hi Juan,
I am very eager to try the state machine graphic development, but
I am stuck in your tutorial at the step of installing the graphical modeling framework. I click on the box as shown on page 9, but get this error message:
requires plug-in "org.eclipse.emf.query.ocl (1.0.1)", or compatible.
Where can I find this plug-in? It does not seem to show in the Europa Discovery Site
Roger
roger
Moderator
 
Posts: 308
Joined: Fri Jun 01, 2007 4:31 am
Location: Berkeley, CA

Postby esmetaman » Sat Mar 08, 2008 7:46 pm

Hi Roger,

Ok, you need to click in require button, then Eclipse will donwload required libraries and you will continue with the installation.

I agree with you that the installation is not "easy" :D
Juan Antonio Breña Moral
http://www.juanantonio.info/lejos-ebook/
http://www.roboticaenlaescuela.es
User avatar
esmetaman
Advanced Member
 
Posts: 201
Joined: Wed Sep 13, 2006 12:16 am
Location: Madrid, Spain

Next

Return to NXJ Projects

Who is online

Users browsing this forum: No registered users and 0 guests

more stuff