How to locate objects, and move towards them, without pre-programming the path 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 :(
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.

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).