RobotWebTools / ros2-web-bridge

Bridging your browser to the ROS 2.0
Apache License 2.0
203 stars 68 forks source link

Mismatch in service call from rosbridge protocol #192

Open connormbrooks opened 3 years ago

connormbrooks commented 3 years ago

Hi, I have encountered errors when creating ROS service calls using a 3rd party application (ROS#) that I have traced to what appears to be a mismatch with the rosbridge protocol being implemented here. The issue here is the list of expected parameters for a call_service op. The rosbridge protocol does not expect a type parameter (see: here); however, the type parameter is referenced in the ros2-web-bridge/lib/bridge.js script here).

This causes the following error when attempting to call a service according to the rosbridge protocol specifications:

JSON command received: {"service":"/rosapi/get_param","args":{"name":"/rosdistro","default":"default"},"fragment_size":2147483647,"compression":"none","op":"call_service","id":"/rosapi/getparam:0"} Response: {"op":"status","level":"error","msg":"call_service: TypeError: Cannot read property 'indexOf' of undefined","id":"/rosapi/get_param:0"}

I have verified that this TypeError is being caused by attempting to pass in command.type to the _exractServiceType function in bridge.js

Thanks in advance for your help!