Code Examples
A repository of 155 code examples for BeepBeep
robot.RobotEvent Class Reference

Event representing the status of a fictional robot that moves in a two-dimensional space. More...

Classes

class  GetAngle
 BeepBeep function that extracts the orientation of a RobotEvent.
 
class  GetPosition
 BeepBeep function that extracts the x-position of a RobotEvent.
 
class  GetVelocity
 BeepBeep function that extracts the velocity of a RobotEvent.
 

Public Member Functions

 RobotEvent (Vector< Float > position, Vector< Float > velocity, float theta)
 Creates a new robot event. More...
 
Vector< Float > getPosition ()
 Gets the position of the robot. More...
 
Vector< Float > getVelocity ()
 Gets the velocity of the robot. More...
 
float getOrientation ()
 Gets the angle of orientation of the robot. More...
 
String toString ()
 

Static Public Attributes

static final GetPosition getPos = new GetPosition()
 Static reference to the function GetPosition.
 
static final GetVelocity getVel = new GetVelocity()
 Static reference to the function GetVelocity.
 
static final GetAngle getAngle = new GetAngle()
 Static reference to the function GetAngle.
 

Protected Attributes

final Vector< Float > m_position
 A vector indicating the position of the robot.
 
final Vector< Float > m_velocity
 A vector indicating the velocity of the robot.
 
final float m_theta
 The the angle of orientation of the robot (in radians).
 

Detailed Description

Event representing the status of a fictional robot that moves in a two-dimensional space.

Author
Sylvain Hallé

Definition at line 29 of file RobotEvent.java.

Constructor & Destructor Documentation

◆ RobotEvent()

robot.RobotEvent.RobotEvent ( Vector< Float >  position,
Vector< Float >  velocity,
float  theta 
)

Creates a new robot event.

Parameters
positionThe position of the robot
velocityThe velocity of the robot
thetaThe angle of orientation of the robot (in radians)

Definition at line 67 of file RobotEvent.java.

68  {
69  super();
70  m_position = position;
71  m_velocity = velocity;
72  m_theta = theta;
73  }
final Vector< Float > m_velocity
A vector indicating the velocity of the robot.
Definition: RobotEvent.java:54
final Vector< Float > m_position
A vector indicating the position of the robot.
Definition: RobotEvent.java:49
final float m_theta
The the angle of orientation of the robot (in radians).
Definition: RobotEvent.java:59

Member Function Documentation

◆ getOrientation()

float robot.RobotEvent.getOrientation ( )

Gets the angle of orientation of the robot.

Returns
The angle (in radians)

Definition at line 97 of file RobotEvent.java.

98  {
99  return m_theta;
100  }
final float m_theta
The the angle of orientation of the robot (in radians).
Definition: RobotEvent.java:59

◆ getPosition()

Vector<Float> robot.RobotEvent.getPosition ( )

Gets the position of the robot.

Returns
The position

Definition at line 79 of file RobotEvent.java.

80  {
81  return m_position;
82  }
final Vector< Float > m_position
A vector indicating the position of the robot.
Definition: RobotEvent.java:49

◆ getVelocity()

Vector<Float> robot.RobotEvent.getVelocity ( )

Gets the velocity of the robot.

Returns
The velocity

Definition at line 88 of file RobotEvent.java.

89  {
90  return m_velocity;
91  }
final Vector< Float > m_velocity
A vector indicating the velocity of the robot.
Definition: RobotEvent.java:54

The documentation for this class was generated from the following file: