depth camera doesn't move in Rviz

asked 2019-09-26 11:04:21 -0600

suho0515 gravatar image

Hello guys, I'm trying to do hetor_slam with simulated drone with Gazebo.

but there is problem with modeled kinect depth camera.

when i start move the drone, drone and LRF sensor are moving nicely.

but only the Depth camera pointcloud2 data doesn't move at all.

I guess there should be tf problem with it. so i tried various of case.

but it's still not working.

is there any other problem?

here's my code.


<robot name="sensor_kinect" xmlns:xacro="">
  <property name="cam_px" value="0" /> <!-- Original value is 1.63[m] -->
  <xacro:property name="kinect_cam_py" value="0"/> <!-- Original value is -0.0125[m] -->
  <property name="cam_pz" value="0.2" /> <!-- Original value is 0.68[m] -->

  <property name="cam_or" value="0" />
  <property name="cam_op" value="0" />
  <property name="cam_oy" value="0" />  

  <xacro:property name="M_PI" value="3.1415926535897931" />

  <!-- Parameterised in part by the values in turtlebot_properties.urdf.xacro -->
  <xacro:macro name="sensor_kinect" params="parent">
    <joint name="camera_rgb_joint" type="fixed">
      <origin xyz="${cam_px} ${kinect_cam_py} ${cam_pz}" rpy="${cam_or} ${cam_op} ${cam_oy}"/>
      <parent link="${parent}"/>
      <child link="camera_rgb_frame" />
    <link name="camera_rgb_frame"/>

    <joint name="camera_rgb_optical_joint" type="fixed">
      <origin xyz="0 0 0" rpy="${-M_PI/2} 0 ${-M_PI/2}" />
      <parent link="camera_rgb_frame" />
      <child link="camera_rgb_optical_frame" />

    <link name="camera_rgb_optical_frame"/>
    <joint name="camera_joint" type="fixed">
      <origin xyz="-0.031 ${-kinect_cam_py} -0.016" rpy="0 0 0"/>
      <parent link="camera_rgb_frame"/>
      <child link="camera_link"/>

    <link name="camera_link">
       <origin xyz="0 0 0" rpy="0 0 ${M_PI/2}"/>
         <mesh filename="package://ardupilot_sitl_gazebo_plugin/meshes/meshes_sensors/kinect/kinect.dae"/>
        <origin xyz="0.0 0.0 0.0" rpy="0 0 0"/>
          <box size="0.07271 0.27794 0.073"/>
        <mass value="0.564" />
        <origin xyz="0 0 0" />
        <inertia ixx="0.003881243" ixy="0.0" ixz="0.0"
                 iyy="0.000498940" iyz="0.0"
                 izz="0.003879257" />

    <!-- The fixed joints & links below are usually published by static_transformers launched by the OpenNi launch 
         files. However, for Gazebo simulation we need them, so we add them here.
         (Hence, don't publish them additionally!) -->
    <joint name="camera_depth_joint" type="fixed">
      <origin xyz="0 ${2 * -kinect_cam_py} 0" rpy="${-M_PI/2} 0 0" />
      <parent link="camera_rgb_frame" />
      <child link="camera_depth_frame" />
    <link name="camera_depth_frame"/>

    <joint name="camera_depth_optical_joint" type="fixed">
      <origin xyz="0 0 0" rpy="${-M_PI/2} 0 ${-M_PI/2}" />
      <parent link="camera_depth_frame" />
      <child link="camera_depth_optical_frame" />
    <link name="camera_depth_optical_frame"/>

  <!-- Microsoft Kinect / ASUS Xtion PRO Live for simulation -->
  <gazebo reference="camera_link">  
    <sensor type="depth" name="camera">
        <horizontal_fov>${120.0*M_PI/180.0}</horizontal_fov> ...
edit retag flag offensive close merge delete