chest_game¶
Overview¶
The chest_game example launches a “Find the Difference” game on the robot’s chest display. The user interacts by clicking on differences in the images. As the game progresses, feedback messages are logged in the console. The game ends when the user finds all differences or presses the button to reveal them.
Execution¶
To execute the example, use the following command:
python3 chest_game --auto-run
This will start the game component on the chest display and wait for user interaction.
Behavior¶
The game presents two images with slight differences.
The user clicks on detected differences.
Every time a difference is found, feedback is published to the console.
A button is available to reveal all differences and finish the game.
Once the game is completed, the chest component closes automatically, and the application logs execution details.
Inputs¶
No user input is required to execute the script.
The user interacts with the chest display to identify differences.
Outputs¶
The chest screen displays the game interface.
Feedback messages in the console log every time a difference is detected.
Final game result logged upon completion.
Example Output¶
When the script is running, the following game will appear on the robot’s chest display:
During execution, the output logs may resemble:
[INFO] [timestamp] [pyraya.chest_game]: Auto running the app
[INFO] [timestamp] [pyraya.chest_game]: Hello from setup()
[INFO] [timestamp] [pyraya.chest_game]: sent game component
[WARNING] [timestamp] [pyraya.chest_game]: Received game feedback msg: {"action":"game-started","id":<id>,"amount_of_differences":2}
...
[WARNING] [timestamp] [pyraya.chest_game]: Received game finish msg: {"action":"game-completed","id":<id>}
[INFO] [timestamp] [pyraya.chest_game]: finish game component
[INFO] [timestamp] [pyraya.chest_game]: Hello from finish()
Key Notes¶
The game ends when all differences are found or the reveal button is pressed.
Once the game is finished, the chest display returns to its default state, and execution logs are recorded.