Skip to content
Kyle Maroney edited this page Jan 15, 2014 · 40 revisions

Connect 4

Summary

This demonstration allows Baxter to play Connect 4!

Video

ScreenShot

Installation/Prerequisites

Required:

Check out the baxter_sandbox software (where Connect 4 demo is hosted) into your ROS workspace

    $ cd ~/ros_ws/src
    $ git clone https://github.com/RethinkRobotics/baxter_sandbox.git  

This demo requires the ability to specify the precision of joint position moves. This is availble in the development of the baxter_interface repository.

    $ cd ~/ros_ws/src/baxter_interface
    $ git checkout development

Run catkin_make to build the new additions in your ROS workspace

    $ cd ~/ros_ws/
    $ ./baxter.sh
    $ catkin_make

Overview

Connect Four is a two player turn based game where the objective is for a player to align four game pieces either horizontally, vertically or diagonally in the 7x6 game board. This demonstration was inspired by Victor Allis' Masters Thesis - A Knowledge-based Approach of Connect-Four (although Baxter is currently not nearly this good!).
This demonstration exemplifies Baxter's SDK 0.7 software advances, including manipulation/accuracy improvements, as well as OpenCV usage for perception of the board state, and a minimax strategy implementation.

Tutorial

Verify that the robot is enabled from an RSDK terminal session, ex:

    $ rosrun baxter_tools enable_robot.py -e

Modifying Baxter's Fingertips

The shape (particularly the lips around the edges) of the Connect 4 game pieces required some modification of the gripper fingertips allowing Baxter to grasp the pieces solidly.

To do this, simply file down plastic fingertips allowing the parallel gripper to close solidly on the center of the piece. Gripper Filed 1 Gripper Filed 2

During modification, test that the gripper has a solid grasp on the piece using the gripper_cuff_control example:

    $ rosrun baxter_examples gripper_cuff_control.py

Creating the piece feeder

It will be necessary to create a feeder which will provide Baxter with pieces for grasping in a static location.

80x20 was used to create a feeder which will backfill the pieces some static location -

Piece Feeder 1 Piece Feeder 2 Piece Feeder 4

The end of the extruded portion was bent, to stop the pieces from further rolling. Adding the rubber finger tip over this allowed for a gentle stop.

Piece Feeder 5 Piece Feeder 6

Interfaces

ROS APIs

See the API Reference page for details.

  • Joint Position Commands - /robot/limb/<left/right>/joint_command
    [baxter_core_msgs/JointCommand]
  • Baxter Hand Cameras - /cameras/<left/right>_hand_camera/image
    [sensor_msgs/Image]

Related Examples/Tutorials

Troubleshooting

The arm is moving oddly/colliding with the board/table

It is possible that the IK solutions found may have resulted in an 'elbow down' configuration causing the motion between positions to be large causing the collision.

Restart the demo recording new goal points. Make sure that the arm is capable of reaching 5cm above the board across all positions while grabbing the robot in zero-g mode.

Baxter is not seeing the user moves

The vision portion of the program is not configured correctly.

Please verify that the ROI of the board (dragging the blue circles overlaid on the image to the corners of the game board), that the board slots line up with the projected image grid, and that the gain is set (sliding the gain slider) so that the pieces are identified on the red and yellow masks accurately (lighting dependent).

Clone this wiki locally