28 drvOptions_ll.
clear();
36 drvOptions_ll.
put(
"device",
"remotecontrolboardremapper");
38 yDebug() <<
"remoteControlBoards will use the following configuration:";
41 drvOptions_ll.
put(
"axesNames", options.
find(
"axesNames"));
42 drvOptions_ll.
put(
"remoteControlBoards",options.
find(
"remoteControlBoards"));
43 drvOptions_ll.
put(
"localPortPrefix", options.
find(
"localPortPrefix"));
46 pcb.put(
"carrier",
"fast_tcp");
50 yDebug() <<
"driver options:\n" << drvOptions_ll.
toString().c_str();
58 drv_ll.
open(drvOptions_ll);
63 ok = drv_ll.
view(ipos_ll) && drv_ll.
view(iposdir_ll) && drv_ll.
view(ienc_ll) &&
64 drv_ll.
view(ipid_ll) && drv_ll.
view(imotenc_ll) && drv_ll.
view(icmd_ll);
77 ok &= ienc_ll->
getAxes(&n_joints);
80 std::vector<double> speeds;
81 for (
int i = 0; i < n_joints; i++)
83 speeds.push_back(20.0);
96 if (!icmd_ll)
return false;
102 if (!iposdir_ll)
return false;
108 if (!ienc_ll)
return false;
114 if (!ipos_ll)
return false;
define control board standard interfaces
contains the definition of a Vector type
bool setPosition(int j, double ref)
bool configure(const yarp::os::Property &copt)
bool setControlMode(const int j, const int mode)
bool getEncoder(int j, double *v)
bool positionMove(int j, double ref)
bool view(T *&x)
Get an interface to the device driver.
virtual bool setControlMode(const int j, const int mode)=0
Set the current control mode.
virtual bool getEncoder(int j, double *v)=0
Read the value of an encoder.
virtual bool getAxes(int *ax)=0
Get the number of controlled axes.
virtual bool setRefSpeeds(const double *spds)=0
Set reference speed on all joints.
virtual bool positionMove(int j, double ref)=0
Set new reference point for a single axis.
virtual bool setPosition(int j, double ref)=0
Set new position for a single axis.
bool isValid() const
Check if device is valid.
bool open(const std::string &txt)
Construct and configure a device by its common name.
A mini-server for performing network communication in the background.
A class for storing options and configuration information.
Value & find(const std::string &key) const override
Gets a value corresponding to a given keyword.
std::string toString() const override
Return a standard text representation of the content of the object.
void put(const std::string &key, const std::string &value)
Associate the given key with the given string.
void clear()
Remove all associations.
Property & addGroup(const std::string &key)
Add a nested group.
std::string toString() const override
Return a standard text representation of the content of the object.
For streams capable of holding different kinds of content, check what they actually have.
An interface to the operating system, including Port based communication.