Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

HELP: adding a sensor to my robot causes strange effect!

Hi all,

I'm using gazebo 7 to simulate a differential drive robot. Following the ROS tutorials online, I created an urdf file to describe my robot:

<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="robot">

  <!-- CONSTANTS -->
  <xacro:property name="base_length" value="0.4" />
  <xacro:property name="base_width" value="0.2" />
  <xacro:property name="base_height" value="0.1" />
  <xacro:property name="wheel_length" value="0.05" />
  <xacro:property name="wheel_radius" value="0.1" />
  <xacro:property name="camera_link" value="0.05" />
  <xacro:property name="camera_name" value="xtion" />
  <xacro:property name="M_PI" value="3.1415926535897931" />


  <!-- BASE LINK -->
  <link name="base_link">
    <visual>
      <geometry>
        <box size="${base_length} ${base_width} ${base_height}"/>
      </geometry>
    </visual>
    <collision>
      <geometry>
        <box size="${base_length} ${base_width} ${base_height}"/>
      </geometry>
    </collision>
    <visual>
      <origin xyz="-${base_length/2 - base_height/2} 0 -${base_height/2}" rpy="0 0 0" />
      <geometry>
        <sphere radius="${base_height/2}" />
      </geometry>
    </visual>
    <collision>
      <origin xyz="-${base_length/2 - base_height/2} 0 -${base_height/2}" rpy="0 0 0" />
      <geometry>
        <sphere radius="${base_height/2}" />
      </geometry>
    </collision>
    <inertial>
      <mass value="0.6"/>
      <inertia ixx="1e-3" ixy="0.0" ixz="0.0" iyy="1e-3" iyz="0.0" izz="1e-3"/>
    </inertial>
  </link>
  <gazebo reference="base_link">
    <mu1>0.0</mu1>
    <mu2>0.0</mu2>
    <material>Gazebo/Black</material>
  </gazebo>

  <!-- LEFT WHEEL -->
  <link name="left_wheel">
    <visual>
      <origin xyz="0 0 0" rpy="1.5707 0 0" />
      <geometry>
        <cylinder length="${base_height/2}" radius="${base_height}" />
      </geometry>
    </visual>
    <collision>
      <origin xyz="0 0 0" rpy="1.5707 0 0" />
      <geometry>
        <cylinder length="${base_height/2}" radius="${base_height}" />
      </geometry>
    </collision>
    <inertial>
      <mass value="0.6"/>
      <inertia ixx="1e-3" ixy="0.0" ixz="0.0" iyy="1e-3" iyz="0.0" izz="1e-3"/>
    </inertial>
  </link>
  <gazebo reference="left_wheel">
    <mu1 value="200.0"/>
    <mu2 value="100.0"/>
    <kp value="10000000.0" />
    <kd value="1.0" />
    <material>Gazebo/Grey</material>
  </gazebo>

  <!-- LEFT WHEEL JOINT -->
  <joint name="left_wheel_joint" type="continuous">
    <parent link="base_link" />
    <child  link="left_wheel" />
    <origin xyz="0.1 0.13 0" />
    <axis rpy="0 0 0" xyz="0 1 0"/>
  </joint>

  <!-- LEFT WHEEL JOINT TRANSMISSION -->
  <transmission name="left_wheel_joint_trans">
    <type>transmission_interface/SimpleTransmission</type>
    <actuator name="$left_wheel_joint_motor">
      <mechanicalReduction>1</mechanicalReduction>
    </actuator>
    <joint name="left_wheel_joint">
      <hardwareInterface>hardware_interface/VelocityJointInterface</hardwareInterface>
    </joint>
  </transmission>

  <!-- RIGHT WHEEL -->
  <link name="right_wheel">
    <visual>
      <origin xyz="0 0 0" rpy="1.5707 0 0" />
      <geometry>
        <cylinder length="${base_height/2}" radius="${base_height}" />
      </geometry>
    </visual>
    <collision>
      <origin xyz="0 0 0" rpy="1.5707 0 0" />
      <geometry>
        <cylinder length="${base_height/2}" radius="${base_height}" />
      </geometry>
    </collision>
    <inertial>
      <mass value="0.6"/>
      <inertia ixx="1e-3" ixy="0.0" ixz="0.0" iyy="1e-3" iyz="0.0" izz="1e-3"/>
    </inertial>
  </link>
  <gazebo reference="right_wheel">
    <mu1 value="200.0"/>
    <mu2 value="100.0"/>
    <kp value="10000000.0" />
    <kd value="1.0" />
    <material>Gazebo/Grey</material>
  </gazebo>

  <!-- RIGHT WHEEL JOINT -->
  <joint name="right_wheel_joint" type="continuous">
    <parent link="base_link" />
    <child  link="right_wheel" />
    <origin xyz="0.1 -0.13 0" />
    <axis rpy="0 0 0" xyz="0 1 0"/>
  </joint>

  <!-- RIGHT WHEEL JOINT TRANSMISSION -->
  <transmission name="right_wheel_joint_trans">
    <type>transmission_interface/SimpleTransmission</type>
    <actuator name="$right_wheel_joint_motor">
      <mechanicalReduction>1</mechanicalReduction>
    </actuator>
    <joint name="right_wheel_joint">
      <hardwareInterface>hardware_interface/VelocityJointInterface</hardwareInterface>
    </joint>
  </transmission>

  <!-- CAMERA -->
  <link name="camera_link">
    <collision>
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <geometry>
    <box size="${camera_link} ${camera_link} ${camera_link}"/>
      </geometry>
    </collision>

    <visual>
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <geometry>
    <box size="${camera_link} ${camera_link} ${camera_link}"/>
      </geometry>
      <material name="red"/>
    </visual>

    <inertial>
      <mass value="1e-5" />
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <inertia ixx="1e-6" ixy="0" ixz="0" iyy="1e-6" iyz="0" izz="1e-6" />
    </inertial>
  </link>


  <!-- CAMERA JOINT -->
  <joint name="camera_joint" type="fixed">
    <axis xyz="0 1 0" />
    <origin xyz="0 0 1.0" rpy="0 0 0"/>
    <parent link="base_link"/>
    <child link="camera_link"/>
  </joint>


  <!-- XTION SENSOR -->
  <gazebo reference="camera_link">
    <sensor type="depth" name="rgbd_camera">
      <always_on>true</always_on>
      <update_rate>20.0</update_rate>
      <camera>
        <horizontal_fov>${60.0*M_PI/180.0}</horizontal_fov>
        <image>
          <width>320</width>
          <height>240</height>
          <format>R8G8B8</format>
        </image>
        <clip>
          <near>0.02</near>
          <far>5.0</far>
        </clip>
      </camera>
      <plugin name="rgdb_camera_controller" filename="libgazebo_ros_openni_kinect.so">
        <cameraName>camera</cameraName>
          <alwaysOn>true</alwaysOn>
          <updateRate>10</updateRate>
          <imageTopicName>rgb/image_raw</imageTopicName>
          <depthImageTopicName>depth/image_raw</depthImageTopicName>
          <pointCloudTopicName>depth/points</pointCloudTopicName>
          <cameraInfoTopicName>rgb/camera_info</cameraInfoTopicName>
          <depthImageCameraInfoTopicName>depth/camera_info</depthImageCameraInfoTopicName>
          <frameName>camera_depth_optical_frame</frameName>
          <baseline>0.1</baseline>
          <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>
          <pointCloudCutoff>0.4</pointCloudCutoff>
      </plugin>
    </sensor>
  </gazebo>


  <!-- Gazebo plugin for ROS Control -->
  <gazebo>
    <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
      <robotNamespace>/</robotNamespace>
    </plugin>
  </gazebo>

</robot>

If I launch an empty world:

roslaunch gazebo_ros empty_world.launch

and then I spawn the robot with this launch file:

<launch>

  <!-- these are the arguments you can pass this launch file, for example paused:=true -->
  <arg name="model" default="$(find lucrezio_description)/urdf/lucrezio_with_logical.urdf.xacro"/>

  <param name="robot_description" command="$(find xacro)/xacro.py $(arg model)" />

  <!-- push robot_description to factory and spawn robot in gazebo -->
  <node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model"
        args="-z 1.0 -unpause -urdf -model robot -param robot_description" respawn="false" output="screen" />

  <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />
  <node pkg="robot_state_publisher" type="robot_state_publisher"  name="robot_state_publisher">
    <param name="publish_frequency" type="double" value="30.0" />
  </node>

  <!-- Run the controller manager -->
  <rosparam command="load" file="$(find lucrezio_description)/config/diffdrive.yaml" ns="lucrezio" />
  <node name="lucrezio_controller_spawner" pkg="controller_manager" type="spawner" args="lucrezio --shutdown-timeout 3"/>

  <!-- Tele-operate the robot 
  <node name="rqt_robot_steering" pkg="rqt_robot_steering" type="rqt_robot_steering">
    <param name="default_topic" value="/lucrezio_diff_drive_controller/cmd_vel"/>
  </node> -->

</launch>

everything goes fine.

image description

Now, I wrote a simple plugin for the logical_camera sensor:

  • https://github.com/schizzz8/lucrezio_logical_camera

and I try to mount it on the robot by adding these lines to the urdf:

  <!-- LOGICAL CAMERA -->
  <link name="logical_camera_link">
    <collision>
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <geometry>
    <box size="${camera_size} ${camera_size} ${camera_size}"/>
      </geometry>
    </collision>

If I try to spawn this robot, this is what I get:

image description

    <visual>
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <geometry>
    <box size="${camera_size} ${camera_size} ${camera_size}"/>
      </geometry>
      <material name="red"/>
    </visual>

    <inertial>
      <mass value="1e-5" />
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <inertia ixx="1e-6" ixy="0" ixz="0" iyy="1e-6" iyz="0" izz="1e-6" />
    </inertial>
  </link>


  <!-- LOGICAL CAMERA JOINT -->
  <joint name="logical_camera_joint" type="fixed">
    <axis xyz="0 1 0" />
    <origin xyz="0 0 1.0" rpy="0 0 0"/>
    <parent link="base_link"/>
    <child link="logical_camera_link"/>
  </joint>


  <!-- LOGICAL CAMERA SENSOR -->
  <gazebo reference="logical_camera_link">
      <sensor name="logical_camera" type="logical_camera">
        <plugin name="logical_camera_plugin" filename="liblogical_camera_plugin.so"/>

          <logical_camera>
            <near>0.02</near>
            <far>5.0</far>
            <horizontal_fov>${60.0*M_PI/180.0}</horizontal_fov>
            <aspect_ratio>1.778</aspect_ratio>
          </logical_camera>

          <visualize>true</visualize>
          <always_on>true</always_on>
          <update_rate>10</update_rate>
      </sensor>
  </gazebo>

Basically, it seems that the ground plane gets shifted up of one meter.

Can please someone explain me what is happening?

Thanks.

HELP: adding a sensor to my robot causes strange effect!

Hi all,

I'm using gazebo 7 to simulate a differential drive robot. Following the ROS tutorials online, I created an urdf file to describe my robot:

  • https://github.com/schizzz8/lucrezio_description/blob/master/urdf/lucrezio.urdf.xacro

If I launch an empty world:

<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="robot">

roslaunch gazebo_ros empty_world.launch

and then I spawn the robot with this launch file:

  • https://github.com/schizzz8/lucrezio_description/blob/master/launch/robot.launch

everything goes fine.

image description

Now, I wrote a simple plugin for the logical_camera sensor:

  • https://github.com/schizzz8/lucrezio_logical_camera

and I try to mount it on the robot by adding these lines to the urdf:

  <!-- CONSTANTS LOGICAL CAMERA -->
  <xacro:property name="base_length" value="0.4" />
  <xacro:property name="base_width" value="0.2" />
  <xacro:property name="base_height" value="0.1" />
  <xacro:property name="wheel_length" value="0.05" />
  <xacro:property name="wheel_radius" value="0.1" />
  <xacro:property name="camera_link" value="0.05" />
  <xacro:property name="camera_name" value="xtion" />
  <xacro:property name="M_PI" value="3.1415926535897931" />


  <!-- BASE LINK -->
  <link name="base_link">
    <visual>
      <geometry>
        <box size="${base_length} ${base_width} ${base_height}"/>
      </geometry>
    </visual>
