About ultrasonic sensor with lejos 0.9.1

This is where you talk about the NXJ hardware related topics such as the brick, sensors, LEGO pieces, etc

Moderators: roger, 99jonathan, imaqine

About ultrasonic sensor with lejos 0.9.1

Postby tonychannju » Tue Jun 05, 2012 8:43 am

Hi everybody,
When I used ultrasonic sensor with lejos 0.9.1, I met a problem as blow:
During detecting distance data at a fixed location, the sensor was refreshing the data with different values. I think it is strange, because at a fixed location it should display a certain value? Maybe the lejos doesn't have echo processing?
Then I tried to use the mode of returning a array, and chose the right data from it.
But this method didn't avoid the appearance of wrong data.
So, I wonder is there anybody here who met the same problem? And is there any better solution about this problem?
Thank you!
tonychannju
New User
 
Posts: 4
Joined: Tue Jun 05, 2012 8:20 am
Location: China

Re: About ultrasonic sensor with lejos 0.9.1

Postby s.frings » Tue Jun 05, 2012 11:02 am

This is normal behaviour. The Ultrasonic sensor from Lego returns often wrong values.
I tried another sensor (SRF-02) which also returns sporadically wrong values but not so often.

I have one room, where both sensors are totally unuseable. This room is under the roof with one diagonal wall. I assume that the echoes in this room cannot be compensated properly.
s.frings
Active User
 
Posts: 131
Joined: Tue Jul 20, 2010 2:01 pm

Re: About ultrasonic sensor with lejos 0.9.1

Postby tonychannju » Thu Jun 07, 2012 8:22 am

s.frings wrote:This is normal behaviour. The Ultrasonic sensor from Lego returns often wrong values.
I tried another sensor (SRF-02) which also returns sporadically wrong values but not so often.

I have one room, where both sensors are totally unuseable. This room is under the roof with one diagonal wall. I assume that the echoes in this room cannot be compensated properly.


Hi Frings:
Thank you for your reply.
Do you have any ideas about the reason? and any solution?
Is it feasible to modify the echo processing to improve the sensor's performance?
tonychannju
New User
 
Posts: 4
Joined: Tue Jun 05, 2012 8:20 am
Location: China

Re: About ultrasonic sensor with lejos 0.9.1

Postby gloomyandy » Thu Jun 07, 2012 10:49 am

There is no way to modify the echo processing performed by the sensor. However there is nothing stopping you from making multiple readings (perhaps with the sensor pointing in slightly different directions, or with the robot in different positions) and then combining these results to obtain a better result. The way you combine the results is the key to this, a simple average may help or perhaps a median filter, or you may have to use a much more sophisticated approach (perhaps using some sort of statistical model like MCL).
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3012
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: About ultrasonic sensor with lejos 0.9.1

Postby tonychannju » Fri Jun 08, 2012 5:05 am

Hi Andy:
Thank you for your help. The approach you provided is feasible and I'm doing some attempts.
Here, I have another problem about the function rotate() in class DifferentialPilot.
The performance of this function isn't stable, and the results mostly are wrong.
For instance, the parameter is set as 90. But the nxt robot can't rotate 90 degrees. It often rotates 60~70 degrees and returns.
Did you met the problem above? And is there any solution?
tonychannju
New User
 
Posts: 4
Joined: Tue Jun 05, 2012 8:20 am
Location: China

Re: About ultrasonic sensor with lejos 0.9.1

Postby gloomyandy » Fri Jun 08, 2012 9:06 am

What does your robot look like? Are you sure you have initialized the pilot correctly with things like wheel size and track? The Differential pilot is one of the most commonly used classes in leJOS, I'm pretty sure that it works correctly. What about things like the floor surface are the wheels slipping? Does your robot have some sort of castor wheel is this dragging and causing the robot not to turn correctly...
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3012
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: About ultrasonic sensor with lejos 0.9.1

Postby tonychannju » Fri Jun 08, 2012 12:45 pm

gloomyandy wrote:What does your robot look like? Are you sure you have initialized the pilot correctly with things like wheel size and track? The Differential pilot is one of the most commonly used classes in leJOS, I'm pretty sure that it works correctly. What about things like the floor surface are the wheels slipping? Does your robot have some sort of castor wheel is this dragging and causing the robot not to turn correctly...


Yes. The robot has a castor wheel...and it seems to cause the robot not to turn correctly...
tonychannju
New User
 
Posts: 4
Joined: Tue Jun 05, 2012 8:20 am
Location: China


Return to NXJ Hardware

Who is online

Users browsing this forum: No registered users and 1 guest

cron
more stuff