gazebo camera topics not being published on remote pc but works on local pc

asked 2021-01-25 09:34:15 -0500

clover32 gravatar image

updated 2021-01-26 08:20:17 -0500

Hi, so i have this problem where my simulated camera works perfectly on my pc but as soon as i run the exact same code on my jetson, everything else except the camera works. There is no errors or warnings neither does it publish the desired topics. Please see code snippet below. The funny thing is that my imu sensor works on both. Currently i'm totally clueless and don't know what is wrong. I have seen that libgazebo_ros_multicamera.so indeed does exist in my system and that ros-melodic-image-pipeline, ros-melodic-gazebo-plugins, ros-melodic-gazebo-ros-pkgs, ros-melodic-gazebo-ros-control are installed. I appriciate any feedback.

IMU sensor:

<gazebo reference="${imu_frame}">
  <sensor name="imu_sensor" type="imu">
    <always_on>true</always_on>
    <update_rate>10</update_rate>
    <visualize>true</visualize>
    <plugin filename="libgazebo_ros_imu_sensor.so" name="imu_plugin">
      <topicName>camera/imu/data</topicName>
      <bodyName>${imu_frame}</bodyName>
      <updateRateHZ>10.0</updateRateHZ>
      <gaussianNoise>0.00000</gaussianNoise>
      <xyzOffset>0 0 0</xyzOffset>
      <rpyOffset>0 0 0</rpyOffset>
      <frameName>${imu_frame}</frameName>
      <initialOrientationAsReference>false</initialOrientationAsReference>
    </plugin>
    <pose>0 0 0 0 0 0</pose>
  </sensor>
</gazebo>

Camera sensor:

<gazebo reference="${lens_frame}">
<sensor type="multicamera" name="stereo_camera">
  <update_rate>10.0</update_rate>
  <camera name="left">
    <pose>${x_offset} 0 0 0 ${tilt * M_PI / 180.0} 0</pose>
    <horizontal_fov>${HFOV}</horizontal_fov>
    <image>
      <width>$(arg camera_res_x)</width>
      <height>$(arg camera_res_y)</height>
      <format>R8G8B8</format>
    </image>
    <clip>
      <near>0.01</near>
      <far>300</far>
    </clip>
    <noise>
      <type>gaussian</type>
      <mean>0.0</mean>
      <stddev>0.007</stddev>
    </noise>
  </camera>
  <camera name="right">
    <pose>${x_offset} ${-baseline} 0 0 ${tilt * M_PI / 180.0} 0</pose>
    <horizontal_fov>${HFOV}</horizontal_fov>
    <image>
      <width>$(arg camera_res_x)</width>
      <height>$(arg camera_res_y)</height>
      <format>R8G8B8</format>
    </image>
    <clip>
      <near>0.01</near>
      <far>300</far>
    </clip>
    <noise>
      <type>gaussian</type>
      <mean>0.0</mean>
      <stddev>0.007</stddev>
    </noise>
  </camera>
  <plugin name="stereo_camera_controller" filename="libgazebo_ros_multicamera.so">
    <alwaysOn>true</alwaysOn>
    <updateRate>0</updateRate>
    <cameraName>${topic_prefix}</cameraName>
    <imageTopicName>${image_type}</imageTopicName>
    <cameraInfoTopicName>camera_info</cameraInfoTopicName>
    <frameName>left_camera_frame</frameName>
    <distortionK1>0.0</distortionK1>
    <distortionK2>0.0</distortionK2>
    <distortionK3>0.0</distortionK3>
    <distortionT1>0.0</distortionT1>
    <distortionT2>0.0</distortionT2>
    <CxPrime>628.970</CxPrime> 
    <Cx>628.970</Cx> <!--From calibration file-->
    <Cy>355.755</Cy> <!--From calibration file-->
    <hackBaseline>${baseline}</hackBaseline> <!--Generates an TX for camera_info right-->
  </plugin>
</sensor>

</gazebo>

edit retag flag offensive close merge delete

Comments

I run the exact same code on my remote unit

what is a "remote unit"?

Does that remote unit have a GPU and a supported OpenGL stack?

If not, that might be something to look into, as many Gazebo plugins use a GPU and/or OpenGL to render to texture or accelerate raycasting operations fi.

Finally: this seems like a problem with Gazebo, not necessarily ROS.

gvdhoorn gravatar image gvdhoorn  ( 2021-01-26 05:12:13 -0500 )edit

Thanks for the answer. I should have clarified that part, sorry. The remote unit is just a Jetson that i control remotely and is set up as the ros master in some cases. But anyways, since it is a jetson it has a GPU and i also run image analysis stuff on it that works quite smoothly. Also every other part of the simulation seems to work, just not the camera plugin.

Another note on why i post it here rather than the gazebo forums: Before tested the simulation on the jetson i had a problem where image topics would stop publishing once i subscribed to it, i think it is somehow related to the problem. The structure of that test was: A ros client (my pc) would subscribe to the ros master (remote unit) camera topic and as soon as it did, neither the ros master nor ros client ...(more)

clover32 gravatar image clover32  ( 2021-01-26 08:18:50 -0500 )edit