Thunderbots Project
Loading...
Searching...
No Matches
PrimitiveExecutor Class Reference

Public Member Functions

 PrimitiveExecutor (const Duration time_step, const RobotConstants_t &robot_constants, const TeamColour friendly_team_colour, const RobotId robot_id)
 
void updatePrimitive (const TbotsProto::Primitive &primitive_msg)
 
void setStopPrimitive ()
 
void updateVelocity (const Vector &local_velocity, const AngularVelocity &angular_velocity)
 
void setRobotId (RobotId robot_id)
 
std::unique_ptr< TbotsProto::DirectControlPrimitive > stepPrimitive (TbotsProto::PrimitiveExecutorStatus &status)
 

Constructor & Destructor Documentation

◆ PrimitiveExecutor()

PrimitiveExecutor ( const Duration  time_step,
const RobotConstants_t robot_constants,
const TeamColour  friendly_team_colour,
const RobotId  robot_id 
)
explicit

Constructor

Parameters
time_stepTime step which this primitive executor operates in
robot_constantsThe robot constants for the robot which uses this primitive executor
friendly_team_colourThe colour of the friendly team
robot_idThe id of the robot which uses this primitive executor

Member Function Documentation

◆ setRobotId()

void setRobotId ( RobotId  robot_id)

Set the robot id

Parameters
robot_idThe id of the robot which uses this primitive executor

◆ setStopPrimitive()

void setStopPrimitive ( )

Set the current primitive to the stop primitive

◆ stepPrimitive()

std::unique_ptr< TbotsProto::DirectControlPrimitive > stepPrimitive ( TbotsProto::PrimitiveExecutorStatus &  status)

Steps the current primitive and returns a direct control primitive with the target wheel velocities

Parameters
statusThe status of the primitive executor, set to false if current primitive is a Stop primitive
Returns
DirectControlPrimitive The direct control primitive msg

◆ updatePrimitive()

void updatePrimitive ( const TbotsProto::Primitive &  primitive_msg)

Update primitive executor with a new Primitive

Parameters
primitive_msgThe primitive to start

◆ updateVelocity()

void updateVelocity ( const Vector local_velocity,
const AngularVelocity angular_velocity 
)

Update primitive executor with the current velocity of the robot

Parameters
local_velocityThe current local velocity
angular_velocityThe current angular velocity

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