Plugins in Gazebo publish data to a coordinate frame. This frame is defined inside the <frameName>
tag, which is inside the corresponding <plugin>
tag.
So look what's inside your plugin's <frameName>
, it could be camera_link
or camera_rgbd_frame
or something else.
Next you will have set a different orientation for the joint that connects to a link with this frame name.
- Find the urdf/xacro file that defines the corresponding joint and link. This could be defined inside a file called
kinect.xacro
or inside any other URDF or XACRO file of your robot.
Look for where the joint and link are defined, it should look similar to this:
<joint name="camera_rgb_joint" type="fixed">
<origin xyz="0 0 0" rpy="1.57079 3.14159 1.57079"/>
<parent link="kinect_baselink"/>
<child link="camera_rgbd_frame" />
</joint>
<link name="camera_rgbd_frame"/>
Modify the values inside the tag <origin xyz="0 0 0" rpy="1.57079 3.14159 1.57079"/>
.:
- The values under
xyz
specify the distance of the image with respect to the surface to which the camera is fixed. - The values under the attribute name
rpy
specify the rotation (in radians) of the image (depth cloud).
If your point cloud is not correctly oriented in Rviz try with different rpy
values until a good match is reached.
This is most probably related to how you defined the joints and links in the URDF/XACRO file. Can you include the part related to the links for the Kinect camera? (e.g. kinect_joint, camera_rgb_frame, camera_rgbd_frame, camera_rgb_optical_frame, camera_link, ....)
I'm using default config-
<gazebo reference="world"> <sensor name="world" type="depth"> <!-- openni plugin has the x pointing towards the scene, so rotate to have z --> <pose frame="world">0.0 0.0 1.0 0.0 -1.5708 1.5708</pose> <camera> <horizontal_fov>0.74839718</horizontal_fov> <image> <width>1280</width> <height>1024</height> <format>L_INT8</format> </image> <clip> <near>0.1</near> <far>10.0</far> </clip> <noise> <type>gaussian</type> <mean>0.5</mean> <stddev>1.0</stddev> </noise> </camera> <plugin name="kinect_plugin" filename="libgazebo_ros_openni_kinect.so"> <baseline>0.1</baseline> <alwaysOn>true</always
Unfortunately your comment got cut-off, it is not showing everything inside the
<plugin>
tag. Instead, edit your original post and additionally provide the joints and links in the URDF/XACRO file (without code comments).