stp.utils.world_state_converter

Module Contents

Classes

RobotStatus

A class to contain the information from the robot status messsage

RobotState

A class to contain the infomration from the robot state message

PartialWorldState

A class that contains all the ball, and robot states

Functions

robotstate_to_partial_robot(→ RobotState)

return:

robot state class representing the state of the robot, partially representing the larger Robot class.

robotstatus_to_partial_robot(→ RobotStatus)

return:

robot status class representing the status of the robot, partially representing the larger Robot class.

ballstate_to_ball(→ stp.rc.Ball)

return:

ball class representing the state of the ball.

build_game_info(→ stp.rc.GameInfo)

return:

GameInfo class from rc.py

field_msg_to_field(→ stp.rc.Field)

return:

Field class from rc.py

worldstate_message_converter(→ PartialWorldState)

return:

partial world state class representing the state of the robots and ball.

robot_creator(→ stp.rc.Robot)

A function which combines the robot state and robot status to create a rc.Robot class

worldstate_creator(→ stp.rc.WorldState)

A function which combines the partial world state, robot statuses, game info, and field to create a whole world state

Attributes

RobotId

stp.utils.world_state_converter.RobotId
class stp.utils.world_state_converter.RobotStatus(robot_id: RobotId = None, has_ball_sense: bool = None, kicker_charged: bool = None, kicker_healthy: bool = None, lethal_fault: bool = None)

A class to contain the information from the robot status messsage

__slots = ['robot_id', 'has_ball_sense', 'kicker_charged', 'kicker_healthy', 'lethal_fault']
robot_id: RobotId

visible: bool has_ball_sense: bool kicker_charged: bool kicker_healthy: bool lethal_fault: bool

class stp.utils.world_state_converter.RobotState(id: RobotId, pose: numpy.ndarray, twist: numpy.ndarray, visible: bool)

A class to contain the infomration from the robot state message

__slots = ['id', 'pose', 'twist', 'visible']
id: RobotId
pose: numpy.ndarray
twist: numpy.ndarray
visible: bool
class stp.utils.world_state_converter.PartialWorldState(our_robots: List[RobotState], their_robots: List[RobotState], ball: stp.rc.Ball)

A class that contains all the ball, and robot states

__slots = ['our_robots', 'their_robots', 'ball']
our_robots: List[RobotState]
their_robots: List[RobotState]
ball: stp.rc.Ball
stp.utils.world_state_converter.robotstate_to_partial_robot(robot_msg: rj_msgs.msg.RobotState, index: int) RobotState
Returns:

robot state class representing the state of the robot, partially representing the larger Robot class.

stp.utils.world_state_converter.robotstatus_to_partial_robot(robot_msg: rj_msgs.msg.RobotStatus) RobotStatus
Returns:

robot status class representing the status of the robot, partially representing the larger Robot class.

stp.utils.world_state_converter.ballstate_to_ball(ball_msg: rj_msgs.msg.BallState) stp.rc.Ball
Returns:

ball class representing the state of the ball.

stp.utils.world_state_converter.build_game_info(play_state_msg: rj_msgs.msg.PlayState, match_state_msg: rj_msgs.msg.MatchState) stp.rc.GameInfo
Returns:

GameInfo class from rc.py

stp.utils.world_state_converter.field_msg_to_field(field_msg: rj_msgs.msg.FieldDimensions) stp.rc.Field
Returns:

Field class from rc.py

stp.utils.world_state_converter.worldstate_message_converter(msg: worldstate_message_converter.msg) PartialWorldState
Returns:

partial world state class representing the state of the robots and ball.

stp.utils.world_state_converter.robot_creator(robot_state: RobotState, robot_status: RobotStatus = None) stp.rc.Robot
A function which combines the robot state and robot status to create a rc.Robot class
return:

Robot class from rc.Robot representing the status and state of the robot

stp.utils.world_state_converter.worldstate_creator(partial_world_state: PartialWorldState, robot_statuses: List[RobotStatus], game_info: stp.rc.GameInfo, field: stp.rc.Field, goalie_id: int) stp.rc.WorldState
A function which combines the partial world state, robot statuses, game info, and field to create a whole world state
return:

a world state as a rc.WorldState object