File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
micro_ros_agent/src/agent/graph_manager Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -126,8 +126,10 @@ GraphManager::GraphManager(eprosima::fastdds::dds::DomainId_t domain_id)
126126 // Set graph cache on change callback function
127127 graphCache_.set_on_change_callback ([this ]()
128128 {
129- std::unique_lock<std::mutex> lock (this ->mtx_ );
130- this ->graph_changed_ = true ;
129+ {
130+ std::unique_lock<std::mutex> lock (this ->mtx_ );
131+ this ->graph_changed_ = true ;
132+ }
131133 this ->cv_ .notify_one ();
132134 });
133135
@@ -144,14 +146,14 @@ inline void GraphManager::publish_microros_graph()
144146 {
145147 return this ->graph_changed_ ;
146148 });
149+ graph_changed_ = false ;
147150 }
148151
149152 if (display_on_change_)
150153 {
151154 std::cout << " Updated uros Graph: graph changed" << std::endl;
152155 std::cout << graphCache_ << std::endl;
153156 }
154- graph_changed_ = false ;
155157
156158 micro_ros_msgs::msg::Graph graph_message;
157159
You can’t perform that action at this time.
0 commit comments