ROS-TCP-Endpoint icon indicating copy to clipboard operation
ROS-TCP-Endpoint copied to clipboard

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

Open theksg opened this issue 2 years ago • 2 comments

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 std_srvs::srv::dds_::Empty_Response_., 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?

theksg avatar Nov 01 '23 12:11 theksg

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

justinberi avatar Aug 01 '24 03:08 justinberi

Hi,

Is there any update regarding this issue? The same problem happens to me with std_srvs/Trigger.srv when I call a service from Unity to ROS2.

rclpy._rclpy_pybind11.RMWError: failed to deserialize ROS message: Fast CDR exception deserializing message of type std_srvs::srv::dds_::Trigger_Request_., at ./src/type_support_common.cpp:118

Regards.

Rive4 avatar Jul 01 '25 10:07 Rive4