You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calling pcl::visualization::PCLVisualizer spinOnce() in a child thread terminates the program (core dump)
Current Behavior
ERROR: In /build/vtk7-kRjOS9/vtk7-7.1.1+dfsg2/Rendering/OpenGL2/vtkShaderProgram.cxx, line 379
vtkShaderProgram (0xffff601fb7f0): 1: #version 120
2: #ifdef GL_ES
3: #if VERSION == 300
4: #define attribute in
5: #define varying out
6: #endif // 300
7: #else // GL_ES
8: #define highp
9: #define mediump
10: #define lowp
11: #if VERSION == 150
12: #define attribute in
13: #define varying out
14: #endif
15: #endif // GL_ES
16:
17:
18: /=========================================================================
19:
20: Program: Visualization Toolkit
21: Module: vtkPolyDataVS.glsl
22:
23: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
24: All rights reserved.
25: See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
26:
27: This software is distributed WITHOUT ANY WARRANTY; without even
28: the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
29: PURPOSE. See the above copyright notice for more information.
30:
31: =========================================================================/
32:
33: attribute vec4 vertexMC;
34:
35: // frag position in VC
36: varying vec4 vertexVCVSOutput;
37:
38: // optional normal declaration
39: //VTK::Normal::Dec
40:
41: // extra lighting parameters
42: //VTK::Light::Dec
43:
44: // Texture coordinates
45: //VTK::TCoord::Dec
46:
47: // material property values
48: //VTK::Color::Dec
49:
50: // clipping plane vars
51: //VTK::Clip::Dec
52:
53: // camera and actor matrix values
54: uniform mat4 MCDCMatrix;
55: uniform mat4 MCVCMatrix;
56:
57: // Apple Bug
58: //VTK::PrimID::Dec
59:
60: // Value raster
61: //VTK::ValuePass::Dec
62:
63: void main()
64: {
65: //VTK::Color::Impl
66:
67: //VTK::Normal::Impl
68:
69: //VTK::TCoord::Impl
70:
71: //VTK::Clip::Impl
72:
73: //VTK::PrimID::Impl
74:
75: vertexVCVSOutput = MCVCMatrix * vertexMC;
76: gl_Position = MCDCMatrix * vertexMC;
77:
78:
79: //VTK::ValuePass::Impl
80:
81: //VTK::Light::Impl
82: }
83:
ERROR: In /build/vtk7-kRjOS9/vtk7-7.1.1+dfsg2/Rendering/OpenGL2/vtkShaderProgram.cxx, line 380
vtkShaderProgram (0xffff601fb7f0):
Segmentation fault (core dumped)
To Reproduce
In the following code, the commented out code works fine, but if the code is executed in the child thread, an error will be reported and core dump will occur
GodLiu1
changed the title
[pcl] Provide a general summary of the issue
the visualization: : PCLVisualizer spinOnce() in child thread calls it the core dump
Dec 23, 2024
Describe the bug
Calling pcl::visualization::PCLVisualizer spinOnce() in a child thread terminates the program (core dump)
Current Behavior
ERROR: In /build/vtk7-kRjOS9/vtk7-7.1.1+dfsg2/Rendering/OpenGL2/vtkShaderProgram.cxx, line 379
vtkShaderProgram (0xffff601fb7f0): 1: #version 120
2: #ifdef GL_ES
3: #if VERSION == 300
4: #define attribute in
5: #define varying out
6: #endif // 300
7: #else // GL_ES
8: #define highp
9: #define mediump
10: #define lowp
11: #if VERSION == 150
12: #define attribute in
13: #define varying out
14: #endif
15: #endif // GL_ES
16:
17:
18: /=========================================================================
19:
20: Program: Visualization Toolkit
21: Module: vtkPolyDataVS.glsl
22:
23: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
24: All rights reserved.
25: See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
26:
27: This software is distributed WITHOUT ANY WARRANTY; without even
28: the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
29: PURPOSE. See the above copyright notice for more information.
30:
31: =========================================================================/
32:
33: attribute vec4 vertexMC;
34:
35: // frag position in VC
36: varying vec4 vertexVCVSOutput;
37:
38: // optional normal declaration
39: //VTK::Normal::Dec
40:
41: // extra lighting parameters
42: //VTK::Light::Dec
43:
44: // Texture coordinates
45: //VTK::TCoord::Dec
46:
47: // material property values
48: //VTK::Color::Dec
49:
50: // clipping plane vars
51: //VTK::Clip::Dec
52:
53: // camera and actor matrix values
54: uniform mat4 MCDCMatrix;
55: uniform mat4 MCVCMatrix;
56:
57: // Apple Bug
58: //VTK::PrimID::Dec
59:
60: // Value raster
61: //VTK::ValuePass::Dec
62:
63: void main()
64: {
65: //VTK::Color::Impl
66:
67: //VTK::Normal::Impl
68:
69: //VTK::TCoord::Impl
70:
71: //VTK::Clip::Impl
72:
73: //VTK::PrimID::Impl
74:
75: vertexVCVSOutput = MCVCMatrix * vertexMC;
76: gl_Position = MCDCMatrix * vertexMC;
77:
78:
79: //VTK::ValuePass::Impl
80:
81: //VTK::Light::Impl
82: }
83:
ERROR: In /build/vtk7-kRjOS9/vtk7-7.1.1+dfsg2/Rendering/OpenGL2/vtkShaderProgram.cxx, line 380
vtkShaderProgram (0xffff601fb7f0):
Segmentation fault (core dumped)
To Reproduce
In the following code, the commented out code works fine, but if the code is executed in the child thread, an error will be reported and core dump will occur
`// #include <rclcpp/rclcpp.hpp>
// #include <sensor_msgs/msg/point_cloud2.hpp>
// #include <pcl/point_cloud.h>
// #include <pcl/point_types.h>
// #include <pcl/visualization/pcl_visualizer.h>
// #include <pcl_conversions/pcl_conversions.h>
// class PointCloudSubscriber : public rclcpp::Node {
// public:
// PointCloudSubscriber()
// : Node("point_cloud_subscriber"), viewer("PointCloud Viewer") {
// // 创建订阅器
// subscription_ = this->create_subscription<sensor_msgs::msg::PointCloud2>(
// "/front/tanway_points", 10,
// std::bind(&PointCloudSubscriber::pointCloudCallback, this, std::placeholders::_1));
// // 初始化 PCL 可视化器
// viewer.setBackgroundColor(0, 0, 0);
// viewer.addCoordinateSystem(1.0);
// viewer.initCameraParameters();
// }
// void spin() {
// while (rclcpp::ok()) {
// rclcpp::spin_some(this->get_node_base_interface());
// }
// }
// private:
// void pointCloudCallback(const sensor_msgs::msg::PointCloud2::SharedPtr msg) {
// pcl::PointCloudpcl::PointXYZ::Ptr cloud(new pcl::PointCloudpcl::PointXYZ());
// pcl::fromROSMsg(*msg, *cloud);
// // 更新点云到可视化器
// if (!viewer.updatePointCloudpcl::PointXYZ(cloud, "sample cloud")) {
// viewer.addPointCloudpcl::PointXYZ(cloud, "sample cloud");
// }
// viewer.spinOnce(100);
// }
// rclcpp::Subscription<sensor_msgs::msg::PointCloud2>::SharedPtr subscription_;
// pcl::visualization::PCLVisualizer viewer;
// };
// int main(int argc, char** argv) {
// rclcpp::init(argc, argv);
// auto node = std::make_shared();
// node->spin();
// rclcpp::shutdown();
// return 0;
// }
#include <rclcpp/rclcpp.hpp>
#include <sensor_msgs/msg/point_cloud2.hpp>
#include <pcl/point_cloud.h>
#include <pcl/point_types.h>
#include <pcl/visualization/pcl_visualizer.h>
#include <pcl_conversions/pcl_conversions.h>
#include
#include
#include
pcl::visualization::PCLVisualizer viewer;
class PointCloudSubscriber : public rclcpp::Node {
public:
PointCloudSubscriber()
: Node("point_cloud_subscriber") {
// 创建订阅器
subscription_ = this->create_subscription<sensor_msgs::msg::PointCloud2>(
"/front/tanway_points", 10,
std::bind(&PointCloudSubscriber::pointCloudCallback, this, std::placeholders::_1));
private:
void pointCloudCallback(const sensor_msgs::msg::PointCloud2::SharedPtr msg) {
pcl::PointCloudpcl::PointXYZ::Ptr cloud(new pcl::PointCloudpcl::PointXYZ());
pcl::fromROSMsg(*msg, *cloud);
};
int main(int argc, char** argv) {
rclcpp::init(argc, argv);
// 创建 ROS 节点
viewer=pcl::visualization::PCLVisualizer("PointCloud Viewer");
auto node = std::make_shared();
}
`
Your Environment (please complete the following information):
Possible Solution
Maybe installing a later version of vtk and recompiling pcl will work? I wonder if anyone has tried
The text was updated successfully, but these errors were encountered: