uuvsimulator / uuv_simulator

Gazebo/ROS packages for underwater robotics simulation
https://uuvsimulator.github.io/
Other
675 stars 355 forks source link

Undefined Symbol Error #454

Open onurbagoren opened 2 years ago

onurbagoren commented 2 years ago

I am attempting to add a camera to the Heron as an additional sensor. I added the following snippet of code to the robot description .xacro file:

  <!-- Add a camera link -->
  <link name="$(arg suffix_ns)camera_link" />
  <joint name="$(arg suffix_ns)camera_joint" type="fixed">
    <origin xyz="$(optenv HERON_CAMERA_XYZ 0.0 0.0 0.0)" rpy="$(optenv HERON_CAMERA_RPY 0.0 0.0 0.0)" />
    <parent link="$(arg suffix_ns)base_link" />
    <child link="$(arg suffix_ns)camera_link" />
  </joint>

  <!-- Mount a camera -->
  <gazebo>
    <plugin name="camera_controller" filename="libuuv_gazebo_ros_camera_plugin.so">
      <updateRate>30</updateRate>
      <robotNamespace>/$(arg namespace)</robotNamespace>
      <bodyName>$(arg suffix_ns)base_link</bodyName>
      <frameName>$(arg suffix_ns)camera_link</frameName>
      <topicName>/$(arg suffix_ns)camera/image_raw</topicName>
      <cameraName>$(arg suffix_ns)camera</cameraName>
      <cameraSrvName>$(arg suffix_ns)camera/camera_info</cameraSrvName>
      <cameraInfoTopicName>/$(arg suffix_ns)camera/camera_info</cameraInfoTopicName>
      <cameraInfoSrvName>$(arg suffix_ns)camera/camera_info</cameraInfoSrvName>
      <cameraInfoFile>$(find heron_description)/urdf/sensors/camera_info.yaml</cameraInfoFile>
      <cameraInfoFrame>$(arg suffix_ns)camera_link</cameraInfoFrame>
      <cameraFov>$(optenv HERON_CAMERA_FOV 90)</cameraFov>
      <cameraPitch>$(optenv HERON_CAMERA_PITCH 0)</cameraPitch>
      <cameraYaw>$(optenv HERON_CAMERA_YAW 0)</cameraYaw>
      <cameraRoll>$(optenv HERON_CAMERA_ROLL 0)</cameraRoll>
      <cameraX>$(optenv HERON_CAMERA_X 0)</cameraX>
      <cameraY>$(optenv HERON_CAMERA_Y 0)</cameraY>
      <cameraZ>$(optenv HERON_CAMERA_Z 0)</cameraZ>
      <cameraZOffset>$(optenv HERON_CAMERA_Z_OFFSET 0)</cameraZOffset>
      <cameraYawOffset>$(optenv HERON_CAMERA_YAW_OFFSET 0)</cameraYawOffset>
    </plugin>
  </gazebo>

I was expecting to see topics published to the camera/image_raw channel, but instead received errors regarding undefined symbols in the gazebo::DepthCameraPlugin.hh shared library.

Actual behaviour I ran into issues with undefined symbol from the gazebo::DepthCameraPlugin.hh shared library. The error is as follows: [Err] [Plugin.hh:212] Failed to load plugin libuuv_gazebo_ros_camera_plugin.so: /home/$USER/Simulators/uuv_simulator/devel/lib/libuuv_gazebo_ros_camera_plugin.so: undefined symbol: _ZTIN6gazebo17DepthCameraPluginE There were earlier errors relating to this from two undefined functions from that shared library: void OnNewReflectanceFrame and void OnNewNormalsFrame. I wrote empty functions for them so I wouldn't get the undefined symbol error. But this error, upon digging into it further with ldd, seems to point to the constructor of the constructor of the library public: DepthCameraPlugin();. This happened in both the Noetic and Melodic distros that I am testing with.

In addition, I am seeing this when I try to use the libimage_sonar_ros_plugin.so plugin as well.

To Reproduce Provide the steps to reproduce:

}

///////////////////////////////////////////////// void UnderwaterCameraROSPlugin::OnNewNormalsFrame(const float *_normals, unsigned int _width, unsigned int _height, unsigned int _depth, const std::string &_format) {

}


- Run `catkin_make` and source the environment
- On one terminal, launch a UUV world (i.e `roslaunch uuv_gazebo_worlds mangalia.launch`)
- On a separate terminal, launch the heron with `roslaunch heron_gazebo spawn_heron.launch`
- The error appears on the first terminal, where the world was launched

**Other notes**
In addition, I submitted this bug on the Heron Simulator repository as well and it appears that it seems to be something with UUV rather than Heron, as adding the standard `libgazebo_ros_camer.so` to the robot worked fine.

I am looking for both recommendations on how to include a camera to the Heron, and how I would go about doing that. This has been my process so far, but if there are any faults or anything I am missing, please do let me know!
I am also looking for advice on how to resolve this Undefined Symbol error as well. Thank you!
jake3991 commented 2 years ago

I am having the same issue, did you find a fix?

onurbagoren commented 1 year ago

@jake3991 sorry for the super late reply. I unfortunately was unable to resolve this issue and haven't been actively using UUV sim as of recently. If you come across a solution for it - please let me know!