Skip to content

Commit

Permalink
Generate unique node name for ROSPlotting
Browse files Browse the repository at this point in the history
  • Loading branch information
rjoomen committed Oct 24, 2024
1 parent 63541d8 commit 3b7e8b0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tesseract_rosutils/src/plotting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ 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))
{
internal_node_ = std::make_shared<rclcpp::Node>(NODE_ID);
// Create a unique name for the node
char node_name[45]; // NOLINT
snprintf(node_name, sizeof(node_name), "%s_%zx", NODE_ID, reinterpret_cast<size_t>(this)); // NOLINT
internal_node_ = std::make_shared<rclcpp::Node>(node_name);
trajectory_pub_ = internal_node_->create_publisher<tesseract_msgs::msg::Trajectory>(topic_namespace_ + "/display_"
"tesseract_"
"trajectory",
Expand Down

0 comments on commit 3b7e8b0

Please sign in to comment.