Skip to content
Snippets Groups Projects
Commit fa6168b5 authored by Fabian Paus's avatar Fabian Paus
Browse files

RemoteGui: Split getValue function for easier overloading

parent 1d3913e9
No related branches found
No related tags found
No related merge requests found
...@@ -156,24 +156,24 @@ namespace armarx::RemoteGui ...@@ -156,24 +156,24 @@ namespace armarx::RemoteGui
); );
} }
void getValue(CartesianWaypointControllerConfig& cfg, void getValueFromMap(CartesianWaypointControllerConfig& cfg,
RemoteGui::ValueMap const& values, std::string const& name) RemoteGui::ValueMap const& values, std::string const& name)
{ {
cfg.maxPositionAcceleration = getValue<float>(values, name + "_maxAcc_Pos"); getValueFromMap(cfg.maxPositionAcceleration, values, name + "_maxAcc_Pos");
cfg.maxOrientationAcceleration = getValue<float>(values, name + "_maxAcc_Ori"); getValueFromMap(cfg.maxOrientationAcceleration, values, name + "_maxAcc_Ori");
cfg.maxNullspaceAcceleration = getValue<float>(values, name + "_maxAcc_Null"); getValueFromMap(cfg.maxNullspaceAcceleration, values, name + "_maxAcc_Null");
cfg.kpJointLimitAvoidance = getValue<float>(values, name + "_JointLimitAvoidance_KP"); getValueFromMap(cfg.kpJointLimitAvoidance, values, name + "_JointLimitAvoidance_KP");
cfg.jointLimitAvoidanceScale = getValue<float>(values, name + "_JointLimitAvoidance_Scale"); getValueFromMap(cfg.jointLimitAvoidanceScale, values, name + "_JointLimitAvoidance_Scale");
cfg.thresholdOrientationNear = getValue<float>(values, name + "_Thresholds_Ori_Near"); getValueFromMap(cfg.thresholdOrientationNear, values, name + "_Thresholds_Ori_Near");
cfg.thresholdOrientationReached = getValue<float>(values, name + "_Thresholds_Ori_Reached"); getValueFromMap(cfg.thresholdOrientationReached, values, name + "_Thresholds_Ori_Reached");
cfg.thresholdPositionNear = getValue<float>(values, name + "_Thresholds_Pos_Near"); getValueFromMap(cfg.thresholdPositionNear, values, name + "_Thresholds_Pos_Near");
cfg.thresholdPositionReached = getValue<float>(values, name + "_Thresholds_Pos_Reached"); getValueFromMap(cfg.thresholdPositionReached, values, name + "_Thresholds_Pos_Reached");
cfg.maxOriVel = getValue<float>(values, name + "_Max_vel_ori"); getValueFromMap(cfg.maxOriVel, values, name + "_Max_vel_ori");
cfg.maxPosVel = getValue<float>(values, name + "_Max_vel_pos"); getValueFromMap(cfg.maxPosVel, values, name + "_Max_vel_pos");
cfg.kpOri = getValue<float>(values, name + "_KP_ori"); getValueFromMap(cfg.kpOri, values, name + "_KP_ori");
cfg.kpPos = getValue<float>(values, name + "_KP_pos"); getValueFromMap(cfg.kpPos, values, name + "_KP_pos");
} }
} }
...@@ -32,6 +32,6 @@ namespace armarx::RemoteGui ...@@ -32,6 +32,6 @@ namespace armarx::RemoteGui
const std::string& name, const std::string& name,
const CartesianWaypointControllerConfig& val); const CartesianWaypointControllerConfig& val);
void getValue(CartesianWaypointControllerConfig& cfg, void getValueFromMap(CartesianWaypointControllerConfig& cfg,
RemoteGui::ValueMap const& values, std::string const& name); RemoteGui::ValueMap const& values, std::string const& name);
} }
...@@ -50,12 +50,12 @@ namespace armarx::RemoteGui ...@@ -50,12 +50,12 @@ namespace armarx::RemoteGui
return builder; return builder;
} }
void getValue(NJointCartesianWaypointControllerRuntimeConfig& cfg, void getValueFromMap(NJointCartesianWaypointControllerRuntimeConfig& cfg,
RemoteGui::ValueMap const& values, std::string const& name) RemoteGui::ValueMap const& values, std::string const& name)
{ {
getValue(cfg.wpCfg, values, name); getValueFromMap(cfg.wpCfg, values, name);
getValue(cfg.forceThreshold, values, name + "_forceThreshold"); getValueFromMap(cfg.forceThreshold, values, name + "_forceThreshold");
getValue(cfg.forceThresholdInRobotRootZ, values, name + "_forceThresholdInRobotRootZ"); getValueFromMap(cfg.forceThresholdInRobotRootZ, values, name + "_forceThresholdInRobotRootZ");
getValue(cfg.optimizeNullspaceIfTargetWasReached, values, name + "_optimizeNullspaceIfTargetWasReached"); getValueFromMap(cfg.optimizeNullspaceIfTargetWasReached, values, name + "_optimizeNullspaceIfTargetWasReached");
} }
} }
...@@ -32,11 +32,7 @@ namespace armarx::RemoteGui ...@@ -32,11 +32,7 @@ namespace armarx::RemoteGui
const std::string& name, const std::string& name,
const NJointCartesianWaypointControllerRuntimeConfig& val); const NJointCartesianWaypointControllerRuntimeConfig& val);
template <>
NJointCartesianWaypointControllerRuntimeConfig getValue<NJointCartesianWaypointControllerRuntimeConfig>(
ValueMap const& values,
std::string const& name);
void getValue(NJointCartesianWaypointControllerRuntimeConfig& cfg, void getValueFromMap(NJointCartesianWaypointControllerRuntimeConfig& cfg,
RemoteGui::ValueMap const& values, std::string const& name); RemoteGui::ValueMap const& values, std::string const& name);
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment