soccer_strategy.robot_controlled.RobotControlled
- class soccer_strategy.robot_controlled.RobotControlled(robot_id=0, team=Team.UNKNOWN, role=Role.UNASSIGNED, status=Status.DISCONNECTED, position=array([0, 0, 0]))[source]
Bases:
Robot
- __init__(robot_id=0, team=Team.UNKNOWN, role=Role.UNASSIGNED, status=Status.DISCONNECTED, position=array([0, 0, 0]))[source]
Initializes the robot structure
- Parameters:
robot_id – Integer representing the robot’s id
team – Which team the robot is on
role – Which role on the field
status – What is the current status of the robot
position – X, Y position of the robot where Y is the short length of the field and X is the long length
Methods
__init__
([robot_id, team, role, status, ...])Initializes the robot structure
can_kick
(ball, goal_position[, verbose])Whether the robot can kick the ball based on the robot and ball position
get_back_up
([type])Send a command get back up, based on the get up type
kick
(kick_velocity)Send a command to kick the ball
Set's the robot's position based on the amcl_pose :return:
set_navigation_position
(goal_position)Set's the robot's navigation position for the robot to go to :param goal_position: goal_position: [x, y, theta] of the robot's goal position
shorten_navigation_position
(goal_position)Limits the length of the navigation, for example a goal given 2 meters will return a goal determined by the shorten_navigation_limit parameter, if it is 1 then 1 meter max navigation limit :param goal_position: [x, y, theta] of the robot's goal position
Send a command to stop the robot's walking
Attributes
BODY_LENGTH
BODY_WIDTH
- class Role(value)
Bases:
IntEnum
An enumeration.
- class Status(value)
Bases:
IntEnum
An enumeration.
- class Team(value)
Bases:
IntEnum
An enumeration.
- class TeamColor(value)
Bases:
IntEnum
An enumeration.
- can_kick(ball: Ball, goal_position, verbose=True)[source]
Whether the robot can kick the ball based on the robot and ball position
- Parameters:
ball – Ball object
goal_position – [x, y, theta] of the robot’s goal position
- Returns:
True if the robot can kick the ball
- abstract get_back_up(type: str = 'getupback')[source]
Send a command get back up, based on the get up type
- abstract reset_initial_position()[source]
Set’s the robot’s position based on the amcl_pose :return:
Set’s the robot’s navigation position for the robot to go to :param goal_position: goal_position: [x, y, theta] of the robot’s goal position
Limits the length of the navigation, for example a goal given 2 meters will return a goal determined by the shorten_navigation_limit parameter, if it is 1 then 1 meter max navigation limit :param goal_position: [x, y, theta] of the robot’s goal position