roslibjs.getParam returns "Service /rosapi/get_param_names does not exist"
Posting on behalf of coworkers so I don't have full output.
wiki.ros.org/roslibjs/Tutorials explains the usage of ros.getParams
. Calling the following snippet returns undefined object.
const test = new ROSLIB.Param({
ros: this.api,
name: "/our_custom/custom_param"
});
//this.paramRefs["bolles_support_version"].get(
test.get(
result => {
console.dir(result);
if (callback) {
callback(result);
}
},
error => {
console.dir(error);
this.props.addAlert({
variant: "error",
message: error
});
}
);
Calling this.api.getParams() returns:
Service /rosapi/get_param_names does not exist
On ROS "backend", there's this node running:
<node pkg="rosbridge_server" type="rosbridge_websocket" name="rosbridge_webbridge" output="screen" respawn="true">
What is missing on our setup?
Asked by 130s on 2020-05-14 11:35:11 UTC
Answers
Posting our own finding. Digging into RobotWebTools/roslibjs/src/core/Ros.js#L479. With this, the error /rosapi/get_param_names does not exist
"makes sense" -- rosapi is expected to be in the Parameter's namespace, which implies the param is expected to be registered by rosapi. But in our running ROS system, rosapi
is not running. Also found this comment RobotWebTools/rosbridge_suite/#336 that recommends running a node out of rosapi
.
So if that's the right way we're fine. But it's a bit strange that roslibjs
can't get the parameters unless additional "backend" nodes are started (why rosbridge_server
not takes care of it by deafault?). We just need this clarified and documented if needed.
Asked by 130s on 2020-05-14 11:37:55 UTC
Comments
Getting convinced about roots of problem, I posted on the repo as well https://github.com/RobotWebTools/roslibjs/issues/364
Asked by 130s on 2020-05-14 17:28:48 UTC
Comments