0
$\begingroup$

Rosanswers logo

Hey everyone!

I am Aaditya Saraiya and to start of my GSoC 2018 project, I wish to simulate a Kinect sensor in Gazebo. I followed the Gazebo tutorial to simulate a Kinect sensor which uses the OpenNI driver. I am running ROS Kinetic on Ubuntu 16.04, Gazebo version 7 and RViz version 1.12.15 (kinetic).

Initially, rostopic list was not showing the depth and image topics.This post helped me to solve that issue. However, even though the point cloud data is being posted, the sphere placed in front of the Kinect is not visible in RViz, which can be observed in the image. I tried moving the Kinect near and farther away from the objects considering the fact that Kinect has a minimum and maximum depth of visibility.

image description

Some peculiar things which I noted was that on using rostopic echo on the /tf topic, there is warning message which is as follows:

WARNING: no messages received and simulated time is active. Is /clock being published?

However, infact, the /clock is being published (automatically by Gazebo I think).

Secondly, Fixed frame window under the Global status in Rviz has the following warning.

No tf data. Actual error: Fixed Frame [camera_link] does not exist.

I have added the camera plugin as well which has been taken from the Gazebo tutorial.

 <plugin name="camera_plugin" filename="libgazebo_ros_openni_kinect.so">
  <baseline>0.2</baseline>
  <alwaysOn>true</alwaysOn>
  <!-- Keep this zero, update_rate in the parent <sensor> tag
    will control the frame rate. -->
  <updateRate>0.0</updateRate>
  <cameraName>camera_ir</cameraName>
  <imageTopicName>/camera/depth/image_raw</imageTopicName>
  <cameraInfoTopicName>/camera/depth/camera_info</cameraInfoTopicName>
  <depthImageTopicName>/camera/depth/image_raw</depthImageTopicName>
  <depthImageInfoTopicName>/camera/depth/camera_info</depthImageInfoTopicName>
  <pointCloudTopicName>/camera/depth/points</pointCloudTopicName>
  <frameName>camera_link</frameName>
  <pointCloudCutoff>0.05</pointCloudCutoff>
  <distortionK1>0</distortionK1>
  <distortionK2>0</distortionK2>
  <distortionK3>0</distortionK3>
  <distortionT1>0</distortionT1>
  <distortionT2>0</distortionT2>
  <CxPrime>0</CxPrime>
  <Cx>0</Cx>
  <Cy>0</Cy>
  <focalLength>0</focalLength>
  <hackBaseline>0</hackBaseline>
</plugin>

Is there some issue behind tf not being published properly?

Thanks in advance!


Originally posted by aaditya_saraiya on ROS Answers with karma: 105 on 2018-05-01

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

In the left frame, it looks as if the sphere & cube are behind the Kinect, not in front of it.


Make sure you've added an optical frame to get a properly transformed depth cloud in RViz (see: https://answers.ros.org/question/232534/gazebo-camera-frame-is-inconsistent-with-rviz-opencv-convention/?answer=232562#post-id-232562)


Originally posted by josephcoombe with karma: 697 on 2018-05-01

This answer was ACCEPTED on the original site

Post score: 3


Original comments

Comment by aaditya_saraiya on 2018-05-01:
Thank you so much! It was a silly error on my part. Will look into the optical frame part as well.

Comment by josephcoombe on 2018-05-01:
No problem. Good luck with your project!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.