本文整理汇总了C++中yarp::sig::Vector::zero方法的典型用法代码示例。如果您正苦于以下问题:C++ Vector::zero方法的具体用法?C++ Vector::zero怎么用?C++ Vector::zero使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yarp::sig::Vector
的用法示例。
在下文中一共展示了Vector::zero方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readEncoders
bool icubFinger::readEncoders(yarp::sig::Vector &encoderValues){
bool ret = false;
encoderValues.resize(3);
encoderValues.zero();
int pendingReads = _fingerEncoders->getPendingReads();
Bottle *handEnc = NULL;
for(int i = 0; i <= pendingReads; i++){
handEnc = _fingerEncoders->read();
}
if(handEnc != NULL)
{
encoderValues[0] = handEnc->get(_proximalEncoderIndex).asDouble();
encoderValues[1] = handEnc->get(_middleEncoderIndex).asDouble();
encoderValues[2] = handEnc->get(_distalEncoderIndex).asDouble();
ret = true;
adjustMinMax(encoderValues[0], _minProximal, _maxProximal);
adjustMinMax(encoderValues[1], _minMiddle, _maxMiddle);
adjustMinMax(encoderValues[2], _minDistal, _maxDistal);
}
//cout << "Encoders: " << encoderValues.toString() << endl;
return ret;
}
示例2: getTactileDataComp
void MiddleFinger::getTactileDataComp(yarp::sig::Vector &tactileData){
tactileData.resize(12);
tactileData.zero();
Bottle *tactileDataPort = _tactileDataComp_in->read();
int startIndex = 12;
if(tactileDataPort != NULL){
for(int i = startIndex; i < startIndex + 12; ++i){
tactileData[i - startIndex] = tactileDataPort->get(i).asDouble();
}
}
}
示例3: read
bool BoschIMU::read(yarp::sig::Vector &out)
{
mutex.wait();
out.resize(nChannels);
out.zero();
out = data;
if(nChannels == 16)
{
out[12] = quaternion.w();
out[13] = quaternion.x();
out[14] = quaternion.y();
out[15] = quaternion.z();
}
mutex.post();
return true;
};
示例4: getTactileDataRaw
void MiddleFinger::getTactileDataRaw(yarp::sig::Vector &rawTactileData){
// Read from the port
rawTactileData.resize(12);
rawTactileData.zero();
Bottle* tactileData;
tactileData = _rawTactileData_in->read();
//cout << tactileData->toString() << endl;
int startIndex = 12;
if(tactileData != NULL){
for (int i = startIndex; i < 12; ++i)
{
rawTactileData[i - startIndex] = tactileData->get(i).asDouble();
}
}
}