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;