54 using namespace NEWMAT;
71 set_control(filename);
84 ifstream inconffile(filename.c_str(), std::ios::in);
87 cerr <<
"Control_Select::set_control: unable to read input config file." << endl;
90 conf.
select(CONTROLLER,
"type", ControllerName);
92 if (ControllerName == PROPORTIONAL_DERIVATIVE)
95 space_type = JOINT_SPACE;
97 else if(ControllerName == COMPUTED_TORQUE_METHOD)
100 space_type = JOINT_SPACE;
102 else if(ControllerName == RESOLVED_RATE_ACCELERATION)
105 space_type = CARTESIAN_SPACE;
107 else if(ControllerName == IMPEDANCE)
110 space_type = CARTESIAN_SPACE;
119 conf.
select(CONTROLLER,
"dof", dof);
125 DiagonalMatrix Kp(dof), Kd(dof);
126 for(
int i = 1; i <= dof; i++)
128 ostringstream Kp_ostr, Kd_ostr;
129 Kp_ostr <<
"Kp_" << i;
130 Kd_ostr <<
"Kd_" << i;
131 conf.
select(
"GAINS", Kp_ostr.str(), Kp(i));
132 conf.
select(
"GAINS", Kd_ostr.str(), Kd(i));
142 DiagonalMatrix Kp(dof), Kd(dof);
143 for(
int i = 1; i <= dof; i++)
145 ostringstream Kp_ostr, Kd_ostr;
146 Kp_ostr <<
"Kp_" << i;
147 Kd_ostr <<
"Kd_" << i;
148 conf.
select(
"GAINS", Kp_ostr.str(), Kp(i));
149 conf.
select(
"GAINS", Kd_ostr.str(), Kd(i));
159 Real Kvp, Kpp, Kvo, Kpo;
160 conf.
select(
"GAINS",
"Kvp", Kvp);
161 conf.
select(
"GAINS",
"Kpp", Kpp);
162 conf.
select(
"GAINS",
"Kvo", Kvo);
163 conf.
select(
"GAINS",
"Kpo", Kpo);