From 9c2b0a98f061dc2a9d5d7bdfea8e9e58816a6c16 Mon Sep 17 00:00:00 2001 From: tasada038 Date: Sat, 11 Mar 2023 19:14:27 +0900 Subject: [PATCH 1/4] Update rspcl_marker.cpp --- src/visualization_marker/rspcl_marker.cpp | 33 +++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/visualization_marker/rspcl_marker.cpp b/src/visualization_marker/rspcl_marker.cpp index 9e7955e..97cb9af 100644 --- a/src/visualization_marker/rspcl_marker.cpp +++ b/src/visualization_marker/rspcl_marker.cpp @@ -209,6 +209,39 @@ class PclSub : public rclcpp::Node // markers.markers.push_back(connection); } + geometry_msgs::msg::Point point_1; + geometry_msgs::msg::Point point_2; + geometry_msgs::msg::Point point_3; + for(int i=0; i<1; i++){ + visualization_msgs::msg::Marker triangle; + triangle.header.frame_id = "camera_color_optical_frame"; + triangle.header.stamp = this->now(); + triangle.ns = "triangle_list"; + triangle.id = i; + triangle.type = visualization_msgs::msg::Marker::TRIANGLE_LIST; + triangle.action = visualization_msgs::msg::Marker::MODIFY; + triangle.scale.x = triangle.scale.y = triangle.scale.z = 1; + triangle.color.r = 0.0; + triangle.color.g = 1.0; + triangle.color.b = 0.0; + triangle.color.a = 1.0; + triangle.lifetime = rclcpp::Duration(0.0); + + point_1.x = geometry_points[i].x; + point_1.y = geometry_points[i].y; + point_1.z = geometry_points[i].z; + point_2.x = geometry_points[i+30].x; + point_2.y = geometry_points[i+30].y; + point_2.z = geometry_points[i+30].z; + point_3.x = geometry_points[i+31].x; + point_3.y = geometry_points[i+31].y; + point_3.z = geometry_points[i+31].z; + triangle.points.push_back(point_1); + triangle.points.push_back(point_2); + triangle.points.push_back(point_3); + markers.markers.push_back(triangle); + } + publisher_m->publish(markers); sensor_msgs::msg::PointCloud2 sensor_msg; From b7f2c069106dc8452fa98fd1de93c9ac98ef4526 Mon Sep 17 00:00:00 2001 From: tasada038 Date: Sat, 8 Apr 2023 11:51:56 +0900 Subject: [PATCH 2/4] update marker --- src/visualization_marker/rspcl_marker.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/visualization_marker/rspcl_marker.cpp b/src/visualization_marker/rspcl_marker.cpp index 97cb9af..d61613e 100644 --- a/src/visualization_marker/rspcl_marker.cpp +++ b/src/visualization_marker/rspcl_marker.cpp @@ -110,7 +110,7 @@ class PclSub : public rclcpp::Node marker.color.g = 1.0; marker.color.b = 1.0; marker.color.a = 1.0; - marker.lifetime = rclcpp::Duration(0.0); + // marker.lifetime = rclcpp::Duration(0.0); // ARROW_r visualization_msgs::msg::Marker arrow_r; @@ -133,7 +133,7 @@ class PclSub : public rclcpp::Node arrow_r.color.g = 0.0; arrow_r.color.b = 0.0; arrow_r.color.a = 1.0; - arrow_r.lifetime = rclcpp::Duration(0.0); + // arrow_r.lifetime = rclcpp::Duration(0.0); // ARROW_g visualization_msgs::msg::Marker arrow_g; @@ -156,7 +156,7 @@ class PclSub : public rclcpp::Node arrow_g.color.g = 1.0; arrow_g.color.b = 0.0; arrow_g.color.a = 1.0; - arrow_g.lifetime = rclcpp::Duration(0.0); + // arrow_g.lifetime = rclcpp::Duration(0.0); // TEXT visualization_msgs::msg::Marker text; @@ -177,7 +177,7 @@ class PclSub : public rclcpp::Node text.color.g = 1.0; text.color.b = 1.0; text.color.a = 1.0; - text.lifetime = rclcpp::Duration(0.0); + // text.lifetime = rclcpp::Duration(0.0); // LINE STRIP visualization_msgs::msg::Marker connection; @@ -192,7 +192,7 @@ class PclSub : public rclcpp::Node connection.color.g = 1.0; connection.color.b = 0.0; connection.color.a = 1.0; - connection.lifetime = rclcpp::Duration(0.0); + // connection.lifetime = rclcpp::Duration(0.0); start_line.x = geometry_points[i].x; start_line.y = geometry_points[i].y; start_line.z = geometry_points[i].z; @@ -225,7 +225,7 @@ class PclSub : public rclcpp::Node triangle.color.g = 1.0; triangle.color.b = 0.0; triangle.color.a = 1.0; - triangle.lifetime = rclcpp::Duration(0.0); + // triangle.lifetime = rclcpp::Duration(0.0); point_1.x = geometry_points[i].x; point_1.y = geometry_points[i].y; From 1033adb9274e9ca6e5b9e1e6a06ed40d0586d0e7 Mon Sep 17 00:00:00 2001 From: wataki0824 Date: Thu, 11 Apr 2024 23:26:42 +0900 Subject: [PATCH 3/4] =?UTF-8?q?build=E9=80=9A=E3=82=8A=E3=81=BE=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/visualization_marker/rspcl_marker.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/visualization_marker/rspcl_marker.cpp b/src/visualization_marker/rspcl_marker.cpp index d61613e..3dfed0b 100644 --- a/src/visualization_marker/rspcl_marker.cpp +++ b/src/visualization_marker/rspcl_marker.cpp @@ -53,7 +53,7 @@ class PclSub : public rclcpp::Node { pcl::PointCloud::Ptr cloud(new pcl::PointCloud); pcl::fromROSMsg(*cloud_msg, *cloud); - RCLCPP_INFO(this->get_logger(), "cloud_size(%d)",cloud->points.size()); + RCLCPP_INFO(this->get_logger(), "cloud_size(%ld)",cloud->points.size()); RCLCPP_INFO(this->get_logger(), "points_size(%d,%d)",cloud_msg->height,cloud_msg->width); // define a new container for the data From aad954124ad97fb53e33a2c99c92e83623a229bc Mon Sep 17 00:00:00 2001 From: wataki0824 Date: Fri, 12 Apr 2024 00:01:26 +0900 Subject: [PATCH 4/4] foo --- src/clustering/rspcl_clustering_component.cpp | 2 +- src/filter/rspcl_filter_component.cpp | 2 +- src/visualization_marker/rspcl_marker.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/clustering/rspcl_clustering_component.cpp b/src/clustering/rspcl_clustering_component.cpp index 939dd56..2650638 100644 --- a/src/clustering/rspcl_clustering_component.cpp +++ b/src/clustering/rspcl_clustering_component.cpp @@ -18,7 +18,7 @@ RspclClusteringComponent::RspclClusteringComponent() : Node("pclsub") { subscriber_ = this->create_subscription( - "/camera/pointcloud", + "/Head/D435_H/depth/color/points", 10, std::bind(&RspclClusteringComponent::timer_callback, this, std::placeholders::_1)\ ); diff --git a/src/filter/rspcl_filter_component.cpp b/src/filter/rspcl_filter_component.cpp index 0fd4419..5987a50 100644 --- a/src/filter/rspcl_filter_component.cpp +++ b/src/filter/rspcl_filter_component.cpp @@ -19,7 +19,7 @@ RspclFilterComponent::RspclFilterComponent() : Node("pclsub") { subscriber_ = this->create_subscription( - "/camera/pointcloud", + "/Head/D435_H/depth/color/points", 10, std::bind(&RspclFilterComponent::timer_callback, this, std::placeholders::_1)\ ); diff --git a/src/visualization_marker/rspcl_marker.cpp b/src/visualization_marker/rspcl_marker.cpp index 3dfed0b..05c8191 100644 --- a/src/visualization_marker/rspcl_marker.cpp +++ b/src/visualization_marker/rspcl_marker.cpp @@ -36,7 +36,7 @@ class PclSub : public rclcpp::Node PclSub(): Node("pclsub") { sub_novel = this->create_subscription( - "/camera/pointcloud", + "/Head/D435_H/depth/color/points", 10, std::bind(&PclSub::topic_callback, this, std::placeholders::_1)\ );