Skip to content

Commit

Permalink
Use node to create clock used to stamp publications (#407)
Browse files Browse the repository at this point in the history
  • Loading branch information
cottsay authored and clalancette committed Jun 12, 2019
1 parent b2b9aa8 commit f15d0ea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class RosNodeAbstractionIface
get_topic_names_and_types() const = 0;

// TODO(anhosi): remove once the RosNodeAbstraction is extended to handle subscriptions
// and clock
virtual rclcpp::Node::SharedPtr
get_raw_node() = 0;
};
Expand Down
2 changes: 1 addition & 1 deletion rviz_common/src/rviz_common/visualization_frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ void VisualizationFrame::initialize(
// render_panel and VisualizationManager
render_panel_->getRenderWindow()->initialize();

auto clock = std::make_shared<rclcpp::Clock>(RCL_ROS_TIME);
auto clock = rviz_ros_node.lock()->get_raw_node()->get_clock();
manager_ = new VisualizationManager(render_panel_, rviz_ros_node, this, clock);
manager_->setHelpPath(help_path_);
panel_factory_ = new PanelFactory(rviz_ros_node_, manager_);
Expand Down

0 comments on commit f15d0ea

Please sign in to comment.