rsb call [OPTIONS] SERVER-URI/METHOD([ARGUMENT])
Call METHOD of the RSB RPC server at SERVER-URI with argument ARGUMENT and print the result to standard output, if any.
SERVER-URI designates the root scope of the remote server and the transport that should be used.
Tip
For details regarding the URI syntax involved in transport and channel specifications, see URIs.
ARGUMENT is treated as follows:
Note
When written as part of a shell command, some of the above forms may require protection from processing by the shell, usually by surrounding the form in single quotes (‘). For example:
$ rsb call 'socket:/foobar/()' # empty argument
$ rsb call 'socket:/foo/bar(#P"my-file")' # read argument from my-file
The usual commandline options are accepted. Specialized commandline options:
If the result of the method call does not arrive within the amount of time specified by SPEC, consider the call to have failed and exit with non-zero status.
Do not wait for the result of the method call. Immediately return with zero status without printing a result to standard output.
$ rsb call 'spread:/mycomponent/control/status()'
"running" # prints return value, if any
$ rsb call 'spread:/mycomponent/control/terminate()'
$ # returns once the method call completes
In the above example, the call command is used to invoke the status and terminate methods of the remote server at scope /mycomponent/control without an argument.
$ cat my-data.txt | rsb call 'socket:/printer/print(-)'
$ cat my-data.txt | rsb call 'socket:/printer/print(-:binary)'
$ rsb call 'socket:/printer/print(#P"my-data.txt")'
$ rsb call 'socket:/printer/print(#P"my-data.txt":latin-1)'
$ rsb call 'socket:/printer/print(#P"my-data.txt":binary)'
Two ways of using the content of the file my-data.txt as argument in a call of the print method on the scope /printer. The call uses the socket transport (with its default configuration). This form can only be used for sending string payloads.
Note
Note the use of single quotes (') to prevent elements of the pathname #"Pmy-data.txt" from being processed by the shell.
$ rsb call \
-I…/rst-proto/proto/stable/ \
-l…/rst-proto/proto/stable/rst/robot/RobotCollision.proto \
'socket:/mycomponent/handlecollision(pb:.rst.robot.RobotCollision:{kind: "SELF" collision_detail: { geometry: { contact_points: [ { x: 0 y: 1 z: 2 frame_id: "foo" }, { x: 3 y: 4 z: 5 } ] } object_1: "o1" } })'
In the above example, the call tool is used to call the handlecollision method of the remote server at scope /mycomponent with a protocol buffer message argument. The protocol buffer message is of type rst.robot.RobotCollision with kind enum field set to SELF and an embedded rst.kinematics.ObjectCollision message with two contact points in the collision_detail field.
The specification of the message content uses the syntax produced/consumed by the various TextFormat classes of the protocol buffer API and the --decode/--encode options of the protoc binary.
Note
Note how the definition of the protocol buffer message type is loaded using -I (--idl-path) and -l (--load-idl) commandline options.
Implementation Language | Project | Repository Link |
---|---|---|
Common Lisp | rsb-tools-cl | “0.12” branch of https://code.cor-lab.org/git/rsb.git.tools-cl |