Octomap topics are empty

asked 2018-09-25 07:20:04 -0500

stevemartin gravatar image

I am using Intel realsense camera to get the point cloud messages. The camera works fine (but it is static in rviz, when robot moves, the camera stays still but shows everything as expected as the camera is located on robot's frame). So in order to launch the robot with camera, I wrote this launch file:


  <!-- Launch Gazebo and load the robot -->

        command="$(find xacro)/xacro '$(find genius_description)/urdf/genius.xacro'"
    <include file="$(find gazebo_ros)/launch/empty_world.launch">

  <node name="genius_spawn" pkg="gazebo_ros" type="spawn_model" output="screen"
   args="-urdf -param robot_description -model genius" />

  <node name="state_publisher" pkg="robot_state_publisher" type="robot_state_publisher"/>

  <!-- Launch depth_proc to get the point cloud and depth images -->
  <param name="use_sim_time" value="true" />

  <arg name="rgb_camera_info" value="/realsense/camera/color/camera_info"/>
  <arg name="rgb_img_rect" value="/realsense/camera/color/image_raw"/>  <!--Rectified color image-->
  <arg name="depReg_imgraw" value="/realsense/camera/depth/image_raw"/>  <!--Raw depth image-->
  <arg name="depReg_imgrect" value="/realsense/camera/depth/image_rect"/>  <!--Raw depth image-->
  <arg name="out_cloud" value="/realsense/camera/depth_registered/points"/>

  <node pkg="nodelet" type="nodelet" name="standalone_nodelet" args="manager" output="screen"/>

  <!-- Convert depth from mm (in uint16) to meters -->
  <node pkg="nodelet" type="nodelet" name="convert_metric" args="load depth_image_proc/convert_metric standalone_nodelet">
    <remap from="image_raw" to="$(arg depReg_imgraw)"/>
    <remap from="image" to="$(arg depReg_imgrect)"/>

  <!-- Construct point cloud of the rgb and depth topics -->
  <node pkg="nodelet" type="nodelet" name="points_xyzrgb" args="load depth_image_proc/point_cloud_xyzrgb standalone_nodelet --no-bond">
    <remap from="rgb/camera_info" to="$(arg rgb_camera_info)" />
    <remap from="rgb/image_rect_color" to="$(arg rgb_img_rect)"/>
    <remap from="depth_registered/image_rect" to="$(arg depReg_imgrect)"/>
    <remap from="depth_registered/points" to="$(arg out_cloud)"/>

  <node pkg="tf" type="static_transform_publisher" name="fake_tf" args="0 0 0 0 0 -1.57 odom color 10"/>

After that, I have decided to launch the Octomap in the same launch file:

<!-- Creating an Octomap -->
  <node pkg="octomap_server" type="octomap_server_node" name="octomap_server">
    <param name="resolution" value="0.05"/>
    <param name="frame_id" type="string" value="odom" />
    <param name="sensor_model/max_range" value="5.0" />
    <remap from="/realsense/camera/depth_registered/points" to="/narrow_stereo/points_filtered2"/>

But when I run rviz, all the Octomap topics are silent, they exist but no messages exist. What am I doing wrong here? And why is my camera static in rviz? Is it because I have used static_transform_publisher?

edit retag flag offensive close merge delete