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

Revision history [back]

I belief you would need to create a static transform publisher to put your /camera_optical_depth_frame in the right perspective. Take a look at these tutoritals and it should help you.

I had much the same issue until I 'put' my kinect on my robot with the static transform publisher (I added the kinect to the p2os/p2os_urdf/defs/pioneer3dx_body.xacro). Then I changed RViz Fixed Frame to base_link or odom and it displayed the kinect's pointcloud in the correct perspective relative to the grid and robot.

image description


<!--Kinect Sensor-->
<joint name="kinect_joint" type="fixed">
        <origin xyz="0.1397 0 0.2677" rpy="0 0 0" />
        <parent link="base_link" />
        <child link="kinect_link" />
</joint>

<link name="kinect_link">
        <inertial>
                <mass value="0.001" />
                <origin xyz="0 0 0" />
                <inertia ixx="0.0001" ixy="0.0" ixz="0.0"
                         iyy="0.0001" iyz="0.0"
                         izz="0.0001" />
        </inertial>
        <visual>
                <origin xyz="0 0 0.028575" rpy="0 0 ${M_PI/2}" />
                <geometry>
                        <box size="0.27796 0.07271 0.0381" />
                </geometry>
                <material name="Blue" />
        </visual>
        <collision>
                <origin xyz="0 0 0" rpy="0 0 0" />
                <geometry>
                         <box size="0.27796 0.07271 0.073" />
                </geometry>
        </collision>
</link>

<joint name="kinect_rgb_joint" type="fixed">
        <origin xyz="0.01905 -0.0125 0.02794" rpy="0 0 0" />
        <parent link="kinect_link" />
        <child link="kinect_rgb_frame" />
</joint>

<link name="kinect_rgb_frame">
        <inertial>
                <mass value="0.001" />
                <origin xyz="0 0 0" />
                <inertia ixx="0.0001" ixy="0.0" ixz="0.0"
                         iyy="0.0001" iyz="0.0"
                         izz="0.0001" />
        </inertial>
</link>

<joint name="kinect_rgb_optical_joint" type="fixed">
        <origin xyz="0 0 0" rpy="${-M_PI/2} 0 ${-M_PI/2}" />
        <parent link="kinect_rgb_frame" />
        <child link="kinect_rgb_optical_frame" />
</joint>

<link name="kinect_rgb_optical_frame">
        <inertial>
                <mass value="0.001" />
                <origin xyz="0 0 0" />
                <inertia ixx="0.0001" ixy="0.0" ixz="0.0"
                         iyy="0.0001" iyz="0.0"
                         izz="0.0001" />
        </inertial>
</link>

<joint name="kinect_depth_joint" type="fixed">
        <origin xyz="0.01905 0.0125 0.02794" rpy="0 0 0" />
        <parent link="kinect_link" />
        <child link="kinect_depth_frame" />
</joint>

<link name="kinect_depth_frame">
        <inertial>
                <mass value="0.001" />
                <origin xyz="0 0 0" />
                <inertia ixx="0.0001" ixy="0.0" ixz="0.0"
                         iyy="0.0001" iyz="0.0"
                         izz="0.0001" />
        </inertial>
</link>

<joint name="kinect_depth_optical_joint" type="fixed">
        <origin xyz="0 0 0" rpy="${-M_PI/2} 0 ${-M_PI/2}" />
        <parent link="kinect_depth_frame" />
        <child link="kinect_depth_optical_frame" />
</joint>

<link name="kinect_depth_optical_frame">
        <inertial>
                <mass value="0.001" />
                <origin xyz="0 0 0" />
                <inertia ixx="0.0001" ixy="0.0" ixz="0.0"
                         iyy="0.0001" iyz="0.0"
                         izz="0.0001" />
        </inertial>
</link>