ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
5

ros2 run - symbol not found on custom msg

asked 2019-06-17 09:33:24 -0500

AwooOOoo gravatar image

updated 2019-06-18 01:45:47 -0500

gvdhoorn gravatar image

Hi, I've defined a custom message as described below.

Obstacle.msg:

geometry_msgs/Point32 polygon
float32 size_uncertainty
uint8 obstacle_class

..and the msg and associated publisher that uses it compiles just fine.

When I go to execute the node, the wheels fall off:

$ ros2 run obstacle_publisher obstacle_publisher
    /home/paul/code/eclipse_ws/ROS2/install/obstacle_publisher/lib/obstacle_publisher/obstacle_publisher: symbol lookup error: 
    /home/paul/code/eclipse_ws/ROS2/install/obstacle_msgs/lib/libobstacle_msgs__rosidl_typesupport_fastrtps_cpp.so: 
    undefined symbol: _ZN13geometry_msgs3msg24typesupport_fastrtps_cpp27max_serialized_size_Point32ERbm

I have std_msgs and geometry_msgs set with depend in the package.xml of both the package that creates the message (obstacle_msgs) and the package that uses the message (obstacle_publisher).

Any pointers would be appreciated.

Sincerely, Paul.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
18

answered 2019-06-17 10:10:29 -0500

marguedas gravatar image

Without seeing the code it is hard to tell for sure.

But my guess is that your obstacle_msgs package does not list the dependencies properly when generating the messages.

When invoking rosidl_generate_interfaces in CMake, the message dependencies need to be specified using the DEPENDENCIES argument.

rosidl_generate_interfaces(${PROJECT_NAME}
  ${my_msg_files}
  ${my_srv_files}
  DEPENDENCIES geometry_msgs my_custom_msgs
)

For example, here is the line used in the sensor_msgspackage: https://github.com/ros2/common_interf...

edit flag offensive delete link more

Comments

Thank you, That was it =). I'd forgotten to include the msg dependencies.

Sincerely, Paul.

AwooOOoo gravatar image AwooOOoo  ( 2019-06-18 01:44:23 -0500 )edit

Thanks to Allah, you saved my day.

Great thanks! Mohamed

MH_Ahmed gravatar image MH_Ahmed  ( 2020-03-02 13:03:12 -0500 )edit

Thank you, it worked I used sensor_msgs to build a custom message adding dependencies worked for me..

rosidl_generate_interfaces(${PROJECT_NAME}
"msg/PixyVector.msg"
DEPENDENCIES sensor_msgs )

lokeshtarala gravatar image lokeshtarala  ( 2021-06-14 09:22:48 -0500 )edit
1

Thanks for this. This is unfortunately not mentioned in https://docs.ros.org/en/foxy/Tutorial... . Where can I report this?

max11gen gravatar image max11gen  ( 2021-10-01 06:25:26 -0500 )edit

Can't believe they missed this in the tutorial. Anyone know and can point me to how to edit the tutorials?

mihota gravatar image mihota  ( 2022-03-03 21:03:55 -0500 )edit
2

This is still not documented on the humble tutorials. I created an issue here: https://github.com/ros2/rosidl/issues...

RFRIEDM_Trimble gravatar image RFRIEDM_Trimble  ( 2022-07-10 12:15:09 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2019-06-17 09:33:24 -0500

Seen: 8,116 times

Last updated: Jun 18 '19