Skip to content

Commit

Permalink
Fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
rjoomen committed Jul 4, 2024
1 parent a2f1a59 commit d2dd2f1
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
4 changes: 2 additions & 2 deletions tesseract_monitoring/src/environment_monitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ bool ROSEnvironmentMonitor::initialize()
return false;
}

last_update_time_ = last_robot_motion_time_ = node_->now();
last_update_time_ = last_robot_motion_time_ = internal_node_->now();
last_robot_state_update_wall_time_ = rclcpp::Clock().now();

state_update_pending_ = false;
Expand Down Expand Up @@ -642,7 +642,7 @@ void ROSEnvironmentMonitor::startStateMonitor(const std::string& joint_states_to
if (env_)
{
if (!current_state_monitor_)
current_state_monitor_ = std::make_unique<CurrentStateMonitor>(env_, node_);
current_state_monitor_ = std::make_unique<CurrentStateMonitor>(env_, internal_node_);

current_state_monitor_->addUpdateCallback(
std::bind(&ROSEnvironmentMonitor::onJointStateUpdate, this, std::placeholders::_1)); // NOLINT
Expand Down
2 changes: 1 addition & 1 deletion tesseract_rosutils/include/tesseract_rosutils/plotting.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class ROSPlotting : public tesseract_visualization::Visualization
std::string root_link_; /**< Root link of markers */
std::string topic_namespace_; /**< Namespace used when publishing markers */
int marker_counter_{ 0 }; /**< Counter when plotting */
rclcpp::Node::SharedPtr node_;
rclcpp::Node::SharedPtr internal_node_;
rclcpp::executors::MultiThreadedExecutor::SharedPtr internal_node_executor_;
std::shared_ptr<std::thread> internal_node_spinner_;
rclcpp::Publisher<tesseract_msgs::msg::SceneGraph>::SharedPtr scene_pub_; /**< Scene publisher */
Expand Down
26 changes: 17 additions & 9 deletions tesseract_rosutils/src/plotting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,23 @@ static constexpr const char* NODE_ID = "tesseract_rosutils_plotting";
ROSPlotting::ROSPlotting(std::string root_link, std::string topic_namespace)
: root_link_(std::move(root_link)), topic_namespace_(std::move(topic_namespace))
{
node_ = std::make_shared<rclcpp::Node>(NODE_ID);
trajectory_pub_ =
node_->create_publisher<tesseract_msgs::msg::Trajectory>(topic_namespace_ + "/display_tesseract_trajectory", 1);
collisions_pub_ =
node_->create_publisher<visualization_msgs::msg::MarkerArray>(topic_namespace_ + "/display_collisions", 1);
arrows_pub_ = node_->create_publisher<visualization_msgs::msg::MarkerArray>(topic_namespace_ + "/display_arrows", 1);
axes_pub_ = node_->create_publisher<visualization_msgs::msg::MarkerArray>(topic_namespace_ + "/display_axes", 1);
tool_path_pub_ =
node_->create_publisher<visualization_msgs::msg::MarkerArray>(topic_namespace_ + "/display_tool_path", 1);
internal_node_ = std::make_shared<rclcpp::Node>(NODE_ID);
trajectory_pub_ = internal_node_->create_publisher<tesseract_msgs::msg::Trajectory>(topic_namespace_ + "/display_"
"tesseract_"
"trajectory",
1);
collisions_pub_ = internal_node_->create_publisher<visualization_msgs::msg::MarkerArray>(topic_namespace_ + "/display"
"_collisi"
"ons",
1);
arrows_pub_ =
internal_node_->create_publisher<visualization_msgs::msg::MarkerArray>(topic_namespace_ + "/display_arrows", 1);
axes_pub_ =
internal_node_->create_publisher<visualization_msgs::msg::MarkerArray>(topic_namespace_ + "/display_axes", 1);
tool_path_pub_ = internal_node_->create_publisher<visualization_msgs::msg::MarkerArray>(topic_namespace_ + "/display_"
"tool_"
"path",
1);

internal_node_executor_ = std::make_shared<rclcpp::executors::MultiThreadedExecutor>();
internal_node_spinner_ = std::make_shared<std::thread>([this]() {
Expand Down

0 comments on commit d2dd2f1

Please sign in to comment.