mirror of
https://github.com/modelec/modelec-marcel-ROS.git
synced 2026-01-18 16:47:43 +01:00
log
This commit is contained in:
@@ -52,5 +52,7 @@ namespace Modelec
|
||||
float robot_length_ = 0;
|
||||
double robot_radius_ = 0;
|
||||
float min_emergency_distance_ = 0.0f;
|
||||
|
||||
bool verify_ = false;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -61,6 +61,11 @@ namespace Modelec
|
||||
{
|
||||
game_stated_ = true;
|
||||
}
|
||||
|
||||
if (game_stated_ && msg->state == modelec_interfaces::msg::StratState::STOP)
|
||||
{
|
||||
game_stated_ = false;
|
||||
}
|
||||
});
|
||||
|
||||
enemy_long_time_pub_ = this->create_publisher<modelec_interfaces::msg::OdometryPos>(
|
||||
@@ -84,6 +89,11 @@ namespace Modelec
|
||||
|
||||
void EnemyManager::OnLidarData(const sensor_msgs::msg::LaserScan::SharedPtr msg)
|
||||
{
|
||||
if (!game_stated_)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
is_enemy_close_ = false;
|
||||
|
||||
if (std::isnan(current_pos_.x) || std::isnan(current_pos_.y))
|
||||
@@ -243,7 +253,7 @@ namespace Modelec
|
||||
|
||||
void EnemyManager::TimerCallback()
|
||||
{
|
||||
if (!enemy_initialized_)
|
||||
if (!enemy_initialized_ || !game_stated_)
|
||||
return;
|
||||
|
||||
rclcpp::Duration duration_since_last = this->now() - last_publish_time_;
|
||||
|
||||
Reference in New Issue
Block a user