Chair Gripping Algorithm
Assumptions
- A chair is in the camera’s view.
- Both colors are on the chair.
- The right side of the chair is cleared (this will be fixed, time permitting).
- The robot is within 900mm of the chair after Object Recognition module
executes.
Algorithm Description
The rafsGripChair module starts once the Object Recognition module has finished
execution. Two conditions can be made at this point: the chair leg is directly
in front, or it is not. The very first thing that is done in this module is
to center the robot with the middle of the chair (the pink area). Once this
is done, if the leg is aligned along the y-axis within a given range (10 mm)
of the middle of the chair, it will approach the chair until it is within a
specified gripping distance. An example of an aligned chair is as follows:
At this point, it closes the gripper and sets the camera back to the original
orientation, and completes. The complicated part comes in when the leg is not
aligned correctly.
If the leg is not aligned within a given range (10 mm) of the middle of the
chair (or pink), the robot will turn 90 degrees, and pans the camera angle to
face back toward the chair. It will then drive in a turning fashion to maneuver
around the chair, on the right side. Once the camera notices that the two colors
are lined up along the y-axis, it stops moving around the chair, and turns to
face the chair. The camera then gets reset to be facing forward. Once this condition
is met, the robot can continue to approach and grab the chair. An example of
a chair not aligned correctly is as follows:
Other notes about the module:
It is important to note that the camera gets the center X, Y values for the
color based on the camera’s 2-dimensional view, in other words, whatever
is in the camera’s view has an X, Y coordinate value. The camera’s
X, Y coordinates are in no way related to the robots X, Y coordinates.