name="logical_camera_link">
    <collision>
      <geometry>
        <box size="${base_length} ${base_width} ${base_height}"/>
      </geometry>
    </collision>
    <visual>
      <origin xyz="-${base_length/2 - base_height/2} 0 -${base_height/2}" rpy="0 0 0" />
      <geometry>
        <sphere radius="${base_height/2}" />
      </geometry>
    </visual>
    <collision>
      <origin xyz="-${base_length/2 - base_height/2} 0 -${base_height/2}" rpy="0 0 0" />
      <geometry>
        <sphere radius="${base_height/2}" />
      </geometry>
    </collision>
    <inertial>
      <mass value="0.6"/>
      <inertia ixx="1e-3" ixy="0.0" ixz="0.0" iyy="1e-3" iyz="0.0" izz="1e-3"/>
    </inertial>
  </link>
  <gazebo reference="base_link">
    <mu1>0.0</mu1>
    <mu2>0.0</mu2>
    <material>Gazebo/Black</material>
  </gazebo>

  <!-- LEFT WHEEL -->
  <link name="left_wheel">
    <visual>
      <origin xyz="0 0 0" rpy="1.5707 0 0" />
rpy="0 0 0"/>
      <geometry>
        <cylinder length="${base_height/2}" radius="${base_height}" />
<box size="${camera_size} ${camera_size} ${camera_size}"/>
      </geometry>
    </visual>
    <collision>
</collision>    
    <visual>
      <origin xyz="0 0 0" rpy="1.5707 0 0" />
rpy="0 0 0"/>
      <geometry>
        <cylinder length="${base_height/2}" radius="${base_height}" />
      </geometry>
    </collision>
    <inertial>
      <mass value="0.6"/>
      <inertia ixx="1e-3" ixy="0.0" ixz="0.0" iyy="1e-3" iyz="0.0" izz="1e-3"/>
    </inertial>
  </link>
  <gazebo reference="left_wheel">
    <mu1 value="200.0"/>
    <mu2 value="100.0"/>
    <kp value="10000000.0" />
    <kd value="1.0" />
    <material>Gazebo/Grey</material>
  </gazebo>

  <!-- LEFT WHEEL JOINT -->
  <joint name="left_wheel_joint" type="continuous">
    <parent link="base_link" />
    <child  link="left_wheel" />
    <origin xyz="0.1 0.13 0" />
    <axis rpy="0 0 0" xyz="0 1 0"/>
  </joint>

  <!-- LEFT WHEEL JOINT TRANSMISSION -->
  <transmission name="left_wheel_joint_trans">
    <type>transmission_interface/SimpleTransmission</type>
    <actuator name="$left_wheel_joint_motor">
      <mechanicalReduction>1</mechanicalReduction>
    </actuator>
    <joint name="left_wheel_joint">
      <hardwareInterface>hardware_interface/VelocityJointInterface</hardwareInterface>
    </joint>
  </transmission>

  <!-- RIGHT WHEEL -->
  <link name="right_wheel">
    <visual>
      <origin xyz="0 0 0" rpy="1.5707 0 0" />
      <geometry>
        <cylinder length="${base_height/2}" radius="${base_height}" />
      </geometry>
    </visual>
    <collision>
      <origin xyz="0 0 0" rpy="1.5707 0 0" />
      <geometry>
        <cylinder length="${base_height/2}" radius="${base_height}" />
      </geometry>
    </collision>
    <inertial>
      <mass value="0.6"/>
      <inertia ixx="1e-3" ixy="0.0" ixz="0.0" iyy="1e-3" iyz="0.0" izz="1e-3"/>
    </inertial>
  </link>
  <gazebo reference="right_wheel">
    <mu1 value="200.0"/>
    <mu2 value="100.0"/>
    <kp value="10000000.0" />
    <kd value="1.0" />
    <material>Gazebo/Grey</material>
  </gazebo>

  <!-- RIGHT WHEEL JOINT -->
  <joint name="right_wheel_joint" type="continuous">
    <parent link="base_link" />
    <child  link="right_wheel" />
    <origin xyz="0.1 -0.13 0" />
    <axis rpy="0 0 0" xyz="0 1 0"/>
  </joint>

  <!-- RIGHT WHEEL JOINT TRANSMISSION -->
  <transmission name="right_wheel_joint_trans">
    <type>transmission_interface/SimpleTransmission</type>
    <actuator name="$right_wheel_joint_motor">
      <mechanicalReduction>1</mechanicalReduction>
    </actuator>
    <joint name="right_wheel_joint">
      <hardwareInterface>hardware_interface/VelocityJointInterface</hardwareInterface>
    </joint>
  </transmission>

  <!-- CAMERA -->
  <link name="camera_link">
    <collision>
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <geometry>
    <box size="${camera_link} ${camera_link} ${camera_link}"/>
      </geometry>
    </collision>

    <visual>
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <geometry>
    <box size="${camera_link} ${camera_link} ${camera_link}"/>
