Play the I Spy game with the Kinova Gen3 Robot!
- Ubuntu 18.04.6
- ROS Melodic
- darknet_ros
- ros_kortex_vision
- OpenCV
- opencv-python v4.2.0.32
- SpeechRecognition
- pyttsx3
$ cd ~/catkin_ws/src
$ git clone https://github.com/soroush-msd/i-spy.git
$ cd ~/catkin_ws/
$ catkin_makeIn one terminal:
$ roscoreAnd in another terminal:
$ cd ~/catkin_ws/
$ source devel/setup.bash
$ rosrun i-spy stateMachine.py [f]emale/[m]ale [h]uman/[r]obot/[g]reetingThis is a voice-based interaction. You need to have three components connected to your system:
- A microphone through which you will speak to the robot.
- A speaker through which the robot will speak to you.
- The Kinova Gen3 Robotic Arm with a working camera to enable the robot to see and detect objects in the environment.
There are two/three-ish different scenarios you can play the game:
- The robot looks around, chooses one random object, picks its first letter and then you will need to guess the matching object.
- You look around, choose one random object within the robot's FOV and pick its first letter. The robot then asks you for the letter and tries to guess the matching object.
- The robot greets you, introduces itself, and then starts scenario 1.
So, for example, if you run:
$ rosrun i-spy stateMachine.py f rThe robot will play scenario 1 with the female voice.
Note:
fstands for female, andrstands for robot in the command line arguments. This means the robot will have a female voice and will be providing a letter for the user to guess.
Or, if you run:
$ rosrun i-spy stateMachine.py m hThe robot will play scenario 2 with the male voice.
Note:
mstands for male, andhstands for human in the command line arguments. This means the robot will have a female voice, and you will be providing a letter for the robot to guess.
Similarly, if you run:
$ rosrun i-spy stateMachine.py m gThe robot will play scenario 3 with the male voice.
Note:
gstands for greeting in the command line arguments. Refer to scenario 3 for the explanation.
- Unmute the microphone,
- Provide input,
- Mute back the microphone.
This might be due to the sensitivity of different microphones and the variety of energy level thresholds needed to adjust to ambient noise.
letter x, for example, if the object starts withx. Orletter y, for example, if the object starts withy.
The diagram below demonstrates the interactions and transitions between state machines in different stages during the game:
The videos below demonstrate the interactions between a human participant and the robot playing the game in different scenarios.
Scenario 3 with female voice
Related command:
$ rosrun i-spy stateMachine.py f g1.mp4
Scenario 2 with female voice
Related command:
$ rosrun i-spy stateMachine.py f h2.mp4
Scenario 1 with male voice
Related command:
$ rosrun i-spy stateMachine.py m r3.mp4
Scenario 2 with male voice
Related command:
$ rosrun i-spy stateMachine.py m h4.mp4
For more information regarding this project and the whys and hows: CLICK ME
