Page 196 - Introduction to AI Robotics
P. 196
179
5.5 Assemblages of Behaviors
and trash cans are the only blue objects. Therefore visually extracting red
and blue blobs should be sufficient. All objects are on the floor, so the robot
only has to worry about where the objects are in the x axis. A basic scenario
is for the robot to start wandering around the arena looking for red blobs.
It should head straight for the center of the largest red blob until it scoops
the can in the forklift. Then it should try three times to grab the can, and if
successful it should begin to wander around looking for a blue blob. There
should only be one blue blob in the image at a time because the two trash
cans are placed in diagonal corners of the arena. Once it sees a blue blob,
the robot should move straight to the center of the blob until the blob gets a
certain size in the image (looming). The robot should stop, let go of the can,
turn around to a random direction and resume the cycle. The robot should
avoid obstacles, so moving to a red or blue blob should be a fixed pattern
action, rather than have the robot immediately forget where it was heading.
The behavior table is:
Releaser Behavior Motor Schema Percept Perceptual Schema
always on avoid() pfields.nat(goal_dir) bumper_on read_bumper()
EMPTY=gripper_status() wander() pfields.random() time-remaining countdown()
EMPTY=gripper_status() move-to-goal(red) pfields.attraction(c_x) c_x extract-color(red, c_x)
AND
SEE_RED=extract_color(red)
FULL=gripper_status() grab-trash() close_gripper() status gripper_status()
FULL=gripper_status() wander() pfields.random() time_remaining countdown()
AND
NO_BLUE=extract_color(blue)
FULL=gripper_status() move-to-goal(blue) pfields.attraction(c_x) c_x extract-color(blue)
AND
SEE_BLUE=extract_color(blue)
FULL=gripper_status() drop_trash() open_gripper() curr_dir read_encoders()
AND turn_new_dir(curr_dir)
AT_BLUE=looming(blue, size=N)
The function calls in the table only show the relevant arguments for brevity.
The avoid behavior is interesting. The robot backs up either to the right or
left (using a NaT) when it bumps something. It may bump an arena wall
at several locations, but eventually a new wander direction will be set. If
the robot bumps a can (as opposed to captures it in its gripper), backing up
gives the robot a second chance. This table shows that the design relies on the
gripper to maintain where the robot is in the nominal sequence. An empty
gripper means the robot should be in the collecting the trash phase, either
looking for a can or moving toward one. A full gripper means the robot is in
the deposit phase. The looming releaser extracts the size of the blue region
in pixels and compares it to the size N. If the region is greater than or equal