Kinect not publishing topic in Gazebo
Hi
I would like to add Kinect camera to my robot and do simulation in Gzebo and Moveit. Im using this Kinect urdf file from hector link text and modified accordingly. Kinect is sowed in the gazebo and no error but not in the topic list. I include also another sensor (velodyne lidar and bumblebee stereo cameras) and both can publish their topic. Also in rqt kinect is there
Here my urdf.xacro
<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="kinect2">
<xacro:property name="M_PI" value="3.1415926535897931" />
<xacro:macro name="kinect2" params="*origin parent:=link name:=camera">
<joint name="${name}_joint" type="fixed">
<xacro:insert_block name="origin" />
<parent link="${parent}"/>
<child link="${name}_link"/>
</joint>
<link name="${name}_link">
<inertial_sphere mass="0.01" diameter="0.07" />
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="package://hector_sensors_description/meshes/kinect_camera/kinect_camera_simple.dae"/>
</geometry>
</visual>
<collision>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="package://hector_sensors_description/meshes/kinect_camera/kinect_camera_simple.stl"/>
</geometry>
</collision>
</link>
<joint name="${name}_depth_joint" type="fixed">
<origin xyz="0.0 -0.02 0.0" rpy="0 0 0" />
<parent link="${name}_link" />
<child link="${name}_depth_frame"/>
</joint>
<link name="${name}_depth_frame"/>
<joint name="${name}_depth_optical_joint" type="fixed">
<origin xyz="0 0 0" rpy="${-M_PI/2} 0.0 ${-M_PI/2}" />
<parent link="${name}_depth_frame" />
<child link="${name}_depth_optical_frame"/>
</joint>
<link name="${name}_depth_optical_frame"/>
<joint name="${name}_rgb_joint" type="fixed">
<origin xyz="0.0 -0.0125 0.0" rpy="0 0 0" />
<parent link="${name}_link" />
<child link="${name}_rgb_frame"/>
</joint>
<link name="${name}_rgb_frame"/>
<joint name="${name}_rgb_optical_joint" type="fixed">
<origin xyz="0 0 0" rpy="${-M_PI/2} 0.0 ${-M_PI/2}" />
<parent link="${name}_rgb_frame" />
<child link="${name}_rgb_optical_frame"/>
</joint>
<link name="${name}_rgb_optical_frame"/>
</xacro:macro>
<xacro:macro name="kinect_camera" params="*origin parent name">
<xacro:kinect2 name="${name}" parent="${parent}">
<xacro:insert_block name="origin" />
</xacro:kinect2>
<gazebo reference="${name}_depth_frame">
<sensor type="depth" name="${name}">
<update_rate>20</update_rate>
<camera>
<horizontal_fov>${60 * M_PI/180.0}</horizontal_fov>
<image>
<format>R8G8B8</format>
<width>640</width>
<height>480</height>
</image>
<clip>
<near>0.05</near>
<far>3</far>
</clip>
</camera>
<plugin name="${name}_camera_controller" filename="libgazebo_ros_openni_kinect.so">
<alwaysOn>true</alwaysOn>
<updateRate>20</updateRate>
<imageTopicName>${name}/rgb/image_raw</imageTopicName>
<cameraInfoTopicName>${name}/rgb/camera_info</cameraInfoTopicName>
<depthImageTopicName>${name}/depth/image_raw</depthImageTopicName>
<depthImageCameraInfoTopicName>${name}/depth/camera_info</depthImageCameraInfoTopicName>
<pointCloudTopicName>${name}/depth/points</pointCloudTopicName>
<frameName>${name}_depth_optical_frame</frameName>
<distortion_k1>0.0</distortion_k1>
<distortion_k2>0.0</distortion_k2>
<distortion_k3>0.0</distortion_k3>
<distortion_t1>0.0</distortion_t1>
<distortion_t2>0.0</distortion_t2>
</plugin>
</sensor>
</gazebo>
</xacro:macro>
</robot>
Here the Gazebo image
here rqt three
here the topic list
rostopic list
/bumblebee/left/camera_info
/bumblebee/left/image_raw
/bumblebee/left/parameter_descriptions
/bumblebee/left/parameter_updates
/bumblebee/right/camera_info
/bumblebee/right/image_raw
/bumblebee/right/parameter_descriptions
/bumblebee/right/parameter_updates
/calibrated
/clock
/crane_controller/command
/crane_controller/follow_joint_trajectory/cancel
/crane_controller/follow_joint_trajectory/feedback
/crane_controller/follow_joint_trajectory/goal
/crane_controller/follow_joint_trajectory/result
/crane_controller/follow_joint_trajectory/status
/crane_controller/gains/crane_linearX/parameter_descriptions
/crane_controller/gains/crane_linearX/parameter_updates
/crane_controller/gains/crane_linearZ/parameter_descriptions
/crane_controller/gains/crane_linearZ/parameter_updates
/crane_controller/gains/crane_rotation/parameter_descriptions
/crane_controller/gains/crane_rotation/parameter_updates
/crane_controller/state
/gazebo/link_states
/gazebo/model_states
/gazebo/parameter_descriptions
/gazebo/parameter_updates
/gazebo/set_link_state
/gazebo/set_model_state
/gazebo_gui/parameter_descriptions
/gazebo_gui/parameter_updates
/joint_states
/rosout
/rosout_agg
/tf
/tf_static
/velodyne_points
Any help??
Asked by Astronaut on 2019-07-05 02:48:47 UTC
Comments