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

Kinect depth cloud appears toward top (Z-axis) rather than front (x-axis)

asked 2021-03-14 13:11:48 -0500

arjunchatterg gravatar image

I have created a 2 wheeled robot with a kinect plugin. The kinect detects the objects but the depth cloud appears to be in z-axis instead of front-face view.

I tried changing the joint from top-joint to front-joint in fusion-360, but the problem still occurs.

Attached an image for reference.

image description

edit retag flag offensive close merge delete

Comments

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, ....)

Roberto Z. gravatar image Roberto Z.  ( 2021-03-15 05:23:11 -0500 )edit

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

arjunchatterg gravatar image arjunchatterg  ( 2021-03-15 15:36:14 -0500 )edit

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).

Roberto Z. gravatar image Roberto Z.  ( 2021-03-17 09:09:19 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-03-17 09:37:53 -0500

Roberto Z. gravatar image

updated 2021-03-17 09:53:36 -0500

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.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2021-03-14 13:11:48 -0500

Seen: 437 times

Last updated: Mar 17 '21