3 #ifndef __CARTESIAN_CONTROL_SERVER_HPP__
4 #define __CARTESIAN_CONTROL_SERVER_HPP__
8 #include <yarp/os/Bottle.h>
9 #include <yarp/os/BufferedPort.h>
10 #include <yarp/os/PeriodicThread.h>
11 #include <yarp/os/RpcServer.h>
13 #include <yarp/dev/Drivers.h>
14 #include <yarp/dev/PolyDriver.h>
15 #include <yarp/dev/WrapperSingle.h>
18 #include "KinematicRepresentation.hpp"
31 class RpcTransformResponder;
32 class StreamResponder;
39 public yarp::dev::WrapperSingle,
40 public yarp::os::PeriodicThread
47 bool open(yarp::os::Searchable & config)
override;
48 bool close()
override;
51 bool attach(yarp::dev::PolyDriver * poly)
override;
52 bool detach()
override;
58 bool configureHandle();
60 yarp::dev::PolyDriver cartesianControlDevice;
62 yarp::os::RpcServer rpcServer, rpcTransformServer;
63 yarp::os::BufferedPort<yarp::os::Bottle> fkOutPort, commandPort;
86 { iCartesianControl = _iCartesianControl; }
88 bool respond(
const yarp::os::Bottle & in, yarp::os::Bottle & out)
override;
92 virtual bool transformIncomingData(std::vector<double> & vin)
95 virtual bool transformOutgoingData(std::vector<double> & vout)
101 using FunctionFun = bool (
ICartesianControl::*)(
const std::vector<double> &, std::vector<double> &);
103 bool handleStatMsg(
const yarp::os::Bottle & in, yarp::os::Bottle & out);
104 bool handleWaitMsg(
const yarp::os::Bottle & in, yarp::os::Bottle & out);
105 bool handleActMsg(
const yarp::os::Bottle & in, yarp::os::Bottle & out);
107 bool handleRunnableCmdMsg(
const yarp::os::Bottle & in, yarp::os::Bottle & out, RunnableFun cmd);
108 bool handleConsumerCmdMsg(
const yarp::os::Bottle & in, yarp::os::Bottle & out, ConsumerFun cmd);
109 bool handleFunctionCmdMsg(
const yarp::os::Bottle & in, yarp::os::Bottle & out, FunctionFun cmd);
111 bool handleParameterSetter(
const yarp::os::Bottle & in, yarp::os::Bottle & out);
112 bool handleParameterGetter(
const yarp::os::Bottle & in, yarp::os::Bottle & out);
114 bool handleParameterSetterGroup(
const yarp::os::Bottle & in, yarp::os::Bottle & out);
115 bool handleParameterGetterGroup(
const yarp::os::Bottle & in, yarp::os::Bottle & out);
136 bool transformIncomingData(std::vector<double> & vin)
override;
137 bool transformOutgoingData(std::vector<double> & vout)
override;
152 { iCartesianControl = _iCartesianControl;}
154 void onRead(yarp::os::Bottle & b)
override;
158 using BiConsumerFun = void (
ICartesianControl::*)(
const std::vector<double> &, double);
160 void handleConsumerCmdMsg(
const yarp::os::Bottle & in, ConsumerFun cmd);
161 void handleBiConsumerCmdMsg(
const yarp::os::Bottle & in, BiConsumerFun cmd);
Contains roboticslab::ICartesianControl and related vocabs.
The CartesianControlServer class implements ICartesianControl server side.
Definition: CartesianControlServer.hpp:41
Abstract base class for a cartesian controller.
Definition: ICartesianControl.h:146
Responds to RPC command messages.
Definition: CartesianControlServer.hpp:77
Responds to streaming command messages.
Definition: CartesianControlServer.hpp:149
coordinate_system
Lists available translational representations.
Definition: KinematicRepresentation.hpp:27
orientation_system
Lists available rotational representations.
Definition: KinematicRepresentation.hpp:36
angular_units
Lists recognized angular units.
Definition: KinematicRepresentation.hpp:48
The main, catch-all namespace for Robotics Lab UC3M.
Definition: groups.dox:6