chest_choice


Overview

The chest_choice example displays a set of options on the robot’s chest screen, allowing the user to choose one. After the user selects an option, the chest component closes, and relevant execution details are logged.

Execution

To execute the example, use the following command:

python3 chest_choice --auto-run

This will automatically launch the application and present the options on the chest display.

Behavior

  • The application initializes and presents a set of options on the chest screen.

  • It waits for the user to choose one of the displayed options.

  • Once a choice is made, the chest component closes automatically.

  • Execution details, including error codes, error messages, and result data, are logged.

Inputs

  • No user input is required to execute the script.

  • The user will interact with the chest display to select an option.

Outputs

  • A log message displaying the execution details, including the error code, error message, and result data.

  • The chest screen will show a list of options, and the user will be able to select one.

Example Output

When the script is running, the following options will appear on the robot’s chest display:

Output displayed on the robot's chest screen

The output logs follow this pattern:

[INFO] [timestamp] [pyraya.chest_choice]: Auto running the app
[INFO] [timestamp] [pyraya.chest_choice]: Error code:0
[INFO] [timestamp] [pyraya.chest_choice]: Error msg:
[INFO] [timestamp] [pyraya.chest_choice]: Result data:{"selected_option":{"id":1,"name":"1"},"action":"item_selected","id":<id>,"callback_type":"response","stamp":<timestamp>}

Key Notes

  • The choice component on the chest display remains open until the user selects an option.

  • The chest component will close after the selection is made, and the execution details will be logged.