NXT - PC, Comunication (Object)

Post your NXJ projects, project ideas, etc here!

Moderators: roger, 99jonathan, imaqine

NXT - PC, Comunication (Object)

Postby bukk123 » Tue Mar 27, 2012 12:47 pm

Hi, I am currently working on a school project. We are trying to make a mapping robot which is sensing objects with the UltraSonic sensor. Currently we are sending ints between the NXT and the PC, but its limited how much different data you can send both ways (Bluetooth). As I am understanding there is no support for serialization in LejOS , though I hope I am wrong?
If there is absolutely no support, is there any other way to do this, any hacks or some way to implement the ObjectOutputStream class? Any other good tips would also be appreciated.

Hilmar
bukk123
New User
 
Posts: 2
Joined: Tue Mar 27, 2012 12:38 pm

Re: NXT - PC, Comunication (Object)

Postby skoehler » Tue Mar 27, 2012 12:51 pm

And in what way would serialization help? It would also convert each object to a serious of bytes (or ints for that matter).

leJOS does not implement serialization. It's (almost) impossible to implement on the small NXT brick (only 64KB of RAM, 256KB of ROM). You have to design your own protocol. E.g. for a very simple protcol, send the length of the subsequent data first, then send the type of data, and then send the data itsefl.
Repeat that over and over again.
skoehler
leJOS Team Member
 
Posts: 1108
Joined: Thu Oct 30, 2008 4:54 pm

Re: NXT - PC, Comunication (Object)

Postby bukk123 » Tue Mar 27, 2012 1:30 pm

I tought I could save all my ints in a class and put them in a ArrayList and send the objects from that. But thanx for the reply, I will look into your sugestion.

Hilmar
bukk123
New User
 
Posts: 2
Joined: Tue Mar 27, 2012 12:38 pm


Return to NXJ Projects

Who is online

Users browsing this forum: No registered users and 1 guest

cron
more stuff