Skip to content
This repository was archived by the owner on Dec 2, 2021. It is now read-only.
This repository was archived by the owner on Dec 2, 2021. It is now read-only.

Point cloud missing points after running ros_to_pcl #15

Description

@chaonan99

I tried to convert ROS point cloud to pcl format using ros_to_pcl under Exercise-2/sensor_stick/scripts/pcl_helper.py and show the result in rviz. The original point cloud looks like this:

After ros_to_pcl and pcl_to_ros, lots of points are missing,

And if I remove skip_nans=True in ros_to_pcl, the color becomes strange,

Is this a problem with read_points function or caused by some problems in my code? Here is my code for republishing the topic:

import rospy
from sensor_msgs.msg import PointCloud2
from pcl_helper import ros_to_pcl, pcl_to_ros

def publisher(pc):
  pcl_data = ros_to_pcl(pc)
  ros_pc = pcl_to_ros(pcl_data)
  pub.publish(ros_pc)
  rospy.loginfo("Publish to /repub_pc")
  rate.sleep()

rospy.init_node('pcl_test', anonymous=True)
rospy.Subscriber('/camera/depth_registered/points', PointCloud2, publisher,
    queue_size=10,  buff_size=2**30)

rate = rospy.Rate(float(5))
pub = rospy.Publisher('/repub_pc', PointCloud2, queue_size=10)
rospy.spin()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions