My camera does not move with my robot in rviz

asked 2018-09-26 03:28:19 -0600

stevemartin gravatar image

updated 2018-09-29 02:51:07 -0600

I have installed the camera to my robot and gazebo works fine. However, when I start Rviz, the camera shows all the depth images but it does not move along with a robot and stays static.

Here is my 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">
      <arg name="world_name" value="$(find genius_gazebo)/worlds/" />

  <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"/>

  <!-- Launch path viewer to visualize odometry -->
  <node pkg="path_planning" type="" name="path_pub" output="screen" />
  <node pkg="path_planning" type="" name="path_ekf_pub" output="screen" />

  <!-- 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="cloud_in" to="/realsense/camera/depth_registered/points"/>


And here is the tf tree: frames.pdf

Here is the xacro: LINK

edit retag flag offensive close merge delete


Can you also post your xacro file?

webvenky gravatar image webvenky  ( 2018-09-28 19:27:17 -0600 )edit

@webvenky I have included the description folder.

stevemartin gravatar image stevemartin  ( 2018-09-29 02:51:25 -0600 )edit