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

asked 2017-12-05 07:52:33 -0500

federico.nardi gravatar image

updated 2017-12-06 03:50:39 -0500

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:

If I launch an empty world:

roslaunch gazebo_ros empty_world.launch

and then I spawn the robot with this launch file:

everything goes fine.

image description

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

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

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

      <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" />

  <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"/>

  <gazebo reference="logical_camera_link">
      <sensor name="logical_camera" type="logical_camera">
        <plugin name="logical_camera_plugin" filename=""/>



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

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

Can please someone explain me what is happening?


edit retag flag offensive close merge delete


Woah! Does the ground plane pose change on the left panel? How about the model pose and the GUI camera pose? Interestingly the world origin visuals seem to move up, but the grid stays below.

chapulina gravatar imagechapulina ( 2017-12-07 15:41:28 -0500 )edit

Any update? I'm trying to do the same, copied your code and got the same weird error.

felcjo gravatar imagefelcjo ( 2020-04-21 21:10:48 -0500 )edit

On first glance, it appears my robot lidar and the grid are reduced for how high the logical_camera joint is raised. Setting the joint's pose to "0 0 0" remove this issue .. I tried making the logical_camera's parent my robot's camera (z=~1), but that caused the same error. The suboptimal solution for me is to keep the logical_camera attached to the base_link

felcjo gravatar imagefelcjo ( 2020-04-21 21:29:51 -0500 )edit

I have a very similar problem when trying to mount a logical camera on a robotic arm. It seems that when you turn off the logical_camera visualization, i.e., <visualize>false</visualize>, the problem vanishes.

vidacs gravatar imagevidacs ( 2020-12-02 10:34:08 -0500 )edit