size="${camera_size} ${camera_size} ${camera_size}"/>
      </geometry>
      <material name="red"/>
    </visual>

    <inertial>
      <mass value="1e-5" />
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <inertia ixx="1e-6" ixy="0" ixz="0" iyy="1e-6" iyz="0" izz="1e-6" />
    </inertial>
  </link>


  <!-- LOGICAL CAMERA JOINT -->
  <joint name="camera_joint" name="logical_camera_joint" type="fixed">
    <axis xyz="0 1 0" />
    <origin xyz="0 0 1.0" rpy="0 0 0"/>
    <parent link="base_link"/>
    <child link="camera_link"/>
  </joint>


  <!-- XTION SENSOR -->
  <gazebo reference="camera_link">
    <sensor type="depth" name="rgbd_camera">
      <always_on>true</always_on>
      <update_rate>20.0</update_rate>
      <camera>
        <horizontal_fov>${60.0*M_PI/180.0}</horizontal_fov>
        <image>
          <width>320</width>
          <height>240</height>
          <format>R8G8B8</format>
        </image>
        <clip>
          <near>0.02</near>
          <far>5.0</far>
        </clip>
      </camera>
      <plugin name="rgdb_camera_controller" filename="libgazebo_ros_openni_kinect.so">
        <cameraName>camera</cameraName>
          <alwaysOn>true</alwaysOn>
          <updateRate>10</updateRate>
          <imageTopicName>rgb/image_raw</imageTopicName>
          <depthImageTopicName>depth/image_raw</depthImageTopicName>
          <pointCloudTopicName>depth/points</pointCloudTopicName>
          <cameraInfoTopicName>rgb/camera_info</cameraInfoTopicName>
          <depthImageCameraInfoTopicName>depth/camera_info</depthImageCameraInfoTopicName>
          <frameName>camera_depth_optical_frame</frameName>
          <baseline>0.1</baseline>
          <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>
          <pointCloudCutoff>0.4</pointCloudCutoff>
      </plugin>
    </sensor>
  </gazebo>


  <!-- Gazebo plugin for ROS Control -->
  <gazebo>
    <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
      <robotNamespace>/</robotNamespace>
    </plugin>
  </gazebo>

</robot>

If I launch an empty world:

roslaunch gazebo_ros empty_world.launch

and then I spawn the robot with this launch file:

<launch>

  <!-- these are the arguments you can pass this launch file, for example paused:=true -->
  <arg name="model" default="$(find lucrezio_description)/urdf/lucrezio_with_logical.urdf.xacro"/>

  <param name="robot_description" command="$(find xacro)/xacro.py $(arg model)" />

  <!-- push robot_description to factory and spawn robot in gazebo -->
  <node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model"
        args="-z 1.0 -unpause -urdf -model robot -param robot_description" respawn="false" output="screen" />

  <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />
  <node pkg="robot_state_publisher" type="robot_state_publisher"  name="robot_state_publisher">
    <param name="publish_frequency" type="double" value="30.0" />
  </node>

  <!-- Run the controller manager -->
  <rosparam command="load" file="$(find lucrezio_description)/config/diffdrive.yaml" ns="lucrezio" />
  <node name="lucrezio_controller_spawner" pkg="controller_manager" type="spawner" args="lucrezio --shutdown-timeout 3"/>

  <!-- Tele-operate the robot 
  <node name="rqt_robot_steering" pkg="rqt_robot_steering" type="rqt_robot_steering">
    <param name="default_topic" value="/lucrezio_diff_drive_controller/cmd_vel"/>
  </node> -->

</launch>

everything goes fine.

image description

Now, I wrote a simple plugin for the logical_camera sensor:

  • https://github.com/schizzz8/lucrezio_logical_camera

