I used a ReactorX200 arm to play go. This project has a few components. I first programmed the robot using MoveIt to pick and place go pieces in Gazebo. I then implemented a simple agent to play go. Finally, I created a simple web interface to allow people to play go against the robot remotely.
To run the robot in Gazebo with MoveIt, run
roslaunch interbotix_moveit interbotix_moveit.launch robot_name:=rx200 use_gazebo:=true
To start the node which manages the physical robot run. This will allow us to do pwm control of the gripper
roslaunch interbotix_sdk arm_run.launch robot_name:=rx200 gripper_operating_mode="pwm"
For more information on what the arm_run.launch file does, read the interbotix_sdk/README.md file
I have implemented the major ROS services for doing the picking and placing of the go pieces. Below is a gif of the GoBot picking and placing pieces in Gazebo
Here is a link to a video of the robot playing a human via the React frontend.
roslaunch interbotix_moveit interbotix_moveit.launch robot_name:=rx200 use_gazebo:=true
roslaunch go_motion_planning launch.launch
rosrun go_motion_planning manipulate_gazebo.py
rosrun go_bot_server main.py
go_engine - Provide a library for playing Go and agents to play against
go_motion_planning - Provides services for picking and placing go pieces using MoveIt
go_bot_server - Web interface and server for to allow remote play with the robot
interbotix_ros_arms - Lower level ROS nodes for ReactorX series
I used the Fast API to create endpoints for people to play against the robot online. To start the server run
cd src/go_bot_server/src/server && uvicorn main:app --reload
Go here to see what each endpoint does.
The Doxygen documentation is available at file:///home/peterjochem/Desktop/Go_Bot/catkin_ws/src/docs/html/index.html
I used pytest and gtest to create unit tests. To run the unit test, run catkin_make test
I had some trouble getting all the packages at the correct versions to compile so I made a Docker container. Here are the instructions on how to connect to the Docker container and also, if need be, create a new container
Put it all in a bash script?
A really good description on how to use Docker with ROS can be found here
-
sudo docker ps
to see if the container is running -
sudo docker exec -it robot_env bash
-
sudo xhost +
-
export DISPLAY=:0.0
The first two help setup some sort of graphics dependecy within the Docker container. RVIZ won't be able to run without this -
sudo docker pull osrf/ros:melodic-desktop-full
The standard Docker Hub ROS images are the non-Desktop ones. These will not install neccsery graphics packages in order to run RVIZ -
sudo docker run -it --env DISPLAY=unix$DISPLAY --privileged --volume /tmp/.X11-unix:/tmp/.X11-unix -dt --name robot_env --privileged -v /dev/ttyDXL/:/dev/ttyDXL --restart unless-stopped -v `pwd`:/root/workspace osrf/ros:melodic-desktop-full
-
sudo docker exec -it robot_env bash
-
source ros_entrypoint.sh
-
sudo apt-get update
Without this, rosdep won’t find any packages with the given names to install in the Docker container -
mkdir /etc/udev
-
sudo apt install udev
-
rosdep update
-
rosdep install --from-paths src --ignore-src -r -y
-
sudo apt install python-pip
-
sudo pip install modern_robotics
-
sudo cp catkin_ws/src/interbotix_ros_arms/interbotix_sdk/10-interbotix-udev.rules /etc/udev/rules.d
-
sudo udevadm control --reload-rules && udevadm trigger
-
sudo apt install vim
-
vim usr/share/ignition/fuel_tools/config.yaml
Change the url in the config.yaml file tohttps://api.ignitionrobotics.org
sudo docker start robot_env
git clone https://github.com/PeterJochem/robot_recorder
Remember to catkin_make
roslaunch go_bot_server record_robot.launch```` <br /> Now we have a node running which offers services to start and stop recording the robot. <br />
/robot_recorder/start<br />
/robot_recorder/save```
The launch file go_bot_server/launch/record_robot.launch determines where the json file of joint states is written.