diff --git a/examples/broken_sequence.cpp b/examples/broken_sequence.cpp index 032d242f9..51927f1bf 100644 --- a/examples/broken_sequence.cpp +++ b/examples/broken_sequence.cpp @@ -35,7 +35,7 @@ class ActionTestNode : public ActionNode private: int time_; - std::atomic_bool stop_loop_; + std::atomic_bool stop_loop_ = false; }; int main() diff --git a/include/behaviortree_cpp/action_node.h b/include/behaviortree_cpp/action_node.h index 5f332917c..93a4a996f 100644 --- a/include/behaviortree_cpp/action_node.h +++ b/include/behaviortree_cpp/action_node.h @@ -132,7 +132,7 @@ class ThreadedAction : public ActionNodeBase private: std::exception_ptr exptr_; - std::atomic_bool halt_requested_; + std::atomic_bool halt_requested_ = false; std::future thread_handle_; std::mutex mutex_; }; @@ -183,7 +183,7 @@ class StatefulActionNode : public ActionNodeBase void halt() override final; private: - std::atomic_bool halt_requested_; + std::atomic_bool halt_requested_ = false; }; /** diff --git a/include/behaviortree_cpp/actions/sleep_node.h b/include/behaviortree_cpp/actions/sleep_node.h index 553116a92..b97e3cdaa 100644 --- a/include/behaviortree_cpp/actions/sleep_node.h +++ b/include/behaviortree_cpp/actions/sleep_node.h @@ -38,7 +38,7 @@ class SleepNode : public StatefulActionNode TimerQueue<> timer_; uint64_t timer_id_; - std::atomic_bool timer_waiting_; + std::atomic_bool timer_waiting_ = false; std::mutex delay_mutex_; }; diff --git a/include/behaviortree_cpp/actions/test_node.h b/include/behaviortree_cpp/actions/test_node.h index f410a27a6..e56c6a978 100644 --- a/include/behaviortree_cpp/actions/test_node.h +++ b/include/behaviortree_cpp/actions/test_node.h @@ -88,7 +88,7 @@ class TestNode : public BT::StatefulActionNode TestNodeConfig _test_config; ScriptFunction _executor; TimerQueue<> _timer; - std::atomic_bool _completed; + std::atomic_bool _completed = false; }; } // namespace BT diff --git a/include/behaviortree_cpp/decorators/delay_node.h b/include/behaviortree_cpp/decorators/delay_node.h index de09866d4..52f9596d8 100644 --- a/include/behaviortree_cpp/decorators/delay_node.h +++ b/include/behaviortree_cpp/decorators/delay_node.h @@ -56,11 +56,11 @@ class DelayNode : public DecoratorNode virtual BT::NodeStatus tick() override; - bool delay_started_; - std::atomic_bool delay_complete_; - bool delay_aborted_; + bool delay_started_ = false; + std::atomic_bool delay_complete_ = false; + bool delay_aborted_ = false; unsigned msec_; - bool read_parameter_from_ports_; + bool read_parameter_from_ports_ = false; std::mutex delay_mutex_; }; diff --git a/include/behaviortree_cpp/decorators/timeout_node.h b/include/behaviortree_cpp/decorators/timeout_node.h index e71a1e936..dc2cb54a0 100644 --- a/include/behaviortree_cpp/decorators/timeout_node.h +++ b/include/behaviortree_cpp/decorators/timeout_node.h @@ -73,7 +73,7 @@ class TimeoutNode : public DecoratorNode void halt() override; TimerQueue<> timer_; - std::atomic_bool child_halted_; + std::atomic_bool child_halted_ = false; uint64_t timer_id_; unsigned msec_; diff --git a/src/loggers/groot2_publisher.cpp b/src/loggers/groot2_publisher.cpp index 7682e3daf..f40ae1c66 100644 --- a/src/loggers/groot2_publisher.cpp +++ b/src/loggers/groot2_publisher.cpp @@ -73,7 +73,7 @@ struct Groot2Publisher::PImpl std::string tree_xml; - std::atomic_bool active_server; + std::atomic_bool active_server = false; std::thread server_thread; std::mutex status_mutex;