Kinect sensor in NRP


#1

Hi,

I am trying to add a Kinect sensor into my robot model. The first step I did was to follow the gazebo tutorial here to see if the gazebo plugin works properly. Unfortunately, I cannot finish the tutorial under the NRP environment.

Here is what I have done:

  1. Download the kinect sdf model from here, extract it and copy the folder into .gazebo/models. Without any modification, the kinect model can be found in the ‘insert’ tab of gazebo.
  2. Follow the guide, I added the ‘plugin’ tag into the sdf file provided in the above-mentioned tutorial. The model could still be found in gazebo, but the rostopics for getting the depth image did not appear, and I got the error message ‘Error [Element.cc:684] Missing element description for [depth]’ from gazebo.

The same steps have been tested in a pure ros environment, which works properly. Can anyone help or give some suggestions on it? Many thanks!

Best regards,

Rui


#2

After checking the source code and CMakeLists.txt in ${HBP}/GazeboRosPackages/src/gazebo_ros_pkgs/gazebo_plugins I found that the plugin related to depth camera is commented and will not generate in NRP environment:

Maybe this feature will be implemented in a future release of NRP?

# HBP: deactivated since we do not have a actual sensor_msgs package (sensor_msgs/point_cloud2_iterator.h is missing)
# add_library(gazebo_ros_depth_camera src/gazebo_ros_depth_camera.cpp)
# add_dependencies(gazebo_ros_depth_camera ${PROJECT_NAME}_gencfg)
# target_link_libraries(gazebo_ros_depth_camera gazebo_ros_camera_utils ${GAZEBO_LIBRARIES} DepthCameraPlugin ${catkin_LIBRARIES})
# HBP: deactivated since we do not have a actual sensor_msgs package (sensor_msgs/point_cloud2_iterator.h is missing)
# add_library(gazebo_ros_openni_kinect src/gazebo_ros_openni_kinect.cpp)
# add_dependencies(gazebo_ros_openni_kinect ${PROJECT_NAME}_gencfg)
# target_link_libraries(gazebo_ros_openni_kinect gazebo_ros_camera_utils ${GAZEBO_LIBRARIES} DepthCameraPlugin ${catkin_LIBRARIES})

#3

Dear Rui,

You can try the following commands in order to install sensors_msgs:

cd ${HBP}/GazeboRosPackages/src
git clone https://github.com/ros/common_msgs.git
# Uncomment the relevant lines of ${HBP}/GazeboRosPackages/src/gazebo_ros_pkgs/gazebo_plugins/CMakeLists.txt
cd ${HBP}/GazeboRosPackages
catkin_make

The compilation was successful on y computer. But I haven’t try to use the kinect sensor in a simulation.

Best regards,
Luc


#4

Hi Luc,

Thanks for your message and reply. I will try this recently and see if it works for me.

Best regards,

Rui