cartesianServer
Collaboration diagram for cartesianServer:

The cartesianServer module creates an instance of CartesianServer to load a controller (default: CartesianBot) and acts as the server part of a network wrapper for it.

Legal

Copyright: 2012 (C) Universidad Carlos III de Madrid

Author: Juan G. Victores

Contrib: Paul Fitzpatrick (YARP sample code, email responses); Ugo Pattacini (author of Customizing the Cartesian Interface for a Generic Robot, email responses)

CopyPolicy: Released under the terms of the LGPLv2.1 or later, see license/LGPL.TXT

Installation

The module is compiled when ENABLE_cartesianServer is activated (default: OFF). For further installation steps refer to your own system installation guidelines.

Running (assuming correct installation)

First we must run a YARP name server if it is not running in our current namespace:

[on terminal 1] yarp server

And then launch the actual module:

[on terminal 2] cartesianServer

You should get a window similar to the one depicted on Figure 1.

ravebot-300px.png
Fig. 1 - An instance of the cartesianServer module.

Interfacing with the cartesianServer module

The cartesianServer module acts as the server part of a network wrapper of the CartesianBot class using the CartesianServer class. The implementation maps certain YARP rpc's to CartesianBot function calls. Therefore, we can interface with the class from the command-line (or try using the new CartesianClient library) by typing:

[on terminal 3] yarp rpc /ravebot/cartesianServer/rpc:i

Note 1: Change 'ravebot' for 'canbot' for the real robot!

Note 2: The default configuration also loads a YARP controlboard device, so you can interact with it as in testRaveBot too.

Note 3: Remember that the use of [brackets] means we are sending a VOCAB. The use of (parenthesis) means we are sending a list, which is a Bottle inside a Bottle.

We send Cartesian positions/orientations as lists of five elements: x[m], y[m], z[m], rot(y')[deg], rot(z'')[deg] of the end-effector in absolute base coordinates. The first rotation, rot(z), is given by x and y.

The following table depicts implemented RPC commands you can issue from this connection (similar to the CartesianClient class API, as it actually wraps these commands).

RPC command format Example response Description
[help] Available commands: [help] [inv] [movj] .... Returns a list of commands similar to this one.
[inv] (0.3 0.3 0.7 90 0) (45.0 -41.169914 116.855705 14.314209 0.0) [ok] Kinematic inversion without movement, returns the joint values that would be needed to reach that position.
[movj] (.1 .1 .7 90 0) [ok] Movement with interpolation in the Joint space.
[movl] (.1 .3 .8 90 0) [ok] Movement with interpolation in Cartesian space.
[stat] (0.0 0.0 1.4 0.0 0.0) [ok] Status poll, returns the current cartesian position (perform direct kinematics).
[stop] [ok] Stop.
[tool] 1 [ok] Select tool.

As an example of use, we can get the current Cartesian position (perform direct kinematics) by sending a [stat] rpc:

[on terminal 3] [stat]

And should get some kind of feedback, such as:

Response: (0.0 0.0 1.4 0.0 0.0) [ok]

The implementation also maps certain YARP streaming commands to CartesianBot function calls. Therefore, we can also interface with the class from the command-line by typing (change 'ravebot' for 'canbot' for the real robot):

[on terminal 4] yarp write ... /ravebot/cartesianServer/command:i

The following table depicts implemented streaming commands you can issue from this connection (no acknowledgement response).

Streaming command format Description
[bkwd] (0.0 90.0) [Track virtual point behind the end-effector] (dot(rot(z))[deg/s] rot(y')[deg])
[fwd] (0.0 90.0) [Track virtual point in front of end-effector] (dot(rot(z))[deg/s] rot(y')[deg]))
[rot] (0.0 90.0) [Track virtual point orientation] (dot(rot(z))[deg/s] rot(y')[deg]))
[vmos] (0.0 1.0 0.0 0.0 0.0) Direct velocity movement command, in the Cartesian space.
[pose] (0.0 1.0 0.0 0.0 0.0) Direct pose movement command, in the Cartesian space.

Modify

This file can be edited at src/modules/cartesianServer/main.cpp