41 for (
size_t i=0; i<n_joints; i++)
42 m_trajectoryTime[i] = t;
48 m_trajectoryTime[j] = t;
56 yError() <<
"Invalid pointer to Polydriver!";
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);
73 yError() <<
"Unable to view some interface!";
78 ok &= ienc_ll->
getAxes(n_joints);
81 m_trajectoryTime.resize(n_joints,4.0);
84 for (
size_t i = 0; i < n_joints; i++)
86 m_stored_speed.push_back(20.0);
100 if (!icmd_ll)
return false;
106 if (!icmd_ll)
return false;
112 if (!iposdir_ll)
return false;
118 if (!ienc_ll)
return false;
124 if (!ipos_ll)
return false;
134 double speed =
diff/m_trajectoryTime[j];
150 std::ostringstream oss;
151 oss << std::fixed << std::setprecision(2);
153 for (
size_t i = 0; i <
vec.size(); ++i) {
155 if (i + 1 !=
vec.size()) oss <<
" ";
define control board standard interfaces
contains the definition of a Vector type
bool setTrajectoryTime(double t)
bool setPosition(int j, double ref)
bool configure(yarp::dev::PolyDriver *pd)
bool setControlMode(const int j, const yarp::dev::SelectableControlModeEnum mode)
bool getEncoder(int j, double *v)
bool storeRefVelocities()
bool getControlMode(const int j, yarp::dev::ControlModeEnum &mode)
bool positionMove(int j, double ref)
bool view(T *&x)
Get an interface to the device driver.
virtual yarp::dev::ReturnValue getControlMode(int j, yarp::dev::ControlModeEnum &mode)=0
Get the current control mode.
virtual yarp::dev::ReturnValue setControlMode(int j, yarp::dev::SelectableControlModeEnum mode)=0
Set the current control mode.
virtual yarp::dev::ReturnValue getEncoder(int j, double *v)=0
Read the value of an encoder.
virtual yarp::dev::ReturnValue getAxes(size_t &ax)=0
Get the number of controlled axes.
virtual yarp::dev::ReturnValue setTrajSpeed(int j, double sp)=0
Set reference speed for a joint, this is the speed used during the interpolation of the trajectory.
virtual yarp::dev::ReturnValue getTrajSpeeds(double *spds)=0
Get reference speed of all joints.
virtual yarp::dev::ReturnValue setTrajSpeeds(const double *spds)=0
Set reference speed on all joints.
virtual yarp::dev::ReturnValue positionMove(int j, double ref)=0
Set new reference point for a single axis.
virtual yarp::dev::ReturnValue setPosition(int j, double ref)=0
Set new position for a single axis.
A container for a device driver.
bool isValid() const
Check if device is valid.
A mini-server for performing network communication in the background.
For streams capable of holding different kinds of content, check what they actually have.
SelectableControlModeEnum
An interface to the operating system, including Port based communication.
std::string vectorToString(const std::vector< double > &vec)
int diff(std::string contextName, folderType fType, bool verbose)