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.

 Réponse acceptée

Joshua Davy
Joshua Davy le 31 Jan 2022

0 votes

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:

Plus de réponses (0)

Catégories

En savoir plus sur Network Connection and Exploration dans Centre d'aide et File Exchange

Produits

Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by