Helper gist for robotology/community#131.
iCub_SIM
yarprobotinterface --context simCartesianControl --config no_legs.xml
iKinCartesianSolver --context simCartesianControl --part left_arm
$ ./test-gotoposesync
The user can ask for the Cartesian movement by sending the command g
directly within the console, which is in turn attached to the module (i.e. no need for connecting a dedicated rpc port).
Upon receiving user requests, the robot hand will bounce between two Cartesian positions.
$> ./test-gotoposesync.exe
yarp: Port /local/left_arm/command:o active at tcp://192.168.1.85:30109/
yarp: Port /local/left_arm/state:i active at tcp://192.168.1.85:30110/
yarp: Port /local/left_arm/events:i active at tcp://192.168.1.85:30111/
yarp: Port /local/left_arm/rpc:o active at tcp://192.168.1.85:30112/
yarp: Sending output from /local/left_arm/rpc:o to /icubSim/cartesianController/left_arm/rpc:i using tcp
yarp: Sending output from /local/left_arm/command:o to /icubSim/cartesianController/left_arm/command:i
using udp
yarp: Receiving input from /icubSim/cartesianController/left_arm/state:o to /local/left_arm/state:i using udp
yarp: Receiving input from /icubSim/cartesianController/left_arm/events:o to /local/left_arm/events:i using udp
[INFO]created wrapper <cartesiancontrollerclient>. See C++ class ClientCartesianController for documentation.
Listening to terminal (type "quit" to stop module)
[INFO]running happily...
g
[INFO]going to (-0.289 0.036 0.001)...
[INFO]...target attained!
[ack]
g
[INFO]running happily...
[INFO]going to (-0.289 -0.164 0.001)...
[INFO]...target attained!
[ack]
[try 1 of 3] Trying to shut down
RFModule closing
WARNING: module attached to terminal calling exit() to quit.
You should be aware that this is not a good way to stop a module. Effects will be:
- class destructors will NOT be called
- code in the main after runModule() will NOT be executed
This happens because in your module you called attachTerminal() and we don't have a portable way to quit a module that is listening to the terminal.
At the moment the only way to have the module quit correctly is to avoid listening to terminal(i.e. do
not call attachTerminal()).
This will also make this annoying message go away.
yarp: Removing output from /local/left_arm/command:o to /icubSim/cartesianController/left_arm/command:iyarp: Removing input from /icubSim/cartesianController/left_arm/state:o to /local/left_arm/state:i
yarp: Removing input from /icubSim/cartesianController/left_arm/events:o to /local/left_arm/events:i
yarp: Removing output from /local/left_arm/rpc:o to /icubSim/cartesianController/left_arm/rpc:i
$>