Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions turtlesim/include/turtlesim/turtle_frame.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ private slots:
rclcpp::Service<turtlesim_msgs::srv::Kill>::SharedPtr kill_srv_;
rclcpp::Subscription<rcl_interfaces::msg::ParameterEvent>::SharedPtr parameter_event_sub_;

rclcpp::executors::SingleThreadedExecutor executor_;

typedef std::map<std::string, TurtlePtr> M_Turtle;
M_Turtle turtles_;
uint32_t id_counter_;
Expand Down
4 changes: 3 additions & 1 deletion turtlesim/src/turtle_frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ TurtleFrame::TurtleFrame(rclcpp::Node::SharedPtr & node_handle, QWidget * parent
connect(update_timer_, SIGNAL(timeout()), this, SLOT(onUpdate()));

nh_ = node_handle;
executor_.add_node(nh_);

rcl_interfaces::msg::IntegerRange range;
range.from_value = 0;
range.step = 1;
Expand Down Expand Up @@ -267,7 +269,7 @@ void TurtleFrame::onUpdate()
return;
}

rclcpp::spin_some(nh_);
executor_.spin_some();

updateTurtles();
}
Expand Down