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

Public Member Functions

 RobotFilter (Robot current_robot_state, Duration expiry_buffer_duration)
 
 RobotFilter (RobotDetection current_robot_state, Duration expiry_buffer_duration)
 
std::optional< RobotgetFilteredData (const std::vector< RobotDetection > &new_robot_data)
 
unsigned int getRobotId () const
 

Constructor & Destructor Documentation

◆ RobotFilter()

RobotFilter ( Robot  current_robot_state,
Duration  expiry_buffer_duration 
)
explicit

Creates a new robot filter

Parameters
current_robot_statethe data of current state of the robot
expiry_buffer_durationthe time when the robot is determined to be removed from the field if data about the robot is not received before that time

Member Function Documentation

◆ getFilteredData()

std::optional< Robot > getFilteredData ( const std::vector< RobotDetection > &  new_robot_data)

Updates the filter given a new set of data, and returns the most up to date filtered data for the Robot.

Parameters
new_robot_dataA list of SSLRobot detections containing new robot data. The data does not all have to be for a particular Robot, the filter will only use the new Robot data that matches the robot id the filter was constructed with.
Returns
The filtered data for the robot

◆ getRobotId()

unsigned int getRobotId ( ) const

Returns the id of the Robot that this filter is filtering for

Returns
the id of the Robot that this filter is filtering for

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