30 drvOptions_ll.
clear();
38 drvOptions_ll.
put(
"device",
"remotecontrolboardremapper");
40 yDebug() <<
"remoteControlBoards will use the following configuration:";
43 drvOptions_ll.
put(
"axesNames", options.
find(
"axesNames"));
44 drvOptions_ll.
put(
"remoteControlBoards",options.
find(
"remoteControlBoards"));
45 drvOptions_ll.
put(
"localPortPrefix", options.
find(
"localPortPrefix"));
48 pcb.put(
"carrier",
"fast_tcp");
52 yDebug() <<
"driver options:\n" << drvOptions_ll.
toString().c_str();
60 for (
size_t i=0; i<n_joints; i++)
61 m_trajectoryTime[i] = t;
67 m_trajectoryTime[j] = t;
73 drv_ll.
open(drvOptions_ll);
78 ok = drv_ll.
view(ipos_ll) && drv_ll.
view(iposdir_ll) && drv_ll.
view(ienc_ll) &&
79 drv_ll.
view(ipid_ll) && drv_ll.
view(imotenc_ll) && drv_ll.
view(icmd_ll);
92 ok &= ienc_ll->
getAxes(&n_joints);
95 m_trajectoryTime.resize(n_joints,4.0);
96 std::vector<double> speeds;
97 for (
int i = 0; i < n_joints; i++)
99 speeds.push_back(20.0);
112 if (!icmd_ll)
return false;
118 if (!iposdir_ll)
return false;
124 if (!ienc_ll)
return false;
130 if (!ipos_ll)
return false;
140 double speed =
diff/m_trajectoryTime[j];
define control board standard interfaces
contains the definition of a Vector type
bool setTrajectoryTime(double t)
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 setRefSpeed(int j, double sp)=0
Set reference speed for a joint, this is the speed used during the interpolation of the trajectory.
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.
int diff(std::string contextName, folderType fType, bool verbose)