uuv_simulator
uuv_simulator copied to clipboard
Undefined Symbol Error
- OS: Ubuntu 20.04 and 18.04
- ROS Distro: Noetic and Melodic
- Built from source or installed: Built from source
- Commit hash: 66474bd3648f9fa2d0cf1d42e153ee08f3d3da7e
Expected behaviour I am working with the Heron ASV and am attempting to integrate UUV sensors onto the robot.
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:
- Clone the Heron ASV Simulator repository, along with Heron ASV, Heron Controller and Heron desktop for RViz
- Paste the snippet of code provided in the beginning of the Issue description to
heron/heron_description/urdf/sensors.xacro
. - In the
uuv_simulator
sensor plugins, add the following functions toUnderwaterCameraROSPlugin.hh
:
/// \brief Update the reflectance frame
public: virtual void OnNewReflectanceFrame(const float *_reflectance,
unsigned int _width, unsigned int _height,
unsigned int _depth, const std::string &_format);
/// \brief Update the normals frame
public: virtual void OnNewNormalsFrame(const float *_normals,
unsigned int _width, unsigned int _height,
unsigned int _depth, const std::string &_format);
- In the
uuv_simulator
sensor plugins, add the following functions toUnderwaterCameraROSPlugin.cc
:
/////////////////////////////////////////////////
void UnderwaterCameraROSPlugin::OnNewReflectanceFrame(const float *_reflectance,
unsigned int _width, unsigned int _height,
unsigned int _depth, const std::string &_format)
{
}
/////////////////////////////////////////////////
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!
I am having the same issue, did you find a fix?
@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!