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

Revision history [back]

Why don't you just do something like this?

<launch>

<!-- Do whatever you need to do to publish /cam3d/depth/points -->



<!-- nodelet manager -->
  <node pkg="nodelet" type="nodelet" name="nodelet_manager" output="screen" respawn="true" args="manager"/>


<!-- throttling -->
  <node pkg="nodelet" type="nodelet" name="pointcloud_throttle" args="load pointcloud_to_laserscan/CloudThrottle nodelet_manager" respawn="true">
    <param name="max_rate" value="20.0"/>
    <remap from="cloud_in" to="/cam3d/depth/points"/>
    <remap from="cloud_out" to="cloud_throttled"/>
  </node>

<!-- Fake Laser -->
  <node pkg="nodelet" type="nodelet" name="fake_laser" args="load pointcloud_to_laserscan/CloudToScan nodelet_manager" respawn="true">
    <param name="output_frame_id" value="/your_frame_id"/>
    <remap from="cloud" to="/cloud_throttled"/>
  </node>

  <!-- Fake Laser (narrow one, for localization -->
  <node pkg="nodelet" type="nodelet" name="my_laser_narrow" args="load pointcloud_to_laserscan/CloudToScan nodelet_manager" respawn="true">
    <param name="output_frame_id" value="/your_frame_id"/>
    <remap from="cloud" to="/cloud_throttled"/>
    <remap from="scan" to="/narrow_scan"/>
  </node>
</launch>

Although implementing your own version of pcl_to_scan might be a good programming exercise, I don't see why you need to do it that way, when you can just play with the tools provided by ROS. Just an opinion, I might have misunderstood your purpose. Cheers

Why don't you just do something like this?

<launch>

<!-- Do whatever you need to do to publish /cam3d/depth/points -->



<!-- nodelet manager -->
  <node pkg="nodelet" type="nodelet" name="nodelet_manager" output="screen" respawn="true" args="manager"/>


<!-- throttling -->
  <node pkg="nodelet" type="nodelet" name="pointcloud_throttle" args="load pointcloud_to_laserscan/CloudThrottle nodelet_manager" respawn="true">
    <param name="max_rate" value="20.0"/>
    <remap from="cloud_in" to="/cam3d/depth/points"/>
    <remap from="cloud_out" to="cloud_throttled"/>
  </node>

<!-- Fake Laser -->
  <node pkg="nodelet" type="nodelet" name="fake_laser" args="load pointcloud_to_laserscan/CloudToScan nodelet_manager" respawn="true">
    <param name="output_frame_id" value="/your_frame_id"/>
    <param name="min_height" value="-0.15"/><!-- Or any other value that suits you etter -->
    <param name="max_height" value="0.15"/><!-- Or any other value that suits you etter -->
    <remap from="cloud" to="/cloud_throttled"/>
  </node>

  <!-- Fake Laser (narrow one, for localization -->
  <node pkg="nodelet" type="nodelet" name="my_laser_narrow" args="load pointcloud_to_laserscan/CloudToScan nodelet_manager" respawn="true">
    <param name="output_frame_id" value="/your_frame_id"/>
    <param name="min_height" value="-0.025"/><!-- Or any other value that suits you etter -->
    <param name="max_height" value="0.025"/><!-- Or any other value that suits you etter -->
    <remap from="cloud" to="/cloud_throttled"/>
    <remap from="scan" to="/narrow_scan"/>
  </node>
</launch>

Although implementing your own version of pcl_to_scan might be a good programming exercise, I don't see why you need to do it that way, when you can just play with the tools provided by ROS. Just an opinion, I might have misunderstood your purpose. Cheers