Ask Your Question
0

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
1

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 imageAwooOOoo ( 2019-06-18 01:44:23 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

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

Seen: 94 times

Last updated: Jun 18