Skip to content

Commit

Permalink
Modify something wrong.
Browse files Browse the repository at this point in the history
  • Loading branch information
liyixin135 committed Jul 10, 2024
1 parent c9a66c6 commit a128ffd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion include/rm_manual/chassis_gimbal_shooter_manual.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,6 @@ class ChassisGimbalShooterManual : public ChassisGimbalManual
adjust_image_transmission_ = false;
double yaw_current_{};
ros::Time hit_time_;
int count_{}, target_hit_by_dart{}, time_hit_by_dart{}, last_time_hit_by_dart{};
int count_{}, target_hit_by_dart_{}, time_hit_by_dart_{}, last_time_hit_by_dart_{};
};
} // namespace rm_manual
16 changes: 8 additions & 8 deletions src/chassis_gimbal_shooter_manual.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -629,24 +629,24 @@ void ChassisGimbalShooterManual::ctrlQPress()
void ChassisGimbalShooterManual::eventDartCallback(const rm_msgs::EventData::ConstPtr& data)
{
ChassisGimbalManual::eventDartCallback(data);
time_hit_by_dart = data->be_hit_time;
target_hit_by_dart = data->be_hit_target;
time_hit_by_dart_ = data->be_hit_time;
target_hit_by_dart_ = data->be_hit_target;
judgeIsAuto();
}

void ChassisGimbalShooterManual::judgeIsAuto()
{
if (time_hit_by_dart != last_time_hit_by_dart)
if (time_hit_by_dart_ != last_time_hit_by_dart_)
{
last_time_hit_by_dart = time_hit_by_dart;
last_time_hit_by_dart_ = time_hit_by_dart_;
hit_time_ = ros::Time::now();
is_auto_ = true;
}
if ((target_hit_by_dart == 1 && (ros::Time::now() - hit_time_).toSec() >= 5) ||
(target_hit_by_dart == 2 && (ros::Time::now() - hit_time_).toSec() >= 10) ||
(target_hit_by_dart == 3 && (ros::Time::now() - hit_time_).toSec() >= 15))
if ((target_hit_by_dart_ == 1 && (ros::Time::now() - hit_time_).toSec() >= 5) ||
(target_hit_by_dart_ == 2 && (ros::Time::now() - hit_time_).toSec() >= 10) ||
(target_hit_by_dart_ == 3 && (ros::Time::now() - hit_time_).toSec() >= 15))
is_auto_ = false;
if (target_hit_by_dart == 0)
if (target_hit_by_dart_ == 0)
is_auto_ = false;
}

Expand Down

0 comments on commit a128ffd

Please sign in to comment.