CoppeliaRobotics / simROS2

ROS 2 Interface for CoppeliaSim
Other
31 stars 16 forks source link

calling simROS2.advertiseService causes crashing with "undefined symbol:_ZN22rosidl_typesupport_cpp31get_service_type_support_handleIN8std_srvs3srv5EmptyEEEPK29rosidl_service_type_support_tv" #2

Closed mightestDuck closed 4 years ago

mightestDuck commented 4 years ago

When creating a ROS2 service in a non-threaded script:

service = simROS2.advertiseService('coppelia_node/service', 'std_srvs/Empty', 'service_callback')

the simulator crashes with the following error message:

libsimExtROS2Interface.so: undefined symbol:_ZN22rosidl_typesupport_cpp31get_service_type_support_handleIN8std_srvs3srv5EmptyEEEPK29rosidl_service_type_support_tv

I am using CoppeliaSim Pro V4.0.0. (rev. 4) with ROS2 Eloquent Elusor on Ubuntu 18.04. The ROS2 plugin for the simulator loads properly since I've been able to communicate in publisher-subscriber manner with no issues - only services lead to crashing. The same problem occurs when calling simROS2.createService.

Related topic on CoppeliaSim forum

fferri commented 4 years ago

Thanks for reporting this.

That should have generated a build error, not a runtime error. In fact I got a similar issue with ROS Foxy:

  "rosidl_service_type_support_t const* rosidl_typesupport_cpp::get_service_type_support_handle<std_srvs::srv::Empty>()", referenced from:
      rclcpp::Client<std_srvs::srv::Empty>::Client(rclcpp::node_interfaces::NodeBaseInterface*, std::__1::shared_ptr<rclcpp::node_interfaces::NodeGraphInterface>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, rcl_client_options_t&) in sim_ros2_interface.cpp.o
      rclcpp::Service<std_srvs::srv::Empty>::Service(std::__1::shared_ptr<rcl_node_t>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, rclcpp::AnyServiceCallback<std_srvs::srv::Empty>, rcl_service_options_t&) in sim_ros2_interface.cpp.o

which now I have fixed.

At the moment we can target only LTS releases of ROS2, so please try again with Dashing or Foxy.

fferri commented 4 years ago

No activity since long time, so I am closing this. Reopen if this is still an issue (now only ROS2 foxy is supported).