sociallyassistiverobotics / sar_game_command_msgs

MIT License
0 stars 2 forks source link

sar_game_command_msgs

A ROS package containing custom ROS messages for communication with SAR games.

GameCommand

The GameCommand message is used to issue commands to SAR games. This message includes the following fields and a set of constants for these fields:

Expected game behavior

Upone receiving each command, the game should...

GameCommand.START: Start to play.

GameCommand.CONTINUE: Resume play. This command is expected to be send after a GameCommand.PAUSE command.

GameCommand.PAUSE: Pause game play until a GameState.CONTINUE message is received.

GameCommand.END: Exits gameplay gracefully. That is, continue to play until the next reasonable exit point. Do not exit the game abruptly.

GameCommand.WAIT_FOR_RESPONSE: Wait for a player response before continuing. If the game receives a player response, it can continue as normal; if it does not, it should send a GameState.USER_TIMEOUT message to indicate that no response was received.

GameCommand.SKIP_RESPONSE: Resume play, optionally taking additional action to reflect the fact that an expected user response was not received.

GameState

The GameState messages are sent by games to indicate what's happening in the game. This message includes the following fields and a set of constants for these fields:

Performance metrics

Metrics reported by each game

The possible performance metrics that each game can report are as follows:

Examples

The following is an example of the performance field for the Rocket-Barrier game:

{
"child-explainer-location-accuracy" : 0.8,
"child-explainer-piece-choice-accuracy" : 0.6
}

The following is an example of the performance field for the Storytelling game. Note that depending on the child's level in the Storytelling game, not all types of questions will be asked. The performance metric for a question type will only be reported if that type of question was asked that session. Thus, sometimes only the child-emotion-question-accuracy will be reported, sometimes both the child-emotion-question-accuracy and child-order-question-accuracy will be reported, and sometimes all three will be reported.

{
"child-emotion-question-accuracy" : 0.7,
"child-tom-question-accuracy" : 0.0,
"child-order-question-accuracy" : 0.5
}

For Galactic Traveler and Spaceship Tidyup, all performance metrics will be reported, as in the following example:

{
"attempts_mean" : 1.6,
"attempts_variance" : 0.64,
"time_spent_mean" : 5.125324999999999,
"time_spent_variance" : 7.4272715651532,
"activity_with_most_attempts" : 1,
"activity_child_spent_longest" : 1,
"child_success_percentage" : 0.6
}

The following empty json string should be sent in the performance field if the game ends and there is no performance information to report (rather than sending nothing in this field).

{ }

When to publish a GameState message

A game should publish GameState messages at the following times:

GameState.START: When a GameCommand.START message has been received and the game is starting.

GameState.IN_PROGRESS: When a GameCommand.START, GameCommand.CONTINUE, or GameCommand.SKIP\_RESPONSE message has been received, to indicate that the game is continuing play now.

GameState.PAUSED: When a GameCommand.PAUSE message has been received and the game is paused.

GameState.USER_TIMEOUT: If a response was expected from the user, but no response was received within a reasonable amount of time. The game should PAUSE after it sends this message to wait for instructions regarding whether it should wait for a response again or skip the response and move on.

GameState.END: After wrapping up the game, when gameplay has ended.

GameState.READY: When a game is up and running and is ready to receive a GameCommand.START message (when the game is ready to be started and played).