Who is using the RS Media from JavaOne

46 posts / 0 new
Last post
DrSoong
DrSoong's picture
Who is using the RS Media from JavaOne

I had a chance to visit the JavaOne Pavillion on Thursday. Couldn't resist to buy an RS Media, mainly because of the Java programmability. I had limited success with it so far, though. It starts a MIDlet from the SD card on startup, but this seems to run in parallel with the usual behavior, and everything is very fragile (which is also my general impression of the RS Media software).

 

Anybody else using it and interested in exchanging experiences? 

 

Nocturnal
Nocturnal's picture

If you comment out the line

/usr/bin/robot/main_ui&

in the rsupdateapp file, the RS Media's main UI will be disabled. I have no idea what affect that will have on running java app's though.

DrSoong
DrSoong's picture

Thanks. Will give that a try later. Maybe I can move the line to the end of the file, so the main UI will be started when the MIDlet is terminated.

Ferdie
Ferdie's picture

I am also having some trouble with the RS Media which I bought at JavaOne. I cannot get a MIDlet to work correctly. The instructions in the manual seems incorrect/incomplete.

I tried a simple MIDlet with a simple lcdui List. When it runs on the robot I can see my GUI, but cannot scroll through the options and cannot select any option. The GUI goes away when I try to switch to media mode (as instructed by the manual). Pressing D does not help.

Also having the same parallel issue described by DrSoong.

 

Nocturnal
Nocturnal's picture

Unfortunately DrSoong, I dont think that will work. The MIDlet is being run as a background process, making it a foreground process (remove the & from the end of the line) as well as moving the main_ui line might work. Again though, without the main_ui, you can't switch to media mode, which will affect things.

EDIT : Hmm.... you might want to try uncommenting the two togglemode lines, 

Ferdie, what you are describing sounds like your MIDlet draws its GUI, and then one of the other processes writing to the LCD overwrites it. Is the GUI being redrawn at all?

Hopefully tonight I will find some time to have a play with this.

DrSoong
DrSoong's picture

No success so far. I have moved the lines

/usr/bin/robot/start_robot_main &
/usr/bin/robot/main_ui &

to the end of the file. What happens is:

(1) Robot boots, progress bar is being shown.

(2) Robot says "I am WowWee robotics ...", does usual movements.

(3) Control mode screen is shown for a a second or so.

(4) MIDlet screen is being shown. MIDlet runs.

(5) Screen goes completely green.

(6) Pressing "M" toggles UI redraw, arm mode screen is being shown.

Steps (2) - (5) overlap partly, that is, the MIDlet is started while the robot is still doing its introduction. The MIDlet's actor output (I switch the eyes on/off a couple of times), is not in sync with the screen output, which makes me think that actor outputs are queued or something? In particular, the robot's main behavior runs in parallel with my MIDlet. This is easy to validate: The robot still reacts if you move your hand in front of its eyes.

I have tried several variations of this, with the MIDlet being started as foreground or background process. Also tried fiddling around with only the main UI line as well as some other lines. Oh, yes, I first tried the original setup, of course. Behavior is roughly as described above in all cases.

I wonder if this is actually the same version of the software Sun used on JavaOne, because it seems hardly usable to me.

Nocturnal
Nocturnal's picture

Hmm... Well I tried a lcdui list, and I was able to navigate it after I switched to media mode and press the D button. It also redrew when I navigated (except the title). I have been unable to find a way to prevent the main_ui from running while still being able to enable navigation. I'll keep trying, but I'm pretty much out of ideas.

Some of the behaviours (such as tracking something in front of the face and reception of remote signals) are handled by a seperate CPU, I suspect this is part of the reason why the change to media mode is required, since I'm fairly certain a lot of the remote signals are not passed through except when in media mode. IR tracking used to be disabled when you entered media mode. 

Sun undoubtedly would have had access to more tools than we do, they also probably had  far more details of how the hardware/software worked than we do.

DrSoong
DrSoong's picture

Nocturnal, thanks to your suggestions I made some minor progress. I think I now understand the way the system/application behaves:

(1) MIDlet is started as background process when the robot is booted. Conflicts with built-in behavior, of course.

(2) Switch to media mode stops most built-in behavior of robot, so MIDlet is now in control of the robot.

