This repo contain the design of elements in gazebo to play checkers. This is part of a larger project (in development) where a robot arm play checkers agains a computer.
The repo contain clients that interact with the checkers in gazebo, as a way to provide the "computer movements"
- Include in the world "checkers_board" (check as example world/world_checkers.world). It can be placed in any position of the world.
- Launch in a node move_checkers.py (check as example launch/checkers_sim.launch)
- (optional) lauch rviz_board_publisher.py to place markers on the board and the checkers on rviz. Note: the update rate is slow..
This node is in encharge of
- Create the checkers for both players
- Put the checkers in initial position
- Allow interaction with the checkers trogh services
Note: this node is also a python package in catking_workspace, this mean its funcitons can be used in other python file (required import it)
The checker board is represented as a matrix where the rows are equibalent to the "y" direction (numbers) and the columns to the "x" direction (letters). Where the top right elements of the board match the top right elements of the matrix.
Each element of the matrix is a "Cell_info" objects that stores information about the position of the board's cell with respect the world frame and if there is a checker in that cell
- 'checkers/computer_move/': move a piece from a position (from_row,from_col) to a position (to_row,to_column).
- 'checkers/remove_piece/': Remove a piece from gazebo. Piece is identified by its position on the board (from_row,from_col).
- 'checkers/become_king/': Tranform a piece to a king. Piece is identified by its position on the board (from_row,from_col)
- 'checkers/reset_game/': Restart board for a new game (respawn deleted pieces, delete kings, and place pieces in starting position)
Examples of clients are included in the scrip folder.