soccer_strategy.robot_controlled_2d.RobotControlled2D
- class soccer_strategy.robot_controlled_2d.RobotControlled2D(robot_id=0, team=Team.UNKNOWN, role=Role.UNASSIGNED, status=Status.DISCONNECTED, position=None)[source]
Bases:
RobotControlled
- __init__(robot_id=0, team=Team.UNKNOWN, role=Role.UNASSIGNED, status=Status.DISCONNECTED, position=None)[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
get_opponent_net_position
()get_robot_polygon
()kick
(kick_velocity)Set's a kick velocity for the ball :param kick_velocity: Amount of strength for the kick :return:
observe_ball
(ball)observe_obstacles
(robots)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)
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')
Send a command get back up, based on the get up type
- kick(kick_velocity)[source]
Set’s a kick velocity for the ball :param kick_velocity: Amount of strength for the kick :return:
- abstract reset_initial_position()
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
- abstract terminate_walk()
Send a command to stop the robot’s walking