Answers.Body: <p>If the ultrasonic cannot echo-locate the objects because they're too small, even with the sensor suspended very close to the floor, I suggest using a very sensitive feeler out front. It can be sticking forward like a jousting lance, and your robot can swivel back &amp; forth while traveling to scan.</p>
  
  <p>The trick to making it very sensitive is to:
  (1) make it pivot at its base on the front of the robot with a smooth pin,
  (2) make it long and lightweight (use long axles),
  (3) mount two opposed touch sensors as close to the pivot point as possible, and
  (4) pre-load the touch sensors such that minimal travel is necessary to trigger each one.</p>
  
  <p>The same techniques can be applied with a large diameter roller out front (like a steam roller) to detect any bumps on the floor (if the objects are kind of flat).</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-10-15T23:44:56.983Z
Answers.LastActivityDate: 2014-10-15T23:44:56.983Z
Answers.UserDisplayName: Will Bain
Body: <p>So I need to find objects in an enclosed area, I have access to the standard set of NXT sensors, i.e. ultrasonic/light.  </p>
  
  <p>However, the ultrasonic sensors seem to be very unreliable and erratic, in regards to finding objects accurately. </p>
  
  <p>I cannot pre-program the path to the objects, so I'm trying to work out how is the best way to go about locating these objects?  The objects are small, and on the floor.</p>
  
  <p>I was thinking a sort of swivel motion at the start, to find any objects using the ultrasonic, and then just moving a small distance at a time, then swivelling again etc.  Are there any other better ideas?</p>
  
  <p>Also, there is a wall enclosing the area, would there be a way of programming the NXT to avoid it?  </p>
  
  <p>I'll be programming the NXT in NXC.  Can't afford LIDAR :(</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-03-08T22:46:30.587Z
Comments.Text: In my sensor tests today I found that the ultrasonic sensor just returns 255 if there is no value to return (cable unplugged, or just no answer ready yet). So just filter those out – `while ((i = SensorUS(IN_1)) == 255) {}` should do the trick. Maybe that helps increasing reliability?
Comments.UserDisplayName: mirabilos
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-03-09T11:24:00.673Z
Comments.Text: Oh I didn't know that! Thanks for sharing!
Comments.UserDisplayName: user3089
Tags: <mindstorms><nxt><software><nxc><pathfinding>
Title: How to locate objects, and move towards them, without pre-programming the path
UserDisplayName: user3089
ThreadText: # How to locate objects, and move towards them, without pre-programming the path
  
  (Asked by: username_0 on 2014-02-21)
  
  So I need to find objects in an enclosed area, I have access to the standard set of NXT sensors, i.e. ultrasonic/light.
  
  However, the ultrasonic sensors seem to be very unreliable and erratic, in regards to finding objects accurately.
  
  I cannot pre-program the path to the objects, so I'm trying to work out how is the best way to go about locating these objects? The objects are small, and on the floor.
  
  I was thinking a sort of swivel motion at the start, to find any objects using the ultrasonic, and then just moving a small distance at a time, then swivelling again etc. Are there any other better ideas?
  
  Also, there is a wall enclosing the area, would there be a way of programming the NXT to avoid it?
  
  I'll be programming the NXT in NXC. Can't afford LIDAR :(
  
  **Tags:** mindstorms, nxt, software, nxc, pathfinding
  
  > **Comments:**
  > **username_1**: In my sensor tests today I found that the ultrasonic sensor just returns 255 if there is no value to return (cable unplugged, or just no answer ready yet). So just filter those out – `while ((i = SensorUS(IN_1)) == 255) {}` should do the trick. Maybe that helps increasing reliability?  
  > **username_0**: Oh I didn't know that! Thanks for sharing!  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2014-10-15. Score: 6
  
  If the ultrasonic cannot echo-locate the objects because they're too small, even with the sensor suspended very close to the floor, I suggest using a very sensitive feeler out front. It can be sticking forward like a jousting lance, and your robot can swivel back & forth while traveling to scan.
  
  The trick to making it very sensitive is to:
  (1) make it pivot at its base on the front of the robot with a smooth pin,
  (2) make it long and lightweight (use long axles),
  (3) mount two opposed touch sensors as close to the pivot point as possible, and
  (4) pre-load the touch sensors such that minimal travel is necessary to trigger each one.
  
  The same techniques can be applied with a large diameter roller out front (like a steam roller) to detect any bumps on the floor (if the objects are kind of flat).
  
  
  ---
  
  