Design Goals
To create our Chinese Checkers playing robot, we had to achieve the following goals:
Analyze the state of the board using computer vision and get information about the position of the pieces
Program the Chinese Checkers game in Python and create an AI to generate game moves
Pick up and place a piece without disturbing other pieces on the board
Upon implementing the preceding goals, we can develop a game loop that allows a human player to play Chinese Checkers against the robot.
Design Choices
The Chinese Checkers Game
Our choice of programming language was natural for developing our Chinese Checkers program. As many of the team members had experience with programming in Python, we went forward with this language. Additionally, this would allow us to easily integrate our program with the ROS packages we would later on develop to interface with the Sawyer robot.
Analyzing the Board
To scan the board, we used the realsense2 camera and a tripod to get a colored image. This colored image would be necessary to detect the positions of the pieces on the board. Not only would the pieces have to be detected, but also the empty spaces on the board. To help out with that, we placed white pieces of paper below the holes so that they would be more easily detectable via computer vision. Additionally, we flipped the board upside-down to prevent colors and lines from the board itself from interfering with our color detection.
We also needed a way to determine the 3D coordinates of a piece on the board. For that, we used an AR Tag to locate a corner of the board. Then by determining the location of one of the positions on the board, we could infer what the rest of the positions on the board were assuming that the spaces on the board were evenly spaced (which they were).
Picking and Placing
For moving the sawyer arm, we opted to use the MoveIt package and specifically the MoveGroupCommander from the package. It allowed us to define an endpoint to reach (such as a piece) as well as certain parameters along the way. To improve the accuracy of the movement, we adjusted the max velocity, max acceleration, and position tolerance parameters. To improve the path planning, we set workspace bounds so that the arm wouldn't collide with anything and used a different planner within MoveIt to try and ensure that the arm would take the shortest path possible (as to avoid any weird or unexpected movements).
Grippers
Upon looking at the grippers, we recognized that the precision that this project required to pick up the pieces on the board was stringent. Specifically, the pieces on the board were both small and had small gaps between them (on the order of a few millimeters), thus we needed to design grippers that were thin enough such that they could pick up pieces without disturbing others. Additionally, since the pieces were round, we needed to design the grippers such that the pieces would not slip out of the grippers during piece movement. After significant testing, we determined that the regular flat-tipped grippers were sufficient for picking up a piece as long as enough pressure was applied to it. We would also need to file down the grippers to ensure they were thin enough to fit in the gaps between the pieces.
System Design
The image above is a drawing of our entire system. We created two packages called internal and sawyer actuation. The internal package continuously receives images from the RealSense camera and processes them into an internal board state through which our AI will operate on and generate a move. That move is published to the /game_move topic as a BoardMove message. The sawyer actuation package is subscribed to the /game_move topic and receives the message. The actuation package then converts the move written in internal coordinates into real world coordinates and actuates the arm into picking up the specified piece and placing it in the specified spot. We also have the intera-interface joint trajectory action server and ar_track_alvar running in the background that aid the sawyer actuation package.