In order for our project to work, we constructed new pieces out of foam building blocks and cardboard "hats" and created a cardboard playing board. When we added the "hats" we had to create an even bigger board. Both boards can be seen below, as well as the car pieces.
Our program that runs is fairly simple. We use the MoveIt commander to do all the planning for the movements. The program first prompts the user to choose a difficulty. It then launches into the program to set up the board. What our program does is first move to a hard coded position above the table. This position allows Baxter to scan for the car ar tags. When he has scanned and found the desired first car he moves to a position that is 3.5 cm above the car. This initial movement does two things, it prevents him from knocking other cars and it improves Baxter's accuracy when he does his final grab. He then scans again and moves the suction cup into position onto the car. The suction cup is activated and the car is moved to the position that is 3.5 cm above that position. Again this is to avoid collisions with the other cars. Baxter then moves to a way point between the cars and the board that is hard coded. From the way point he moves to a position that is over the board.
Once Baxter is over the board he scans for the ar tag belonging to the space that the car will be placed. The arm moves to a position that is 7 cm over the board position and then lowers to place the piece onto the board. The arm returns to the hard coded position over the game board.
The program then loops until all the appropriate cars have been placed onto the board.
The launch file that we wrote launches the camera on Baxter's left arm and sets the parameters for ar tag tracking. (Before running our main program we use the launch file run_all.launch)