91 else if (*in ==
"AEA")
96 else if (*in ==
"ROIE")
101 else if (*in ==
"HALL_ADC")
106 else if (*in ==
"MAIS")
111 else if (*in ==
"OPTICAL_QUAD")
116 else if (*in ==
"HALL_MOTOR_SENS")
154 *
out =
"OPTICAL_QUAD";
159 *
out =
"HALL_MOTOR_SENS";
173 memset(
out, 0,
sizeof(eOmc_PID_t));
174 out->kp = (float) (in->kp);
175 out->ki = (float) (in->ki);
176 out->kd = (float) (in->kd);
177 out->limitonintegral = (float)(in->max_int);
178 out->limitonoutput = (float)(in->max_output);
179 out->offset = (float) (in->offset);
180 out->scale = (int8_t) (in->scale);
181 out->kff = (float) (in->kff);
182 out->stiction_down_val = (float)(in->stiction_down_val);
183 out->stiction_up_val = (float)(in->stiction_up_val);
189 out->kp = (double) in->kp;
190 out->ki = (
double) in->ki;
191 out->kd = (double) in->kd;
192 out->max_int = (
double) in->limitonintegral;
193 out->max_output = (double) in->limitonoutput;
194 out->offset = (
double) in->offset;
195 out->scale = (double) in->scale;
196 out->setStictionValues(in->stiction_up_val, in->stiction_down_val);
197 out->setKff(in->kff);
208 embOut = eomc_controlmode_cmd_idle;
211 case VOCAB_CM_POSITION:
212 embOut = eomc_controlmode_cmd_position;
215 case VOCAB_CM_POSITION_DIRECT:
216 embOut = eomc_controlmode_cmd_direct;
219 case VOCAB_CM_VELOCITY:
220 embOut = eomc_controlmode_cmd_velocity;
224 embOut = eomc_controlmode_cmd_mixed;
227 case VOCAB_CM_TORQUE:
228 embOut = eomc_controlmode_cmd_torque;
231 case VOCAB_CM_IMPEDANCE_POS:
232 embOut = eomc_controlmode_cmd_impedance_pos;
235 case VOCAB_CM_IMPEDANCE_VEL:
236 embOut = eomc_controlmode_cmd_impedance_vel;
240 embOut = eomc_controlmode_cmd_openloop;
243 case VOCAB_CM_CURRENT:
244 embOut = eomc_controlmode_cmd_current;
247 case VOCAB_CM_FORCE_IDLE:
248 embOut = eomc_controlmode_cmd_force_idle;
263 case eomc_controlmode_idle:
264 vocabOut = VOCAB_CM_IDLE;
267 case eomc_controlmode_position:
268 vocabOut = VOCAB_CM_POSITION;
271 case eomc_controlmode_velocity:
272 vocabOut = VOCAB_CM_VELOCITY;
275 case eomc_controlmode_direct:
276 vocabOut = VOCAB_CM_POSITION_DIRECT;
279 case eomc_controlmode_mixed:
280 case eomc_controlmode_velocity_pos:
281 vocabOut = VOCAB_CM_MIXED;
284 case eomc_controlmode_torque:
285 vocabOut = VOCAB_CM_TORQUE;
288 case eomc_controlmode_calib:
289 vocabOut = VOCAB_CM_CALIBRATING;
292 case eomc_controlmode_impedance_pos:
293 vocabOut = VOCAB_CM_IMPEDANCE_POS;
296 case eomc_controlmode_impedance_vel:
297 vocabOut = VOCAB_CM_IMPEDANCE_VEL;
300 case eomc_controlmode_openloop:
301 vocabOut = VOCAB_CM_PWM;
304 case eomc_controlmode_current:
305 vocabOut = VOCAB_CM_CURRENT;
308 case eomc_controlmode_hwFault:
309 vocabOut = VOCAB_CM_HW_FAULT;
312 case eomc_controlmode_notConfigured:
313 vocabOut = VOCAB_CM_NOT_CONFIGURED;
316 case eomc_controlmode_configured:
317 vocabOut = VOCAB_CM_CONFIGURED;
321 printf(
"embObj to yarp unknown controlmode %d\n", embObjMode);
322 vocabOut = VOCAB_CM_UNKNOWN;
330 yError() <<
"controlModeStatusConvert_yarp2embObj" <<
" is not yet implemented for embObjMotionControl";
336 yError() <<
"embObjMotionControl::controlModeCommandConvert_embObj2yarp" <<
" is not yet implemented for embObjMotionControl";
369 embOut = eOmc_interactionmode_stiff;
372 case VOCAB_IM_COMPLIANT:
373 embOut = eOmc_interactionmode_compliant;
389 case eOmc_interactionmode_stiff:
390 vocabOut = VOCAB_IM_STIFF;
393 case eOmc_interactionmode_compliant:
394 vocabOut = VOCAB_IM_COMPLIANT;
399 yError() <<
"Received an unknown interactionMode from the EMS boards with value " << embObjMode;
bool EncoderType_eo2iCub(const uint8_t *in, string *out)
int controlModeStatusConvert_embObj2yarp(eOenum08_t embObjMode)
int controlModeCommandConvert_embObj2yarp(eOmc_controlmode_command_t embObjMode)
bool interactionModeStatusConvert_embObj2yarp(eOenum08_t embObjMode, int &vocabOut)
bool controlModeCommandConvert_yarp2embObj(int vocabMode, eOenum08_t &embOut)
void copyPid_eo2iCub(eOmc_PID_t *in, Pid *out)
bool controlModeStatusConvert_yarp2embObj(int vocabMode, eOmc_controlmode_t &embOut)
void copyPid_iCub2eo(const Pid *in, eOmc_PID_t *out)
bool interactionModeCommandConvert_yarp2embObj(int vocabMode, eOenum08_t &embOut)
bool EncoderType_iCub2eo(const string *in, uint8_t *out)
Copyright (C) 2008 RobotCub Consortium.