3 #ifndef __CARTESIAN_CONTROL_CLIENT_HPP__
4 #define __CARTESIAN_CONTROL_CLIENT_HPP__
8 #include <yarp/os/Bottle.h>
9 #include <yarp/os/BufferedPort.h>
10 #include <yarp/os/PortReaderBuffer.h>
11 #include <yarp/os/RpcClient.h>
13 #include <yarp/dev/Drivers.h>
37 void onRead(yarp::os::Bottle& b)
override;
38 bool getLastStatData(std::vector<double> &x,
int *state,
double * timestamp,
double timeout);
41 double localArrivalTime;
44 std::vector<double> x;
45 mutable std::mutex mtx;
57 bool stat(std::vector<double> &x,
int * state =
nullptr,
double * timestamp =
nullptr)
override;
58 bool inv(
const std::vector<double> &xd, std::vector<double> &q)
override;
59 bool movj(
const std::vector<double> &xd)
override;
60 bool relj(
const std::vector<double> &xd)
override;
61 bool movl(
const std::vector<double> &xd)
override;
62 bool movv(
const std::vector<double> &xdotd)
override;
64 bool forc(
const std::vector<double> &fd)
override;
66 bool wait(
double timeout)
override;
67 bool tool(
const std::vector<double> &x)
override;
68 bool act(
int command)
override;
69 void pose(
const std::vector<double> &x)
override;
70 void twist(
const std::vector<double> &xdot)
override;
71 void wrench(
const std::vector<double> &w)
override;
74 bool setParameters(
const std::map<int, double> & params)
override;
78 bool open(yarp::os::Searchable& config)
override;
79 bool close()
override;
82 bool handleRpcRunnableCmd(
int vocab);
83 bool handleRpcConsumerCmd(
int vocab,
const std::vector<double>& in);
84 bool handleRpcFunctionCmd(
int vocab,
const std::vector<double>& in, std::vector<double>& out);
86 void handleStreamingConsumerCmd(
int vocab,
const std::vector<double>& in);
87 void handleStreamingBiConsumerCmd(
int vocab,
const std::vector<double>& in1,
double in2);
89 yarp::os::RpcClient rpcClient;
90 yarp::os::BufferedPort<yarp::os::Bottle> fkInPort, commandPort;
93 double fkStreamTimeoutSecs;
Contains roboticslab::ICartesianControl and related vocabs.
The CartesianControlClient class implements ICartesianControl client side.
Definition: CartesianControlClient.hpp:54
bool stopControl() override
Stop control.
Definition: ICartesianControlImpl.cpp:237
bool forc(const std::vector< double > &fd) override
Force control.
Definition: ICartesianControlImpl.cpp:230
bool tool(const std::vector< double > &x) override
Change tool.
Definition: ICartesianControlImpl.cpp:258
void pose(const std::vector< double > &x) override
Achieve pose.
Definition: ICartesianControlImpl.cpp:279
bool movl(const std::vector< double > &xd) override
Linear move to target position.
Definition: ICartesianControlImpl.cpp:209
bool inv(const std::vector< double > &xd, std::vector< double > &q) override
Inverse kinematics.
Definition: ICartesianControlImpl.cpp:188
bool stat(std::vector< double > &x, int *state=nullptr, double *timestamp=nullptr) override
Current state and position.
Definition: ICartesianControlImpl.cpp:141
void twist(const std::vector< double > &xdot) override
Instantaneous velocity steps.
Definition: ICartesianControlImpl.cpp:286
bool gcmp() override
Gravity compensation.
Definition: ICartesianControlImpl.cpp:223
bool setParameter(int vocab, double value) override
Set a configuration parameter.
Definition: ICartesianControlImpl.cpp:300
bool relj(const std::vector< double > &xd) override
Move in joint space, relative coordinates.
Definition: ICartesianControlImpl.cpp:202
void wrench(const std::vector< double > &w) override
Exert force.
Definition: ICartesianControlImpl.cpp:293
bool getParameter(int vocab, double *value) override
Retrieve a configuration parameter.
Definition: ICartesianControlImpl.cpp:315
bool movv(const std::vector< double > &xdotd) override
Linear move with given velocity.
Definition: ICartesianControlImpl.cpp:216
bool movj(const std::vector< double > &xd) override
Move in joint space, absolute coordinates.
Definition: ICartesianControlImpl.cpp:195
bool setParameters(const std::map< int, double > ¶ms) override
Set multiple configuration parameters.
Definition: ICartesianControlImpl.cpp:336
bool getParameters(std::map< int, double > ¶ms) override
Retrieve multiple configuration parameters.
Definition: ICartesianControlImpl.cpp:357
bool act(int command) override
Actuate tool.
Definition: ICartesianControlImpl.cpp:265
bool wait(double timeout) override
Wait until completion.
Definition: ICartesianControlImpl.cpp:244
Responds to streaming FK messages.
Definition: CartesianControlClient.hpp:34
Abstract base class for a cartesian controller.
Definition: ICartesianControl.h:146
The main, catch-all namespace for Robotics Lab UC3M.
Definition: groups.dox:6