This is where you talk about the NXJ software itself, installation issues, and programming talk.
Moderators: 99jonathan, roger, imaqine
It appears that the time it takes to get a ultrasonic sensor reading with icommand takes 100-200ms. Is that normal? Here's the code.
time = System.currentTimeMillis();
reading = sensor.getDistance();
logger.info("time "+ (System.currentTimeMillis()-time));
Is this due to the communication latency from the PC to the NXT?
- New User
- Posts: 12
- Joined: Sun Oct 28, 2007 7:36 pm
Yes, there's another workaround by using this command after open():
I'll probably take a look at the UltrasonicSensor code soon and make it work more like the leJOS NXJ code (for upcoming 0.5 version) which has the timing issue worked out.
- Site Admin
- Posts: 392
- Joined: Fri Aug 04, 2006 4:03 pm
Return to NXJ Software
Who is online
Users browsing this forum: No registered users and 2 guests