ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

PointXYZ python usage question

asked 2015-03-24 12:31:04 -0500

rnunziata gravatar image

I am trying to include PointXYZ in a python pgm. But it is unable to locate PointXYZ. If I include the import pcl it say it can not find module pcl. Is there a install I am missing or is there no python wrapper for it?

         self.subPoseWithCovar = rospy.Subscriber("/depth/points", PointXYZ, self.callback)
         self.tf_pub = rospy.Publisher("/depth/points2", PointXYZ, queue_size=10)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-03-24 13:05:09 -0500

What exactly are you trying to subscribe to? /depth/points is probably going to be a message of type sensor_msgs/PointCloud2. There are no official PCL bindings for python, so you will need to use something like sensor_msgs/point_cloud2.py to convert the data to a usable format.

edit flag offensive delete link more

Comments

I wanted to translate a pointcloud2 into another frame. There is a method in c++ method transformPointCloud is there a similar python method you know of.

rnunziata gravatar image rnunziata  ( 2015-03-24 17:28:52 -0500 )edit

If all you want the node to do is transform the point cloud from one frame to another, it will be very slow in python (you'd have to transform each point individually). However, you can use a PassThrough filter and set the output_frame.

Dan Lazewatsky gravatar image Dan Lazewatsky  ( 2015-03-25 11:42:59 -0500 )edit

Seeing the PointXYZ I take it PassThrough filters are not in Python. I will write the cpp pgm.

rnunziata gravatar image rnunziata  ( 2015-03-25 13:16:05 -0500 )edit

The PassThrough filter isn't in python, but using it doesn't require writing any code at all, just configuring it in a launch file.

Dan Lazewatsky gravatar image Dan Lazewatsky  ( 2015-03-25 13:47:24 -0500 )edit

cool...thanks

rnunziata gravatar image rnunziata  ( 2015-03-25 14:00:03 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2015-03-24 12:31:04 -0500

Seen: 951 times

Last updated: Mar 24 '15