| 210 | } |
| 211 | |
| 212 | void ArmorDetectionNode::StopThread() { |
| 213 | node_state_ = NodeState::IDLE; |
| 214 | running_ = false; |
| 215 | armor_detector_->SetThreadState(false); |
| 216 | if (armor_detection_thread_.joinable()) { |
| 217 | armor_detection_thread_.join(); |
| 218 | } |
| 219 | } |
| 220 | |
| 221 | ArmorDetectionNode::~ArmorDetectionNode() { |
| 222 | StopThread(); |