and I try to mount it on the robot by adding these lines to the urdf:

  <!-- LOGICAL CAMERA -->
  <link name="logical_camera_link">
    <collision>
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <geometry>
    <box size="${camera_size} ${camera_size} ${camera_size}"/>
      </geometry>
    </collision>

If I try to spawn this robot, this is what I get:

image description

    <visual>
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <geometry>
    <box size="${camera_size} ${camera_size} ${camera_size}"/>
      </geometry>
      <material name="red"/>
    </visual>

    <inertial>
      <mass value="1e-5" />
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <inertia ixx="1e-6" ixy="0" ixz="0" iyy="1e-6" iyz="0" izz="1e-6" />
    </inertial>
  </link>


  <!-- LOGICAL CAMERA JOINT -->
  <joint name="logical_camera_joint" type="fixed">
    <axis xyz="0 1 0" />
    <origin xyz="0 0 1.0" rpy="0 0 0"/>
    <parent link="base_link"/>
    <child link="logical_camera_link"/>
  </joint>


  <!-- LOGICAL CAMERA SENSOR -->
  <gazebo reference="logical_camera_link">
      <sensor name="logical_camera" type="logical_camera">
        <plugin name="logical_camera_plugin" filename="liblogical_camera_plugin.so"/>

          <logical_camera>
            <near>0.02</near>
            <far>5.0</far>
            <horizontal_fov>${60.0*M_PI/180.0}</horizontal_fov>
            <aspect_ratio>1.778</aspect_ratio>
          </logical_camera>

          <visualize>true</visualize>
          <always_on>true</always_on>
          <update_rate>10</update_rate>
      </sensor>
  </gazebo>

If I now spawn the robot, this is what happens:

  • https://youtu.be/9duCT1FotSI

Basically, it seems that the ground plane gets shifted up of one meter.

Can please someone explain me what is happening?

Thanks.

HELP: adding a sensor to my robot causes strange effect!

Hi all,

I'm using gazebo 7 to simulate a differential drive robot. Following the ROS tutorials online, I created an urdf file to describe my robot:

  • https://github.com/schizzz8/lucrezio_description/blob/master/urdf/lucrezio.urdf.xacro

If I launch an empty world:

roslaunch gazebo_ros empty_world.launch

and then I spawn the robot with this launch file:

  • https://github.com/schizzz8/lucrezio_description/blob/master/launch/robot.launch

everything goes fine.

image description

Now, I wrote a simple plugin for the logical_camera sensor:

  • https://github.com/schizzz8/lucrezio_logical_camera

and I try to mount it on the robot by adding these lines to the urdf:

  <!-- LOGICAL CAMERA -->
  <link name="logical_camera_link">
    <collision>
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <geometry>
    <box size="${camera_size} ${camera_size} ${camera_size}"/>
      </geometry>
    </collision>    
    <visual>
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <geometry>
    <box size="${camera_size} ${camera_size} ${camera_size}"/>
      </geometry>
      <material name="red"/>
    </visual>

    <inertial>
      <mass value="1e-5" />
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <inertia ixx="1e-6" ixy="0" ixz="0" iyy="1e-6" iyz="0" izz="1e-6" />
    </inertial>
  </link>


  <!-- LOGICAL CAMERA JOINT -->
  <joint name="logical_camera_joint" type="fixed">
    <axis xyz="0 1 0" />
    <origin xyz="0 0 1.0" rpy="0 0 0"/>
    <parent link="base_link"/>
    <child link="logical_camera_link"/>
  </joint>


  <!-- LOGICAL CAMERA SENSOR -->
  <gazebo reference="logical_camera_link">
      <sensor name="logical_camera" type="logical_camera">
        <plugin name="logical_camera_plugin" filename="liblogical_camera_plugin.so"/>

          <logical_camera>
            <near>0.02</near>
            <far>5.0</far>
            <horizontal_fov>${60.0*M_PI/180.0}</horizontal_fov>
            <aspect_ratio>1.778</aspect_ratio>
          </logical_camera>

          <visualize>true</visualize>
          <always_on>true</always_on>
          <update_rate>10</update_rate>
      </sensor>
  </gazebo>

If I now spawn the robot, this is what happens:

  • https://youtu.be/9duCT1FotSI

Basically, it seems that the ground plane gets shifted up of one meter.

Can please someone explain me what is happening?

Thanks.