Decision Module
1.0
ICRA2020 AI Challenge Northwestern Polytechnical University Aoxiang Team Strategy Code
|
Go to the documentation of this file.
5 #ifndef ROBORTS_ROBORTS_DECISION_BLACKBOARD_RMROBOT_H_
6 #define ROBORTS_ROBORTS_DECISION_BLACKBOARD_RMROBOT_H_
11 #include <geometry_msgs/PoseStamped.h>
12 #include <std_msgs/Bool.h>
14 #include <roborts_msgs/ArmorsDetected.h>
15 #include <roborts_msgs/RobotStatus.h>
17 #include <actionlib/client/simple_action_client.h>
19 #include <tf/transform_listener.h>
21 #include <roborts_msgs/RobotHeat.h>
22 #include <roborts_msgs/RobotDamage.h>
23 #include <roborts_msgs/ShootInfo.h>
27 #include "../executor/gimbal_executor.h"
28 #include "../executor/chassis_executor.h"
29 #include "../../roborts_common/math/math.h"
35 explicit MyRobot(
RobotId id,
const ros::NodeHandle &nh = ros::NodeHandle(
"~"));
112 void setNextPoint(
const roborts_common::Point2D &nextPoint);
120 void spinForword(
const double &tarX,
const double &tarY);
137 [[deprecated(
"当前跑位默认使用避障,暂无不适用避障的接口")]]
173 void setGimbalOdomPose(
const double &gimbal_goal_map_pitch,
const double &gimbal_goal_map_yaw);
176 roborts_msgs::GimbalAngle
shootAimed(geometry_msgs::Point32 &target);
189 void HeatCallback(
const roborts_msgs::RobotHeat::ConstPtr &msg);
209 std::shared_ptr<tf::TransformListener>
tf_ptr_;
227 constexpr
static double kHeat = 0.1;
267 #endif //ROBORTS_ROBORTS_DECISION_BLACKBOARD_RMROBOT_H_
roborts_common::Point2D getMyRobotPoint() const
Definition: my_robot.cpp:564
std::shared_ptr< ChassisExecutor > getPChassisExecutor()
Definition: my_robot.cpp:261
double tNoMove
Definition: my_robot.h:229
void ArmorsUnderAttackCallback(const roborts_msgs::RobotDamage::ConstPtr &msg)
Definition: my_robot.cpp:89
bool isShot() const
Definition: my_robot.cpp:257
int current_heat_
Definition: my_robot.h:219
std::shared_ptr< GimbalExecutor > getPGimbalExecutor()
Definition: my_robot.cpp:265
roborts_msgs::ArmorsDetected armors_in_eyes_
Definition: my_robot.h:242
constexpr static double kHeat
Definition: my_robot.h:227
void avoidanceMove(double x, double y)
Definition: my_robot.cpp:491
const geometry_msgs::PoseStamped & getChassisMapPose() const
Definition: my_robot.cpp:181
int GetShootEnemyId()
Definition: my_robot.cpp:597
void UpdateGimbalOdomPose()
Definition: my_robot.cpp:324
const geometry_msgs::PoseStamped & getGimbalOdomPose()
Definition: my_robot.cpp:193
MyRobotBehavior getCurrentBehavior() const
Definition: my_robot.cpp:201
int shoot_bullets_this_time_
Definition: my_robot.h:239
void HeatCallback(const roborts_msgs::RobotHeat::ConstPtr &msg)
Definition: my_robot.cpp:93
bool isSurvival() const
Definition: my_robot.cpp:161
RobotType getRobotType() const
Definition: my_robot.cpp:117
void setCurrentBehavior(MyRobotBehavior current_behavior)
Definition: my_robot.cpp:205
double getSafeDirection(const geometry_msgs::PoseStamped &pose_enemy)
Definition: my_robot.cpp:494
int max_hp_
Definition: my_robot.h:218
bool operator!=(const MyRobot &rhs) const
Definition: my_robot.cpp:213
roborts_decision::Signal signal_
Definition: my_robot.h:262
std::shared_ptr< GimbalExecutor > p_gimbal_executor_
Definition: my_robot.h:254
double getEffectiveShootDistance() const
Definition: my_robot.cpp:506
void UpdateGimbalMapPose()
Definition: my_robot.cpp:302
const geometry_msgs::PoseStamped & getChassisOdomPose()
Definition: my_robot.cpp:185
double TowardWPosShoot(double tar_x, double tar_y, double tar_z)
Definition: my_robot.cpp:391
void stayStill()
Definition: my_robot.cpp:486
ros::NodeHandle nh_
Definition: my_robot.h:200
geometry_msgs::PoseStamped chassis_odom_pose_
Definition: my_robot.h:245
geometry_msgs::PoseStamped gimbal_map_pose_
Definition: my_robot.h:247
constexpr static double kBullet
Definition: my_robot.h:226
ArmorId
Definition: blackboard_common.h:54
const roborts_common::Point2D & getNextPoint() const
Definition: my_robot.cpp:510
std::shared_ptr< std::thread > p_ros_spin_thread_
Definition: my_robot.h:212
void setRobotType(RobotType robot_type)
Definition: my_robot.cpp:145
void setNextPoint(const roborts_common::Point2D &nextPoint)
Definition: my_robot.cpp:514
int getRemainingProjectiles() const
Definition: my_robot.cpp:157
uint32_t getStatusCode()
Definition: my_robot.cpp:269
int shoot_enemy_id_
Definition: my_robot.h:237
int remaining_hp_
Definition: my_robot.h:217
int remaining_projectiles_
Definition: my_robot.h:233
constexpr static int MAX
最大数
Definition: blackboard_common.h:26
bool is_survival_
Definition: my_robot.h:235
ros::Subscriber armors_in_eyes_sub_
Definition: my_robot.h:205
void SetShootEnemyId(const int id)
Definition: my_robot.cpp:600
bool operator==(const MyRobot &rhs) const
Definition: my_robot.cpp:209
roborts_common::Point2D nextPoint_
Definition: my_robot.h:260
RobotId id_
Definition: my_robot.h:214
ros::Subscriber armors_under_attack_sub_
Definition: my_robot.h:203
int GetShootNulletsNumber()
Definition: my_robot.cpp:603
roborts_msgs::GimbalAngle shootAimed(geometry_msgs::Point32 &target)
Definition: my_robot.cpp:430
RobotType robot_type_
Definition: my_robot.h:215
bool no_shoot_
Definition: my_robot.h:222
const std::vector< ArmorId > & getArmorsUnderAttack() const
Definition: my_robot.cpp:173
double changeFrictionWheelSpeedToShootSpeed(double frictionWhellSpeed)
Definition: my_robot.cpp:575
ros::Subscriber heat_sub_
Definition: my_robot.h:204
bool isNoShoot() const
Definition: my_robot.cpp:249
Signal getSignal() const
Definition: my_robot.cpp:518
ros::Subscriber robot_map_pose_sub_
Definition: my_robot.h:207
Signal
Signal for interaction between robot.
Definition: blackboard_common.h:119
bool isNoMove() const
Definition: my_robot.cpp:245
std::shared_ptr< std::thread > tf_thread_ptr_
Definition: my_robot.h:210
void RemainingProjectilesCallback(const roborts_msgs::ShootInfo::ConstPtr &msg)
Definition: my_robot.cpp:109
void setSignal(Signal signal)
Definition: my_robot.cpp:522
void setGimbalOdomPose(const double &gimbal_goal_map_pitch, const double &gimbal_goal_map_yaw)
Definition: my_robot.cpp:459
Definition: behavior_test_node.h:14
void SetHomeShootParameter()
Definition: my_robot.cpp:620
void shoot()
Definition: my_robot.cpp:273
void SetHomeMoveParameter()
Definition: my_robot.cpp:624
double getState() const
Definition: my_robot.cpp:612
geometry_msgs::PoseStamped gimbal_odom_pose_
Definition: my_robot.h:248
void UpdateChassisOdomPose()
Definition: my_robot.cpp:279
ros::Subscriber remaining_projectiles_sub_
Definition: my_robot.h:202
geometry_msgs::PoseStamped chassis_map_pose_
Definition: my_robot.h:244
void spinInPlace(const double &angularVelocity)
Definition: my_robot.cpp:350
Definition: my_robot.h:33
RobotId
Definition: blackboard_common.h:89
MyRobot(RobotId id, const ros::NodeHandle &nh=ros::NodeHandle("~"))
Definition: my_robot.cpp:11
MyRobotBehavior current_behavior_
Definition: my_robot.h:251
void keepDirectionMove(double tar_x, double tar_y, double direction)
Definition: my_robot.cpp:378
void SetShootNulletsNumber(const int num_bullets)
Definition: my_robot.cpp:606
void ArmorsInEyesCallback(const roborts_msgs::ArmorsDetected::ConstPtr &msg)
Definition: my_robot.cpp:105
int shootBulletsMaxNumber(double speed) const
Definition: my_robot.cpp:570
double tNoShoot
Definition: my_robot.h:228
void update()
Definition: my_robot.cpp:526
ros::Subscriber robot_status_sub_
Definition: my_robot.h:206
const roborts_msgs::ArmorsDetected & getArmorsInEyes() const
Definition: my_robot.cpp:177
void RobotStatusCallback(const roborts_msgs::RobotStatus::ConstPtr &msg)
Definition: my_robot.cpp:97
void ChassisMapPoseCallback(const geometry_msgs::PoseStamped::ConstPtr &msg)
Definition: my_robot.cpp:241
std::string robotTypeToString(const RobotType robot_type)
Definition: my_robot.cpp:121
MyRobotBehavior
Definition: blackboard_common.h:47
double GetArmorTowards(ArmorId armor_id)
Definition: my_robot.cpp:578
int getCurrentHeat() const
Definition: my_robot.cpp:153
void spinForword(const double &tarX, const double &tarY)
Definition: my_robot.cpp:360
bool no_move_
Definition: my_robot.h:221
ros::Publisher shoot_pub_
Definition: my_robot.h:256
const geometry_msgs::PoseStamped & getGimbalMapPose()
Definition: my_robot.cpp:189
int getHp() const
Definition: my_robot.cpp:149
RobotId GetId() const
Definition: my_robot.cpp:113
std::shared_ptr< tf::TransformListener > tf_ptr_
Definition: my_robot.h:209
void setIsSurvival(bool is_survival)
Definition: my_robot.cpp:165
std::vector< ArmorId > armors_under_attack_
Definition: my_robot.h:241
constexpr static double kBlood
Definition: my_robot.h:225
std::shared_ptr< ChassisExecutor > p_chassis_executor_
Definition: my_robot.h:253
RobotType
Definition: blackboard_common.h:81