Turtlebot astra camera does not publish tf

asked 2017-08-17 06:51:18 -0600

adr_arroyo gravatar image

Hello, I have the following urdf file for my astras cameras (sensor_astra1 and sensor_astra2). The problem is that the /robot_state_publisher does not publish the TF of the cameras, so I cannot use them with RtabMap. I have followed the instructions in order to add new sensors to Turtlebot and I have all the required files. I beleive the problem is with the actual urdf of the cameras but I cannot see the error. The file is:

<?xml version="0.0"?>
<robot name="sensor_astra1" xmlns:xacro="http://ros.org/wiki/xacro">
<!--<xacro:include filename="$(find turtlebot_description)/urdf/turtlebot_gazebo.urdf.xacro"/>-->
<xacro:include filename="$(find turtlebot_description)/urdf/turtlebot_properties.urdf.xacro"/>

<!-- Xacro properties -->
<xacro:property name="astra_cam_py" value="-0.0125"/>
<xacro:property name="astra_depth_rel_rgb_py" value="0.0250" />
<xacro:property name="astra_cam_rel_rgb_py"   value="-0.0125" />
<xacro:property name="astra_dae_display_scale"   value="1" />
<!-- Parameterised in part by the values in turtlebot_properties.urdf.xacro -->
<xacro:macro name="sensor_astra1" params="">
<joint name="camera1_rgb_joint" type="fixed">
  <origin xyz="${cam_px} ${astra_cam_py} ${cam_pz}"
          rpy="0 0 0"/>
  <parent link="${parent}"/>
  <child link="camera1_rgb_frame" />
</joint>
<link name="camera1_rgb_frame"/>

<joint name="camera1_rgb_optical_joint" type="fixed">
  <origin xyz="0 0 0" rpy="${-M_PI/2} 0 ${-M_PI/2}" />
  <parent link="camera1_rgb_frame" />
  <child link="camera1_rgb_optical_frame" />
</joint>
<link name="camera1_rgb_optical_frame"/>

<joint name="camera1_joint" type="fixed">
  <origin xyz="0 ${astra_cam_rel_rgb_py} 0"
          rpy="0 0 0"/>
  <parent link="camera1_rgb_frame"/>
  <child link="camera1_link"/>
</joint>
<link name="camera1_link">
  <visual>
    <origin xyz="0.04 0.145 -0.01" rpy="${M_PI/2} 0 0.785"/>
    <geometry>
      <mesh filename="package://turtlebot_description/meshes/sensors/astra.dae" scale="${astra_dae_display_scale} ${astra_dae_display_scale} ${astra_dae_display_scale}"/>
    </geometry>
  </visual>
  <collision>
    <origin xyz="0.0 0.0 0.0" rpy="0 0 0" />
    <geometry>
    <box size="0.0400 0.1650 0.0300"/>
  </geometry>
  </collision>
  <inertial>
    <mass value="0.564" />
    <origin xyz="0 0 0" />
    <inertia ixx="0.003881243" ixy="0.0" ixz="0.0"
             iyy="0.000498940" iyz="0.0"
             izz="0.003879257" />
  </inertial>
</link>

<joint name="camera1_depth_joint" type="fixed">
  <origin xyz="0 ${astra_depth_rel_rgb_py} 0" rpy="0 0 0" />
  <parent link="camera1_rgb_frame" />
  <child link="camera1_depth_frame" />
</joint>
<link name="camera1_depth_frame"/>

<joint name="camera1_depth_optical_joint" type="fixed">
  <origin xyz="0 0 0" rpy="${-M_PI/2} 0 ${-M_PI/2}" />
  <parent link="camera1_depth_frame" />
  <child link="camera1_depth_optical_frame" />
</joint>
<link name="camera1_depth_optical_frame"/>

<!-- RGBD sensor for simulation, same as Kinect -->
<turtlebot_sim_3dsensor/>

 </xacro:macro>
</robot>

Any help is appreaciated! Cheers

edit retag flag offensive close merge delete