(3) Pressing C results in key presses being sent to the MIDlet. I have scanned all keys, the left direction keys work as well as the SELECT key. Everything else stays unnoticed by the MIDlet. Unfortunately this also holds for the soft keys, which renders the MIDP UI halfway useless. :-(

I suppose a good strategy would be to have the MIDlet invoked in some sort of waiting state, and let it run when step (3) is finished, maybe by pressing the SELECT key or something. Ideally one would delay any MIDlet screens until then, to not interfere with the robot UI, but this might just be impossible.

DrSoong
DrSoong's picture

Hmm... I have tried to work with the sensors. Not much success:

(1) My first attempt was to register a listener for each and every sensor in the system and print the name of the sensor when the listener is notified of a triggering. I never saw an event.

(2) I thought that maybe listeners don't work properly. So I changed to an explicit loop through all sensors once a second. If a sensor had been triggered, I would print the name. No results.

 (3) I then restricted myself to the foot sensors, and tried these four each second. I *sometimes*got results if I hammered on a switch often enough, but this was in no way reliable or predictable.

(4) I finally settled on checking a single foot sensor each second. Same as (3).

For all the others sensors, I never saw anything, which corresponds to my experiences with running Sun's test program from the SD image.

I wonder if anybody here did take part in the maze contest at JavaOne. It was supposed to use the foot sensors. Did it actually work there? I only saw the dancing robots. Maybe there's a reason for that.

I'm a bit frustrated right now. Either I am doing something very wrong here, or Sun's JVM is really as prototypical (read: incomplete and untested) as it seems to be. If the latter, I wonder how WowWee and Sun could agree on actually selling that stuff at JavaOne.

Nocturnal
Nocturnal's picture

I also have had no luck with a SensorListener. Have you even had anything show up in the console.log file? I can't seem to get anything in there no matter what I try.

When you were looping to check the sensors, did try pressing and holding the sensor? And how did you scan for remote keys?

DrSoong
DrSoong's picture

Didn't look into the log so far, but can try later.

You get the key events when you display a Canvas object (user-drawable screen). You need to override paint(), and you can override various methods that are called whenever keys are pressed and released. This gives you the key codes.

Did you buy the RS Media at JavaOne, too? If so, do you happen to have contact (visiting card or so) with the Sun guys who ported the JVM?

Nocturnal
Nocturnal's picture

Ah... I've just examined the shell script that handles the console.log file, the reason nothing ever shows up is because my midlets do not exit. The script (debugMidlet.sh) calls the midlet, redirecting console output to a temporary file, once the midlet exits it copies the file to the sd card. It also tries to remount the sd card as read/write, which is odd, because the rsupdateapp script does that already before debugMidlet gets called.

Sorry no. You could try contacting WowWee, they might be willing to put you in contact with the right people.

Jeff Block
Jeff Block's picture

Only 200 of these SDK's were made.  156 of them sold at JavaOne, and they're going to unload the remaining 44 at the Sun Online Store at some point soon.  Because the robot extension is a Sun thing (created by Sun Microsystems) not a WowWee thing, it's unclear whether or not WowWee support will be able to help much with it.  If you contact them, please relay your experiences to the rest of us.

I've also set up a Java and the RS Media Command Center here on RoboCommunity to be a place where we can all work together to get to the bottom of some of these issues.

What else can I do to help?

DrSoong
DrSoong's picture

Hi Jeff,

thanks for your help. I have taken the step to contact the Sun guys directly, since I assume they will have more detailed knowledge on the workings of their SDK. Maybe even the source code is available. I have mailed a couple of questions today and will post the answers here as soon as I get them.

I might also try contacting WowWee support to find out about their plans for the JVM/SDK and whether the Sun JVM will be included as the default one in future versions of the RS Media.

Cheers,

Dr Soong

 

Jeff Block
Jeff Block's picture

That's what I was trying to say ... it's not WowWee's SDK, it's Sun's.  Sun built it from start to finish.  I seriously doubt WowWee support will have source code or necessarily even be familiar with it.  I hope I'm wrong, though, for your sake.

Let us know what you find out.

DrSoong
DrSoong's picture

Hi everybody,

I got some answers from an engineer at Sun who's involved in the project. Here's the short version:

(1) The SDK distributed at JavaOne seems to have some problems, but these are mostly in the area of sensors. Color tracking is supposed to work (I was able to verify that) and sound sensors are supposed to work (wasn't able to verify that). All other sensors are currently defunct or at least very unreliable.

(2) They have an updated SDK for the problems. WowWee is supposed to release that update, though Sun doesn't know when. I asked if they could in the meantime release an updated SD image for those of us who bought the RS Media at JavaOne. He said that would also be up to WowWee. I hope WowWee is reading this forum.

(3) The mode switching stuff at startup can be eased a bit by changing the rsupdate script. Enable the two lines that toggle modes to automatically go to media mode. Use mediadaemon_sun_pipe instead of the other one to not have to press D any more (the latter didn't work for me).

(4) MIDP soft keys work. A and Z are used for that. I suggested they switch to shoulder keys and also make available all the other keys (which are currently invisible to the JVM) in a Canvas object. He said he would look into that.

(5) Somebody from Sun is going to take a look at this forum during the next days or so. So maybe it's a good idea to keep posting questions or problems.

So much for today. I think it's good news.

Cheers,

Dr Soong

PS: I have made some test programs for sensors (which obviously won't work properly at the moment), color tracking and servos. If there's interest, I can post them or make them available for download.

 

Dradts
Dradts's picture

Does anyone know whether this Sun SDK will be freely available after some time?

RobosapienRevolution
RobosapienRevolution's picture

check out davins blog.

Jeff Block
Jeff Block's picture

Here's the link...  The blog entry RR's talking about.

Nocturnal
Nocturnal's picture

Sound sensors didn't work for me either. I'll have to test out the suggestion of using the mediadaemon_sun_pipe, I'd assumed it was the version they used for communicating with the SunSPOT as mentioned here. The togglemode lines never worked with me, perhaps it will work better in conjunction with the mediadaemon_sun_pipe. 

I'd definately be interested in seeing your test programs, you've tested more than I have, and they would save me some time (which is in short supply at the moment). 

Dradts
Dradts's picture

@RobosapienRevolution, Jeff:

 Thanks for the response and the link!

Nocturnal
Nocturnal's picture

Using mediadaemon_sun_pipe, the toggle_mode command works, it doesn't work for me with mediadaemon_sun. However, it doesn't work during his startup routine. I had to stick a sleep 20s command before the toggle_mode commands. I still needed to press "D" to gain access to the java midlet. 

DrSoong
DrSoong's picture

Same here. I use a 25s delay to give him (her? it?) some time to finish the introduction. Then modes are switched. Still have to press D, too.

Dradts
Dradts's picture

I tried it yesterday with my RSM. I tested the Escape-Demo (the first one) and all I got was a green screen when booting up my RSM. Nothing else did work. The RSM did not even react to any remote-control commands. I will give it a try again tomorrow.

DrSoong
DrSoong's picture

I had these green screens in the beginning, too. I think they come up when a MIDlet is started that doesn't have a GUI. I haven't tried that MIDlet myself, but I suppose it won't do anything due to the sensor problems.

The remote control isn't supposed to work when you press D in media mode (press D again to make it work again). 

Dradts
Dradts's picture

Ah I see! That might be the problem. The example programs all don't have any GUIs. The example which I used is supposed to switch off the eyes and then basically wait until the bot sees something red (which normally is the exit of the 'room of doom') and then switch on the eyes again. When I pressed D in media mode, the eyes didn't go off so I thought the bot might not have started the midlet correctly. Maybe its just a bug in the VM/Bot-Library.

So I need to implement a GUI which waits for an event to start the main-program, is that correct?

Another question: does the bot completly boot from the SD-Card, or does he only load some OS-Parts from it? If he still uses a part of his internal OS, it might be interesting to know which OS-Versions you all have. I will post mine later today...

Nocturnal
Nocturnal's picture

I've never had a green screen, what I had was a window telling me that my midlet had no UI.

The software on the SD card temporarily replaces part of his existing software (mediadaemon), the OS and the rest of the software are unaffected.

Dradts
Dradts's picture

When did you get this window? Directly after booting the RSM, or later when you pressed the D-Button?

Does the midlet always run in the background?

Nocturnal
Nocturnal's picture

I got the window as soon as the midlet started to run.

DrSoong
DrSoong's picture

Do we all have the same version of the SDK, the one from the JavaOne CDs? Or does somebody have a different version, for example one that was copied directly to the PC from another machine at JavaOne, or maybe one from a totally different source?

Or maybe it's dependent on the releaese of the underlying RS Media software. I got the machine at JavaOne, together with the SDK. Can I find the version number somewhere?

 

Nocturnal
Nocturnal's picture

I believe we all have the same version of the SDK. I may have included  lcdui in my midlet without actually using it.

We probably don't all have identical firmware. You can check the firmware version, its one of the menu options in media mode, but I don't have my RS Media in front of me right now, so thats as specific as I can get. 

Pages