Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Error in sending Empty Response message

Discussion in 'Robotics' started by theksg, Oct 31, 2023.

  1. theksg

    theksg

    Joined:
    Oct 20, 2023
    Posts:
    5
    Hi,

    I am using ROSTCPConnector.

    I am creating a service that will send std_srvs/Empty response.

    my ROSTCPConnector endpoint is in ubuntu VM and unity is in Windows which is host of VM.

    My code is as following:

    Code (CSharp):
    1. private EmptyResponse serviceName(EmptyRequest request)
    2.     {
    3.  
    4.         EmptyResponse objectPoseResponse = new EmptyResponse();
    5.  
    6.         return objectPoseResponse;
    7.     }
    When I am calling this service from ubuntu terminal:
    ros2 service call serviceName std_srvs/Empty

    it shows the below message:

    waiting for service to become available...
    requester: making request: std_srvs.srv.Empty_Request()


    I want it to behave normally. like is there a way to do it?

    I have ensured that I am able to call the service and the service logic is executed but sending of response causes error.

    Please help.
     
  2. theksg

    theksg

    Joined:
    Oct 20, 2023
    Posts:
    5
    it is working fine for ros1.

    showing following error message in ros2:


    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
     
  3. elfits

    elfits

    Joined:
    Oct 30, 2023
    Posts:
    1
    I had a similar error, have you solved it?