Unity-Technologies / ROS-TCP-Endpoint

ROS package used to create an endpoint to accept ROS messages sent from a Unity scene using the ROS TCP Connector scripts
Apache License 2.0
177 stars 118 forks source link

failed to deserialize ROS message: Fast CDR exception deserializing message of type std_srvs::srv::dds_::Empty_Response_. #169

Open theksg opened 10 months ago

theksg commented 10 months ago

Hi,

I am creating a ROS Service in Unity Simulator of type std_srvs/Empty.

I am able to call the service, service is doing the intended work.

But when I return the empty response, I get the following error:

The following exception was never retrieved: failed to deserialize ROS message: Fast CDR exception deserializing message of type stdsrvs::srv::dds::EmptyResponse., at /home/user/ros2_humble/src/ros2/rmw_fastrtps/rmw_fastrtps_cpp/src/type_support_common.cpp:118

can anyone help me with what could be going wrong?

justinberi commented 1 month ago

This is still and issue on ros2/jazzy.

In my case it was using a service with an empty request field. For example the service definition was

# ExampleWithEmpty.srv
---
bool foo

The work-around was to place a non-empty in the request. For example

# ExampleWithNonEmpty.srv
bool ignore_this_field
---
bool foo