Skip to content

Commit

Permalink
Modify function and variable name.
Browse files Browse the repository at this point in the history
  • Loading branch information
liyixin135 committed Apr 19, 2024
1 parent ffeb128 commit 6281ff3
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions rm_common/include/rm_common/decision/command_sender.h
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,9 @@ class ShooterCommandSender : public TimeStampCommandSenderBase<rm_msgs::ShootCmd
{
gimbal_des_error_ = error;
}
void updateAllowShoot(const rm_msgs::ShootBeforehandCmd& data)
void updateShootBeforehandCmd(const rm_msgs::ShootBeforehandCmd& data)
{
allow_shoot_ = data;
shoot_beforehand_cmd_ = data;
}
void updateTrackData(const rm_msgs::TrackData& data)
{
Expand All @@ -374,11 +374,11 @@ class ShooterCommandSender : public TimeStampCommandSenderBase<rm_msgs::ShootCmd
}
void checkError(const ros::Time& time)
{
if (msg_.mode == rm_msgs::ShootCmd::PUSH && time - allow_shoot_.stamp < ros::Duration(0.1))
if (msg_.mode == rm_msgs::ShootCmd::PUSH && time - shoot_beforehand_cmd_.stamp < ros::Duration(0.1))
{
if (allow_shoot_.cmd == rm_msgs::ShootBeforehandCmd::ALLOW_SHOOT)
if (shoot_beforehand_cmd_.cmd == rm_msgs::ShootBeforehandCmd::ALLOW_SHOOT)
return;
if (allow_shoot_.cmd == rm_msgs::ShootBeforehandCmd::BAN_SHOOT)
if (shoot_beforehand_cmd_.cmd == rm_msgs::ShootBeforehandCmd::BAN_SHOOT)
{
setMode(rm_msgs::ShootCmd::READY);
return;
Expand All @@ -387,8 +387,8 @@ class ShooterCommandSender : public TimeStampCommandSenderBase<rm_msgs::ShootCmd
if ((((gimbal_des_error_.error > gimbal_error_tolerance_ && time - gimbal_des_error_.stamp < ros::Duration(0.1)) ||
(track_data_.accel > target_acceleration_tolerance_)) ||
(!suggest_fire_.data && armor_type_ == rm_msgs::StatusChangeRequest::ARMOR_OUTPOST_BASE)) ||
(allow_shoot_.cmd == rm_msgs::ShootBeforehandCmd::JUDGE_BY_ERROR &&
time - allow_shoot_.stamp < ros::Duration(0.1)))
(shoot_beforehand_cmd_.cmd == rm_msgs::ShootBeforehandCmd::JUDGE_BY_ERROR &&
time - shoot_beforehand_cmd_.stamp < ros::Duration(0.1)))
if (msg_.mode == rm_msgs::ShootCmd::PUSH)
setMode(rm_msgs::ShootCmd::READY);
}
Expand Down Expand Up @@ -477,7 +477,7 @@ class ShooterCommandSender : public TimeStampCommandSenderBase<rm_msgs::ShootCmd
double total_extra_wheel_speed_{};
rm_msgs::TrackData track_data_;
rm_msgs::GimbalDesError gimbal_des_error_;
rm_msgs::ShootBeforehandCmd allow_shoot_;
rm_msgs::ShootBeforehandCmd shoot_beforehand_cmd_;
std_msgs::Bool suggest_fire_;
uint8_t armor_type_{};
};
Expand Down

0 comments on commit 6281ff3

Please sign in to comment.