Decision Module  1.0
ICRA2020 AI Challenge Northwestern Polytechnical University Aoxiang Team Strategy Code
roborts_decision::PredictionSystem Class Reference

#include <prediction_system.h>

Public Member Functions

 PredictionSystem (std::shared_ptr< MyRobot > p_my_robot_1, std::shared_ptr< MyRobot > p_my_robot_2, EnemyRobot &enemy_robot_1, EnemyRobot &enemy_robot_2)
 
 PredictionSystem ()=delete
 
 ~PredictionSystem ()=default
 
void UpdatePredictedRemainingProjectiles ()
 
void UpdatePredictedHp ()
 
void UpdatePredictedCurrentHeat ()
 
bool GetEnemyBulletBuffStatus ()
 
bool GetEnemyBloodBuffStatus ()
 
std::vector< roborts_decision::EnemyRobotPredictWhoAttackHome (const std::shared_ptr< roborts_decision::MyRobot > &p_my_robot)
 

Private Member Functions

int PredictBulletNumbersWithDistance (const roborts_common::Point2D &pose_1, const roborts_common::Point2D &pose_2)
 
int PredictSpeedWithDistance (const roborts_common::Point2D &pose_1, const roborts_common::Point2D &pose_2)
 
int PredictDamageToEnemyWithBullets (const int bullets)
 
void NormalizedEnemyAttacker (std::vector< roborts_decision::EnemyRobot > &enemy_to_attack_home_1, std::vector< roborts_decision::EnemyRobot > &enemy_to_attack_home_2)
 

Private Attributes

std::shared_ptr< MyRobotp_my_robot_1_
 
std::shared_ptr< MyRobotp_my_robot_2_
 
std::array< std::shared_ptr< MyRobot >, 2 > all_home_
 
std::shared_ptr< Fieldfield_
 
EnemyRobotenemy_robot_1_
 
EnemyRobotenemy_robot_2_
 
int bullet_shoot_enemy_1_to_home_1_
 
int bullet_shoot_enemy_1_to_home_2_
 
int bullet_shoot_enemy_2_to_home_1_
 
int bullet_shoot_enemy_2_to_home_2_
 
int speed_shoot_enemy_1_to_home_1_
 
int speed_shoot_enemy_1_to_home_2_
 
int speed_shoot_enemy_2_to_home_1_
 
int speed_shoot_enemy_2_to_home_2_
 

Constructor & Destructor Documentation

◆ PredictionSystem() [1/2]

PredictionSystem::PredictionSystem ( std::shared_ptr< MyRobot p_my_robot_1,
std::shared_ptr< MyRobot p_my_robot_2,
EnemyRobot enemy_robot_1,
EnemyRobot enemy_robot_2 
)

◆ PredictionSystem() [2/2]

roborts_decision::PredictionSystem::PredictionSystem ( )
delete

◆ ~PredictionSystem()

roborts_decision::PredictionSystem::~PredictionSystem ( )
default

Member Function Documentation

◆ GetEnemyBloodBuffStatus()

bool PredictionSystem::GetEnemyBloodBuffStatus ( )

◆ GetEnemyBulletBuffStatus()

bool PredictionSystem::GetEnemyBulletBuffStatus ( )

◆ NormalizedEnemyAttacker()

void PredictionSystem::NormalizedEnemyAttacker ( std::vector< roborts_decision::EnemyRobot > &  enemy_to_attack_home_1,
std::vector< roborts_decision::EnemyRobot > &  enemy_to_attack_home_2 
)
private

规范化进攻我方机器人的数据

Parameters
enemy_to_attack_home_1进攻我方1号球员的机器人
enemy_to_attack_home_2进攻我方2号球员的机器人

◆ PredictBulletNumbersWithDistance()

int PredictionSystem::PredictBulletNumbersWithDistance ( const roborts_common::Point2D &  pose_1,
const roborts_common::Point2D &  pose_2 
)
private

◆ PredictDamageToEnemyWithBullets()

int PredictionSystem::PredictDamageToEnemyWithBullets ( const int  bullets)
private

根据我方射击的子弹数预测敌方掉血

Parameters
bullets
Returns

◆ PredictSpeedWithDistance()

int PredictionSystem::PredictSpeedWithDistance ( const roborts_common::Point2D &  pose_1,
const roborts_common::Point2D &  pose_2 
)
private

◆ PredictWhoAttackHome()

std::vector< roborts_decision::EnemyRobot > PredictionSystem::PredictWhoAttackHome ( const std::shared_ptr< roborts_decision::MyRobot > &  p_my_robot)

如果同时有两块夹板被攻击,则敌方两机器人均在攻击 如果只有一块,考虑范围 包括装甲板在内的 2PI/3 范围内,如果敌方机器人在内,并且与我方几何中心没有障碍物 ,则应预测其正在攻击 具体方法:

  1. 如果与2PI/3边界的两条直线夹角均小于2PI/3 则可判断位于范围内
  2. 位于范围内,还需要求与我方机器人之间没有障碍物

◆ UpdatePredictedCurrentHeat()

void PredictionSystem::UpdatePredictedCurrentHeat ( )

◆ UpdatePredictedHp()

void PredictionSystem::UpdatePredictedHp ( )

◆ UpdatePredictedRemainingProjectiles()

void PredictionSystem::UpdatePredictedRemainingProjectiles ( )

Member Data Documentation

◆ all_home_

std::array<std::shared_ptr<MyRobot>, 2> roborts_decision::PredictionSystem::all_home_
private

◆ bullet_shoot_enemy_1_to_home_1_

int roborts_decision::PredictionSystem::bullet_shoot_enemy_1_to_home_1_
private

◆ bullet_shoot_enemy_1_to_home_2_

int roborts_decision::PredictionSystem::bullet_shoot_enemy_1_to_home_2_
private

◆ bullet_shoot_enemy_2_to_home_1_

int roborts_decision::PredictionSystem::bullet_shoot_enemy_2_to_home_1_
private

◆ bullet_shoot_enemy_2_to_home_2_

int roborts_decision::PredictionSystem::bullet_shoot_enemy_2_to_home_2_
private

◆ enemy_robot_1_

EnemyRobot& roborts_decision::PredictionSystem::enemy_robot_1_
private

◆ enemy_robot_2_

EnemyRobot& roborts_decision::PredictionSystem::enemy_robot_2_
private

◆ field_

std::shared_ptr<Field> roborts_decision::PredictionSystem::field_
private

◆ p_my_robot_1_

std::shared_ptr<MyRobot> roborts_decision::PredictionSystem::p_my_robot_1_
private

◆ p_my_robot_2_

std::shared_ptr<MyRobot> roborts_decision::PredictionSystem::p_my_robot_2_
private

◆ speed_shoot_enemy_1_to_home_1_

int roborts_decision::PredictionSystem::speed_shoot_enemy_1_to_home_1_
private

◆ speed_shoot_enemy_1_to_home_2_

int roborts_decision::PredictionSystem::speed_shoot_enemy_1_to_home_2_
private

◆ speed_shoot_enemy_2_to_home_1_

int roborts_decision::PredictionSystem::speed_shoot_enemy_2_to_home_1_
private

◆ speed_shoot_enemy_2_to_home_2_

int roborts_decision::PredictionSystem::speed_shoot_enemy_2_to_home_2_
private

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