本文整理汇总了C++中al::ALValue::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ ALValue::clear方法的具体用法?C++ ALValue::clear怎么用?C++ ALValue::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类al::ALValue
的用法示例。
在下文中一共展示了ALValue::clear方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: create_actuator_stiffness_aliases
/**
* \brief: Create the aliases for controlling the joint stiffnesses.
**/
void hal_experimental::create_actuator_stiffness_aliases()
{
LOG("[create_actuator_stiffness]", "create actuator stiffness initializing...");
AL::ALValue jointAliases;
try
{
jointAliases.clear();
jointAliases.arraySetSize(2);
jointAliases[0] = std::string("jointStiffness");
jointAliases[1].arraySetSize(25);
int j = 0;
for(int i = NumOfPositionActuatorIds; i <= rAnkleRollStiffnessActuator; ++i)
{
jointAliases[1][j] = actuatorNames[i];
++j;
}
// jointAliases[1][HEAD_PITCH] = std::string("Device/SubDeviceList/HeadPitch/Hardness/Actuator/Value");
// jointAliases[1][HEAD_YAW] = std::string("Device/SubDeviceList/HeadYaw/Hardness/Actuator/Value");
// jointAliases[1][L_ANKLE_PITCH] = std::string("Device/SubDeviceList/LAnklePitch/Hardness/Actuator/Value");
// jointAliases[1][L_ANKLE_ROLL] = std::string("Device/SubDeviceList/LAnkleRoll/Hardness/Actuator/Value");
// jointAliases[1][L_ELBOW_ROLL] = std::string("Device/SubDeviceList/LElbowRoll/Hardness/Actuator/Value");
// jointAliases[1][L_ELBOW_YAW] = std::string("Device/SubDeviceList/LElbowYaw/Hardness/Actuator/Value");
// jointAliases[1][L_HAND] = std::string("Device/SubDeviceList/LHand/Hardness/Actuator/Value");
// jointAliases[1][L_HIP_PITCH] = std::string("Device/SubDeviceList/LHipPitch/Hardness/Actuator/Value");
// jointAliases[1][L_HIP_ROLL] = std::string("Device/SubDeviceList/LHipRoll/Hardness/Actuator/Value");
// jointAliases[1][L_HIP_YAW_PITCH] = std::string("Device/SubDeviceList/LHipYawPitch/Hardness/Actuator/Value");
// jointAliases[1][L_KNEE_PITCH] = std::string("Device/SubDeviceList/LKneePitch/Hardness/Actuator/Value");
// jointAliases[1][L_SHOULDER_PITCH] = std::string("Device/SubDeviceList/LShoulderPitch/Hardness/Actuator/Value");
// jointAliases[1][L_SHOULDER_ROLL] = std::string("Device/SubDeviceList/LShoulderRoll/Hardness/Actuator/Value");
// jointAliases[1][L_WRIST_YAW] = std::string("Device/SubDeviceList/LWristYaw/Hardness/Actuator/Value");
// jointAliases[1][R_ANKLE_PITCH] = std::string("Device/SubDeviceList/RAnklePitch/Hardness/Actuator/Value");
// jointAliases[1][R_ANKLE_ROLL] = std::string("Device/SubDeviceList/RAnkleRoll/Hardness/Actuator/Value");
// jointAliases[1][R_ELBOW_ROLL] = std::string("Device/SubDeviceList/RElbowRoll/Hardness/Actuator/Value");
// jointAliases[1][R_ELBOW_YAW] = std::string("Device/SubDeviceList/RElbowYaw/Hardness/Actuator/Value");
// jointAliases[1][R_HAND] = std::string("Device/SubDeviceList/RHand/Hardness/Actuator/Value");
// jointAliases[1][R_HIP_PITCH] = std::string("Device/SubDeviceList/RHipPitch/Hardness/Actuator/Value");
// jointAliases[1][R_HIP_ROLL] = std::string("Device/SubDeviceList/RHipRoll/Hardness/Actuator/Value");
// jointAliases[1][R_KNEE_PITCH] = std::string("Device/SubDeviceList/RKneePitch/Hardness/Actuator/Value");
// jointAliases[1][R_SHOULDER_PITCH] = std::string("Device/SubDeviceList/RShoulderPitch/Hardness/Actuator/Value");
// jointAliases[1][R_SHOULDER_ROLL] = std::string("Device/SubDeviceList/RShoulderRoll/Hardness/Actuator/Value");
// jointAliases[1][R_WRIST_YAW] = std::string("Device/SubDeviceList/RWristYaw/Hardness/Actuator/Value");
}
catch(const AL::ALError &e)
{
std::cout << "[create_actuator_stiffness][ERROR]: Error setting up the aliase: " << e.toString() << std::endl;
}
try
{
dcm_proxy->createAlias(jointAliases);
log_file << "stiffness alias added to DCM!\n";
}
catch(const AL::ALError &e)
{
LOG("[create_actuator_stiffness]","[ERROR]: An error occured while creating stiffness actuator aliases: " + e.toString());
}
LOG("[create_actuator_stiffness]","create actuator stiffness initialized");
}