Errors in rosservice info for external services.

Hello,
I am running into errors whilst attempting to run
n = ros.node("/test")
client = ros.ServiceClient(n,'/iiwa_1/controller_manager/list_controller_types','DataFormat','struct');
with external services. In this case i am attempting to get the type for a gazebo service.
I get the error:
Error using rethrow
Input must be a structure.
Error in ros.internal.NetworkIntrospection.getServiceType (line 519)
rethrow ex
Error in ros.ServiceClient (line 200)
serviceType = ros.internal.NetworkIntrospection.getServiceType(serviceName, masterURI);
I think there are two issues here. One is that the internal NetworkInspection class should be
rethrow(ex);
instead of
rethrow ex
However there is still the issue in why this is triggering an exception. The rosservice definelty exists and calling the "rosservice type /iiwa_1/controller_manager/list_controller_types" command works as expected.
The exception ex is:
ex =
MException with properties:
identifier: 'ros:internal:transport:TransportError'
message: 'Connection to server timed out. Server Unreachable'
cause: {}
stack: [2×1 struct]
Correction: []
Note this happens for all external ros services. Ros services defined internally to matlab such as in https://uk.mathworks.com/help/ros/ug/call-and-provide-ros-services.html do not have this issue.

 Respuesta aceptada

Joshua Davy
Joshua Davy el 31 de En. de 2022

0 votos

To the person that stumbles on this. It was caused by me not setting up my enviroment variables between windows and WSL 2 (where i was running gazebo).
I followed this guide and fixed the issue:

Más respuestas (0)

Categorías

Más información sobre Network Connection and Exploration en Centro de ayuda y File Exchange.

Productos

Versión

R2021b

Preguntada:

el 31 de En. de 2022

Respondida:

el 31 de En. de 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by