TicTacToe-Robot



Introduction

Bored of playing alone?! Play Tic-Tac-Toe with a robot!

A combination of open software platform (ROS2) with safety sensors to handle stategic and safety related tasks by a cobot. Using a fixed usb camera, a safety light curtain integrated to the robot hardware and a piece of magic from ROS2, this project allows you to play the game of Tic-Tac-Toe with a UR3. The aim of the project is to showcase the possibility of using an open software platform like ROS2 along with a low cost cobot for undertaking factory floor operations for lower cost.

Package Setup

Clone the repository by using the following code:

    $ git clone https://git.fh-aachen.de/lab-wollert/model-factory/cobot_gaming.git

Code Execution

Run the following command to install all ROS dependencies:

    $ cd <your_workspace_name>
    $ rosdep install --from-paths src --ignore-src -y

Inside the "thesis_launch.py" in the ur_bringup package, change the workspace name for the params extension of "usb_cam" package, into the name of your workspace.

Build and source your Workspace

    $ cd <your_workspace_name>
    $ colcon build
    $ source install/setup.bash

Run the following master command to run all the necessary node:

    $ ros2 launch ur_bringup thesis_launch.py

Additional Information

At the end of game or when a keyboard interrupt is triggered in the "Game_Screen", the "Object_Detection" terminal screens will also be shutdown. This leaves the UR3-ROS2 Driver, UR3-ROS2 Moveit , MovetoPos terminal ,and the USB camera still to be shut down manually.

Camera Identification

To detect the camera index/"video_device" id of the required usb camera, run:

    $  /bin/python3 /home/<user_name>/<your_workspace_name>/src/usb_cam/launch/Support/camera_detection_script.py

Then change the "video_device" id in the file "params.yaml" found under the location:

    /home/<user_name>/<your_workspace_name>/src/usb_cam/config

Individual commands

UR3 ROS2 Driver:

    $ ros2 launch ur_robot_driver ur_control.launch.py ur_type:=ur3 robot_ip:=192.168.1.102 launch_rviz:=false use_fake_hardware:=false

UR3 ROS2 MoveIt:

    $ ros2 launch ur_moveit_config ur_moveit.launch.py ur_type:=ur3 launch_rviz:=true

ROS2 node to execute robot motion:

    $ ros2 launch ur_bringup movetopos_launch.py

USB camera in ROS2 :

    $ ros2 run usb_cam usb_cam_node_exe --ros-args --params-file /home/user/<your_workspace_name>/src/usb_cam/config/params.yaml

ROS2 node to execute object detection:

    $ ros2 run detection_pkg object_detection_node

ROS2 node to run Game Algorithm

    $ ros2 run algorithm_pkg algorithm_node

How To: Start up the Demonstrator

Initial

06_connect_pc_and_cam

Boot

01_robot_startup

02_robot_poweron

03_robot_start

04_robot_ok

Positioning

05_manual_robot_movement

055_robot_start_pos

Launch file

07_run_launch_file

08_run_robot_program

09_see_robot_variables_incoming

Start Playing

After a game


Troubleshooting

Light

Visualisation not the same

Long Path Planning