Thunderbots Project
Loading...
Searching...
No Matches
ReceiverPositionGenerator< ZoneEnum > Class Template Reference

#include <receiver_position_generator.hpp>

Public Member Functions

 ReceiverPositionGenerator (std::shared_ptr< const FieldPitchDivision< ZoneEnum > > pitch_division, TbotsProto::PassingConfig passing_config)
 
std::vector< PointgetBestReceivingPositions (const World &world, unsigned int num_positions, const std::vector< Point > &existing_receiver_positions={}, const std::optional< Point > &pass_origin_override=std::nullopt)
 

Detailed Description

template<class ZoneEnum>
class ReceiverPositionGenerator< ZoneEnum >

This class is responsible for generating the best positions for our pass receivers to go to

Constructor & Destructor Documentation

◆ ReceiverPositionGenerator()

template<class ZoneEnum >
ReceiverPositionGenerator ( std::shared_ptr< const FieldPitchDivision< ZoneEnum > >  pitch_division,
TbotsProto::PassingConfig  passing_config 
)
explicit

Creates a new ReceiverPositionGenerator

Parameters
pitch_divisionThe pitch division to split the receivers into
passing_configThe passing configuration to use when looking for best receiving positions

Member Function Documentation

◆ getBestReceivingPositions()

template<class ZoneEnum >
std::vector< Point > getBestReceivingPositions ( const World world,
unsigned int  num_positions,
const std::vector< Point > &  existing_receiver_positions = {},
const std::optional< Point > &  pass_origin_override = std::nullopt 
)

Generates the best receiving positions for the friendly robots to go to

Parameters
worldThe world to generate the best receiving positions based on
num_positionsThe number of receiving positions to generate
existing_receiver_positionsA set of existing receiver positions that will be avoided, if possible, when generating the new receiver positions.
pass_origin_overrideAn optional override for the position where the pass will be made from. If not provided, the ball position will be used. This could be helpful if you are trying to position the receivers based on the ball's future position.
Returns
A vector of min(num_positions, num_friendly_robots - existing_receiver_positions.size()) positions that the receivers could use.

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