本文整理汇总了C++中yarp::sig::Vector::data方法的典型用法代码示例。如果您正苦于以下问题:C++ Vector::data方法的具体用法?C++ Vector::data怎么用?C++ Vector::data使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yarp::sig::Vector
的用法示例。
在下文中一共展示了Vector::data方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: YarptoiDynTree
bool YarptoiDynTree(const yarp::sig::Vector & yarpVector, iDynTree::Wrench & iDynTreeWrench)
{
if( yarpVector.size() != 6 ) return false;
memcpy(iDynTreeWrench.getLinearVec3().data(),yarpVector.data(),3*sizeof(double));
memcpy(iDynTreeWrench.getAngularVec3().data(),yarpVector.data()+3,3*sizeof(double));
return true;
}
示例2: toiDynTree
bool toiDynTree(const yarp::sig::Vector& yarpVector, VectorDynSize& iDynTreeVector)
{
iDynTreeVector.resize(yarpVector.size());
memcpy(iDynTreeVector.data(),yarpVector.data(),yarpVector.size()*sizeof(double));
return true;
}
示例3: iDynTreetoYarp
bool iDynTreetoYarp(const iDynTree::Wrench & iDynTreeWrench,yarp::sig::Vector & yarpVector)
{
if( yarpVector.size() != 6 ) { yarpVector.resize(6); }
memcpy(yarpVector.data(),iDynTreeWrench.getLinearVec3().data(),3*sizeof(double));
memcpy(yarpVector.data()+3,iDynTreeWrench.getAngularVec3().data(),3*sizeof(double));
return true;
}
示例4: toEigen
bool toEigen(const yarp::sig::Vector & vec_yrp, Eigen::VectorXd & vec_eigen)
{
if( vec_yrp.size() != vec_eigen.size() ) { vec_eigen.resize(vec_yrp.size()); }
if( memcpy(vec_eigen.data(),vec_yrp.data(),sizeof(double)*vec_eigen.size()) != NULL ) {
return true;
} else {
return false;
}
}
示例5: toYarp
bool toYarp(const iDynTree::Position& iDynTreePosition, yarp::sig::Vector& yarpVector)
{
if( yarpVector.size() != 3 )
{
yarpVector.resize(3);
}
memcpy(yarpVector.data(),iDynTreePosition.data(),3*sizeof(double));
return true;
}
示例6: controlArm
bool reactCtrlThread::controlArm(const yarp::sig::Vector &_vels)
{
VectorOf<int> jointsToSetA;
VectorOf<int> jointsToSetT;
if (!areJointsHealthyAndSet(jointsToSetA,"arm","velocity"))
{
yWarning("[reactCtrlThread]Stopping control because arm joints are not healthy!");
stopControlHelper();
return false;
}
if (useTorso)
{
if (!areJointsHealthyAndSet(jointsToSetT,"torso","velocity"))
{
yWarning("[reactCtrlThread]Stopping control because torso joints are not healthy!");
stopControlHelper();
return false;
}
}
if (!setCtrlModes(jointsToSetA,"arm","velocity"))
{
yError("[reactCtrlThread]I am not able to set the arm joints to velocity mode!");
return false;
}
if (useTorso)
{
if (!setCtrlModes(jointsToSetT,"torso","velocity"))
{
yError("[reactCtrlThread]I am not able to set the torso joints to velocity mode!");
return false;
}
}
printMessage(1,"Moving the robot with velocities: %s\n",_vels.toString(3,3).c_str());
if (useTorso)
{
Vector velsT(3,0.0);
velsT[0] = _vels[2]; //swapping pitch and yaw as per iKin vs. motor interface convention
velsT[1] = _vels[1];
velsT[2] = _vels[0]; //swapping pitch and yaw as per iKin vs. motor interface convention
ivelT->velocityMove(velsT.data());
ivelA->velocityMove(_vels.subVector(3,9).data()); //indexes 3 to 9 are the arm joints velocities
}
else
{
ivelA->velocityMove(_vels.data()); //if there is not torso, _vels has only the 7 arm joints
}
return true;
}
示例7:
void CB::YARPConfigurationVariables::getJointAccelerationsDirect(yarp::sig::Vector &v) {
if(enc==NULL) {
cout << "IPositionControl pointer is NULL!" << endl;
} else {
enc->getEncoderAccelerations(v.data());
}
}
示例8: updateVirtualAnalogSensorMeasure
bool ImplementVirtualAnalogSensor::updateVirtualAnalogSensorMeasure(yarp::sig::Vector &measure)
{
yarp::sig::Vector measure_raw;
castToMapper(helper)->voltageV2S(measure.data(), measure_raw.data());
bool ret = iVASRaw->updateVirtualAnalogSensorMeasureRaw(measure_raw);
return ret;
}
示例9: while
bool Vector::operator==(const yarp::sig::Vector &r) const
{
//check dimensions first
size_t c=size();
if (c!=r.size())
return false;
const double *tmp1=data();
const double *tmp2=r.data();
while(c--)
{
if (*tmp1++!=*tmp2++)
return false;
}
return true;
}
示例10: KDLtoYarp
bool KDLtoYarp(const KDL::Vector & kdlVector,yarp::sig::Vector & yarpVector)
{
if( yarpVector.size() != 3 ) { yarpVector.resize(3); }
memcpy(yarpVector.data(),kdlVector.data,3*sizeof(double));
return true;
}
示例11: toEigenVector
inline Eigen::Map<Eigen::VectorXd> toEigenVector(yarp::sig::Vector & vec)
{
return Eigen::Map<Eigen::VectorXd>(vec.data(), vec.size());
}
示例12: toEigen
Eigen::Map<const Eigen::VectorXd> toEigen(const yarp::sig::Vector & vec)
{
return Eigen::Map<const Eigen::VectorXd>(vec.data(),vec.size());
}
示例13: copyVector
void copyVector(const yarp::sig::Vector & src, double * dest)
{
memcpy(dest,src.data(),src.size()*sizeof(double));
}