pointcloud_to_pcd working in rosrun but not in roslaunch [closed]

asked 2016-09-29 10:18:52 -0600

marilia15 gravatar image

updated 2016-09-30 05:38:54 -0600

If I use this works and I get the pcd files:

rosrun pcl_ros pointcloud_to_pcd input:=/velodyne_points

Screen shows:

[ INFO] [1475231616.538308247]: Saving as binary PCD
[ INFO] [1475231616.543897715]: Listening for incoming data on topic /velodyne_points
[ INFO] [1475231616.840383462]: Received 22673 data points in frame velodyne with the following fields: x y z intensity ring
[ INFO] [1475231616.840499468]: Data saved to 1464682245922134.pcd
[ INFO] [1475231616.953555745]: Received 22572 data points in frame velodyne with the following fields: x y z intensity ring
[ INFO] [1475231616.953652475]: Data saved to 1464682246027055.pcd

The rostopic list -v shows:

Published topics:
 * /clock [rosgraph_msgs/Clock] 1 publisher
 * /rosout [rosgraph_msgs/Log] 2 publishers
 * /velodyne_points [sensor_msgs/PointCloud2] 1 publisher
 * /rosout_agg [rosgraph_msgs/Log] 1 publisher

Subscribed topics:
 * /rosout [rosgraph_msgs/Log] 1 subscriber
 * /velodyne_points [sensor_msgs/PointCloud2] 1 subscriber

But if I use the launch file doesnt work:

    <node name="pc2pcd" pkg="pcl_ros" type="pointcloud_to_pcd">
        <remap from="input" to="velodyne_points" />     

Rostopic list -v shows exactly the same as before, but screen shows:

... logging to /home/alfonso/.ros/log/0b4428fc-86f9-11e6-aa0f-001a80e17ae0/roslaunch-alfonso-lab-5030.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://alfonso-lab:43424/


 * /rosdistro: indigo
 * /rosversion: 1.11.19

    pc2pcd (pcl_ros/pointcloud_to_pcd)


core service [/rosout] found
process[pc2pcd-1]: started with pid [5048]

However pcd files are not generated.

I have tried changing the launch file to="/velodyne_points" but still doesnt work. Ideas? Thanks in advance

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by marilia15
close date 2016-10-11 04:15:05.912880


Could you give more detail as how "doesn't work"? Are you getting any error messages? Could you attach the output of "rostopic list" in both cases?

Martin Peris gravatar image Martin Peris  ( 2016-09-29 20:05:30 -0600 )edit

you are right, I have updated that info in the post. Thank you

marilia15 gravatar image marilia15  ( 2016-09-30 05:40:20 -0600 )edit

Thank you for updating your question with additional detail. When you run your launch file, is the node that publishes "velodyne_points" running? Does the command "rostopic echo velodyne_points" print any data?

Martin Peris gravatar image Martin Peris  ( 2016-09-30 23:32:31 -0600 )edit

Yes, rostopic echo print data. I solved the problem. With rosrun the pcd files are generated in the current folder, but with roslaunch in /home/user/.ros/ folder, and I don't know why. Anyway, I solved it using the parameter prefix in the launch file.

marilia15 gravatar image marilia15  ( 2016-10-04 06:41:46 -0600 )edit