Decision Module
1.0
ICRA2020 AI Challenge Northwestern Polytechnical University Aoxiang Team Strategy Code
|
Go to the documentation of this file.
5 #ifndef ROBORTS_DECISION_TWOROBORTS_CHASE_H
6 #define ROBORTS_DECISION_TWOROBORTS_CHASE_H
10 #include "../blackboard/blackboard.h"
11 #include "../behavior/robot_behaviors.h"
18 std::shared_ptr<Blackboard> p_blackboard,
29 auto current_behavior =
p_my_robot1->GetCurrentBehavior();
30 if (current_behavior !=
CHASE) {
34 current_behavior =
p_my_robot2->GetCurrentBehavior();
35 if (current_behavior !=
CHASE) {
47 const std::shared_ptr<RobotBehaviors> &robotBehaviors) {
48 auto current_behavior = myRobot->GetCurrentBehavior();
49 if (current_behavior ==
ESCAPE) {
50 robotBehaviors->GetEscapeBehavior()->Cancel();
51 }
else if (current_behavior ==
SUPPLY) {
52 robotBehaviors->GetSupplyBehavior()->Cancel();
53 }
else if (current_behavior ==
GOAL) {
54 robotBehaviors->GetGoalBehavior()->Cancel();
72 #endif // ROBORTS_DECISION_TWOROBORTS_CHASE_H
std::shared_ptr< RobotBehaviors > p_robot1_behaviors
Definition: tworoborts_chase.h:67
std::shared_ptr< MyRobot > p_my_robot2
Definition: tworoborts_chase.h:65
std::shared_ptr< RobotBehaviors > p_robot2_behaviors
Definition: tworoborts_chase.h:68
void cancel()
Definition: tworoborts_chase.h:58
@ SUPPLY
Definition: blackboard_common.h:51
@ ESCAPE
Definition: blackboard_common.h:49
static void CancelBehavior(const std::shared_ptr< MyRobot > &myRobot, const std::shared_ptr< RobotBehaviors > &robotBehaviors)
Definition: tworoborts_chase.h:46
@ CHASE
Definition: blackboard_common.h:48
TwoRobortsChase(std::shared_ptr< MyRobot > p_my_robot1, std::shared_ptr< MyRobot > p_my_robot2, std::shared_ptr< Blackboard > p_blackboard, std::shared_ptr< RobotBehaviors > p_robot1_behaviors, std::shared_ptr< RobotBehaviors > p_robot2_behaviors)
Definition: tworoborts_chase.h:16
void run(RobotId emeny_id)
Definition: tworoborts_chase.h:27
std::shared_ptr< Blackboard > p_blackboard_
Definition: tworoborts_chase.h:66
Definition: behavior_test_node.h:14
Definition: tworoborts_chase.h:14
@ GOAL
Definition: blackboard_common.h:50
RobotId
Definition: blackboard_common.h:89
std::shared_ptr< MyRobot > p_my_robot1
Definition: tworoborts_chase.h:64