Adding camera using Xacro

asked 2019-04-30 06:49:39 -0600

dofrey gravatar image

Hi I want to attach a fixed camera on my robot base in Gazebo and RViz and there are two problems with this. First of all, I can not display the camera itself (its just a box). Is there a mistake in my code? And second is, that the image stream with rqt_image_view is right, but the one in RViz seems to have something like an overlay. How so that RViz displays the same topic different?

<?xml version="1.0"?>

<robot xmlns:xacro="" name="kinova">

  <xacro:property name="M_PI" value="3.1415926535897931" />
  <xacro:property name="camera_size" value="1" />
  <xacro:property name="offset_from_link_x" value="0.05" />
  <xacro:property name="offset_from_link_y" value="0.0" />
  <xacro:property name="offset_from_link_z" value="0.0" />

  <link name="camera_link">
        <box size="${camera_size} ${camera_size} ${camera_size}"/>

  <joint name="camera_joint" type="fixed">
    <parent link="kinova_link_base"/>
    <child link="camera_link"/>
    <origin rpy="${M_PI/2} ${-M_PI/2} 0" xyz="${offset_from_link_x} ${offset_from_link_y} ${offset_from_link_z}"/>
    <axis xyz="1 0 0" />

  <gazebo reference="camera_link">
    <sensor type="camera" name="camera_camera_sensor">
        <pose>0 0 0 ${-M_PI/2} 0 ${-M_PI/2}</pose>
        <horizontal_fov>${85 * M_PI/180.0}</horizontal_fov>

      <plugin name="camera_camera_controller" filename="">


Thanks for your help!

edit retag flag offensive close merge delete