本文整理汇总了C++中Orientation::setYaw方法的典型用法代码示例。如果您正苦于以下问题:C++ Orientation::setYaw方法的具体用法?C++ Orientation::setYaw怎么用?C++ Orientation::setYaw使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Orientation
的用法示例。
在下文中一共展示了Orientation::setYaw方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
//.........这里部分代码省略.........
jointIDs.push_back(atoi(moduleNode->FirstChildElement("Joint")->GetText()));
//-- Get Auxiliar IDs
tinyxml2::XMLElement* idsElement = moduleNode->FirstChildElement("IDs");
if ( idsElement != NULL )
{
//-- Get Function ID
const char* functionStr = idsElement->FirstChildElement("Function")->GetText();
std::string functionStdStr = std::string(functionStr);
removeBadCharacters(functionStdStr);
if ( functionStdStr.compare("Limb") == 0)
id_function_vector.push_back(ModuleFunction_limb);
else if ( functionStdStr.compare("Coxa") == 0)
id_function_vector.push_back(ModuleFunction_coxa);
else if ( functionStdStr.compare("Thorax") == 0)
id_function_vector.push_back(ModuleFunction_thorax);
else
id_function_vector.push_back(ModuleFunction_none);
//-- Get Remaining IDs
id_depth_vector.push_back(atoi(idsElement->FirstChildElement("Depth")->GetText()));
id_shape_vector.push_back(atoi(idsElement->FirstChildElement("Shape")->GetText()));
id_num_limbs_vector.push_back(atoi(idsElement->FirstChildElement("NumLimbs")->GetText()));
id_limbs_vector.push_back(atoi(idsElement->FirstChildElement("LimbID")->GetText()));
}
//-- Get orientation info
tinyxml2::XMLElement* orientationElement = moduleNode->FirstChildElement("Orientation");
Orientation orientation;
orientation.setRoll(atoi(orientationElement->FirstChildElement("Roll")->GetText()));
orientation.setPitch(atoi(orientationElement->FirstChildElement("Pitch")->GetText()));
orientation.setYaw(atoi(orientationElement->FirstChildElement("Yaw")->GetText()));
orientation_vector.push_back(orientation);
//-- Get connector info
std::vector< std::vector<int> > connectorInfo;
std::vector<std::string> connectorTags;
connectorTags.push_back("front");
connectorTags.push_back("right");
connectorTags.push_back("back");
connectorTags.push_back("left");
tinyxml2::XMLElement* connectorElement = moduleNode->FirstChildElement("Connections");
for (int i = 0; i < (int) connectorTags.size(); i++)
{
tinyxml2::XMLElement* currentConnector = connectorElement->FirstChildElement(connectorTags[i].c_str());
if ( currentConnector )
{
std::vector<int> currentConnectorInfo;
//-- Get who is the module connected to this one
currentConnectorInfo.push_back(atoi(currentConnector->Attribute("connectedTo")));
//-- Get who is the connector connected to this one
const char* connectorStr = currentConnector->Attribute("connector");
std::string connectorStdStr = std::string(connectorStr);
removeBadCharacters(connectorStdStr);
if ( connectorStdStr.compare("front") == 0)
{
currentConnectorInfo.push_back(0);
}