Download the Laser Steering robofile.
- This demo uses a penlight laser to steer the Roomba along a path. Similar to the Chasing Light demo this one instead looks for a
red spot on the ground and moves towards it. This works best with a completely
mobile system with the Netbook, Camera, and base all attached ontop of the Roomba as it requires free movement.
This works best in dimmer light when you can isolate the laser better. Note that the camera shutter is increased to create a dark image which
works better when detecting a laser light. As the light is so bright it can be picked up by the camera with a much higher shutter speed
than what would be considered an acceptable image to you or I. Furthermore, with a darker image much less false objects are picked up which
makes the system more stable.
- First double click on the
Roomba module in the processing pipeline and change the serial COM port
to the one you are using. Note that if you happen to have a serial port on your Netbook then the COM port will most likely be from COM1 to COM4. If you are using
a USB to serial converter then it can be a much higher number. RoboRealm will only display those COM ports that are active within the system
so the COM port selection should be limited to only a few selections. If you are not sure on which COM port is being used start with the highest one and
test while moving to lower ones.
If you have already configured the Roomba in a previous robofile then the COM port should already be configured for your robot assuming the "Remember as default" checkbox in the Roomba GUI interface is set.
- If the camera view is not already present press the Camera button in the main RoboRealm interface to show you the USB webcam image.
If you have multiple cameras installed or other imaging devices you may need to press the Options button->Video Tab and select the
camera from the dropdown list that shows all the imaging devices installed in the system.
- Once you get the COM port and camera invoked you should see the image from the USB Webcam in the main RoboRealm GUI but it will mainly be a very
dark image. This will be darker than normal as this robofile will configure the Roomba to reduce the amount of light in the image. The
reason for this is that once a laser light appears in the image it will be the brightest spot in the image. Try this out by using a
laser pointer in the field of view of the camera. You will see the point moving in the image as the robot starts to respond
to the location of the laser light. Note that the camera MUST see the light within its field of view. If your camera is mounted looking
at the floor then the laser light will have to appear on the floor too.
Keep in mind that the camera will not pick up a very faint laser light so be sure the point is relatively near the Roomba
and you can see a nice bright spot.
The behavior is created by monitoring the X and Y coordinate of the laser light in the camera. If the point is higher than
the middle of the image, the robot moves forward, if it is lower the robot moves backwards. Likewise, if the point is
on the extreme right or left the robot will rotate in an attempt to center the spot.
All of this logic is performed in the VBScript module which decides how to populate the left and right motor variables in response to where the laser point is detected. Note that this information comes from the Laser Spot detection module.
- Once the motor variables are set the Roomba module then grabs these value and passes it to the Roomba robot to complete the cycle.
Tricks & Tips
- The dimmer the room environment the better.
- You may need to edit the Camera Properties module to change the exposure/shutter speed to produce a better dim image. Our settings may not work for your camera.
- You can also tweak the color and intensity thresholds in the Laser Spot module if you find that your laser light is not being tracked. You will know it is being tracked when you see a black and white square in the middle of the laser spot.