Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 36 additions & 2 deletions src/core/Param.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ export default class Param {
paramClient.callService(
request,
function (result) {
if (result.successful !== undefined && result.successful === false) {
if (failedCallback) {
failedCallback(result.reason);
}
return;
}
var value = JSON.parse(result.value);
callback(value);
},
Expand Down Expand Up @@ -78,7 +84,21 @@ export default class Param {
value: JSON.stringify(value)
};

paramClient.callService(request, callback, failedCallback);
paramClient.callService(
request,
function (result) {
if (result.successful !== undefined && result.successful === false) {
if (failedCallback) {
failedCallback(result.reason);
}
return;
}
if (callback) {
callback(result);
}
},
failedCallback
);
}
/**
* Delete this parameter on the ROS server.
Expand All @@ -97,6 +117,20 @@ export default class Param {
name: this.name
};

paramClient.callService(request, callback, failedCallback);
paramClient.callService(
request,
function (result) {
if (result.successful !== undefined && result.successful === false) {
if (failedCallback) {
failedCallback(result.reason);
}
return;
}
if (callback) {
callback(result);
}
},
failedCallback
);
}
}