YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
ControlBoardServerImpl.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2025-2025 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: LGPL-2.1-or-later
4 */
5
7#include <yarp/os/LogStream.h>
9
12using namespace yarp::os;
13using namespace yarp::dev;
14using namespace std;
15
16namespace {
17YARP_LOG_COMPONENT(CB_RPC, "yarp.device.controlBoard_nws_yarp")
18}
19
20#if 1
21#define LOCKMUTEXSERVER std::lock_guard<std::mutex> lg(m_mutex);
22#else
23#define LOCKMUTEXSERVER
24#endif
25
26//--------------------------------------
27// IControlMode RPC methods
28
30{
33 if (!m_allInterfaces.iControlMode)
34 {
35 yCError(CB_RPC, "Invalid interface");
36 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
37 return ret;
38 }
39
40 ret.ret = m_allInterfaces.iControlMode->getAvailableControlModes(j, ret.avail);
41 if (!ret.ret)
42 {
43 yCError(CB_RPC, "getAvailableControlModes() failed");
44 }
45 return ret;
46}
47
49{
51 ReturnValue ret;
52 if (!m_allInterfaces.iControlMode) {
53 yCError(CB_RPC, "Invalid interface");
54 ret = ReturnValue::return_code::return_value_error_not_ready;
55 return ret;
56 }
57
58 ret = m_allInterfaces.iControlMode->setControlMode(j, mod);
59 if (!ret) {
60 yCError(CB_RPC, "setControlMode() failed");
61 }
62 return ret;
63}
64
65ReturnValue ControlBoardRPCd::setControlModeAllRPC(const std::vector<yarp::dev::SelectableControlModeEnum>& modes)
66{
68 ReturnValue ret;
69 if (!m_allInterfaces.iControlMode) {
70 yCError(CB_RPC, "Invalid interface");
71 ret = ReturnValue::return_code::return_value_error_not_ready;
72 return ret;
73 }
74
75 ret = m_allInterfaces.iControlMode->setControlModes(modes);
76
77 if (!ret) {
78 yCError(CB_RPC, "setControlModes() failed");
79 }
80 return ret;
81}
82
83ReturnValue ControlBoardRPCd::setControlModeGroupRPC(const std::vector<std::int32_t>& j, const std::vector<yarp::dev::SelectableControlModeEnum>& modes)
84{
86 ReturnValue ret;
87 if (!m_allInterfaces.iControlMode) {
88 yCError(CB_RPC, "Invalid interface");
89 ret = ReturnValue::return_code::return_value_error_not_ready;
90 return ret;
91 }
92
93 ret = m_allInterfaces.iControlMode->setControlModes(j, modes);
94
95 if (!ret) {
96 yCError(CB_RPC, "setControlModes() failed");
97 }
98 return ret;
99}
100
101//--------------------------------------
102// IJointBraked RPC methods
103
105{
108 if (!m_allInterfaces.iJointBrake)
109 {
110 yCError(CB_RPC, "Invalid interface");
111 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
112 return ret;
113 }
114
115 ret.ret = m_allInterfaces.iJointBrake->isJointBraked(j, ret.isBraked);
116 if (!ret.ret)
117 {
118 yCError(CB_RPC, "isJointBraked() failed");
119 }
120 return ret;
121}
122
123ReturnValue ControlBoardRPCd::setManualBrakeActiveRPC(const std::int32_t j, const bool active)
124{
126 ReturnValue ret;
127 if (!m_allInterfaces.iJointBrake) {
128 yCError(CB_RPC, "Invalid interface");
129 ret = ReturnValue::return_code::return_value_error_not_ready;
130 return ret;
131 }
132
133 ret = m_allInterfaces.iJointBrake->setManualBrakeActive(j, active);
134 if (!ret) {
135 yCError(CB_RPC, "setManualBrakeActive() failed");
136 }
137 return ret;
138}
139
140ReturnValue ControlBoardRPCd::setAutoBrakeEnabledRPC(const std::int32_t j, const bool enabled)
141{
143 ReturnValue ret;
144 if (!m_allInterfaces.iJointBrake) {
145 yCError(CB_RPC, "Invalid interface");
146 ret = ReturnValue::return_code::return_value_error_not_ready;
147 return ret;
148 }
149
150 ret = m_allInterfaces.iJointBrake->setAutoBrakeEnabled(j, enabled);
151 if (!ret) {
152 yCError(CB_RPC, "setAutoBrakeEnabled() failed");
153 }
154 return ret;
155}
156
158{
161 if (!m_allInterfaces.iJointBrake) {
162 yCError(CB_RPC, "Invalid interface");
163 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
164 return ret;
165 }
166
167 ret.ret = m_allInterfaces.iJointBrake->getAutoBrakeEnabled(j, ret.enabled);
168 if (!ret.ret) {
169 yCError(CB_RPC, "getAutoBrakeEnabled() failed");
170 }
171 return ret;
172}
173
174//--------------------------------------
175// IVelocityDirect RPC methods
176
178{
181 if (!m_allInterfaces.iVelocityDirect) {
182 yCError(CB_RPC, "Invalid IVelocityDirect interface");
184 return ret;
185 }
186 ret.ret = m_allInterfaces.iVelocityDirect->getRefVelocity(j, ret.vel);
187 if (!ret.ret) {
188 yCError(CB_RPC, "getRefVelocity() failed");
189 }
190 return ret;
191}
192
194{
197 if (!m_allInterfaces.iVelocityDirect) {
198 yCError(CB_RPC, "Invalid IVelocityDirect interface");
200 return ret;
201 }
202 ret.ret = m_allInterfaces.iVelocityDirect->getRefVelocity(ret.vel);
203 if (!ret.ret) {
204 yCError(CB_RPC, "getRefVelocity() failed");
205 }
206 return ret;
207}
208
210{
213 if (!m_allInterfaces.iVelocityDirect) {
214 yCError(CB_RPC, "Invalid IVelocityDirect interface");
216 return ret;
217 }
218 ret.vel.resize(jnts.size());
219 ret.ret = m_allInterfaces.iVelocityDirect->getRefVelocity(jnts, ret.vel);
220 if (!ret.ret) {
221 yCError(CB_RPC, "getRefVelocity() failed");
222 }
223 return ret;
224}
225
226ReturnValue ControlBoardRPCd::setRefVelocityOneRPC(const std::int32_t j, const double vel)
227{
229 ReturnValue ret;
230 if (!m_allInterfaces.iVelocityDirect) {
231 yCError(CB_RPC, "Invalid interface");
232 ret = ReturnValue::return_code::return_value_error_not_ready;
233 return ret;
234 }
235
236 ret = m_allInterfaces.iVelocityDirect->setRefVelocity(j, vel);
237 if (!ret) {
238 yCError(CB_RPC, "setRefVelocity() failed");
239 }
240 return ret;
241}
242
244{
246 ReturnValue ret;
247 if (!m_allInterfaces.iVelocityDirect) {
248 yCError(CB_RPC, "Invalid interface");
249 ret = ReturnValue::return_code::return_value_error_not_ready;
250 return ret;
251 }
252
253 ret = m_allInterfaces.iVelocityDirect->setRefVelocity(vel);
254 if (!ret) {
255 yCError(CB_RPC, "setRefVelocity() failed");
256 }
257 return ret;
258}
259
260ReturnValue ControlBoardRPCd::setRefVelocityGroupRPC(const std::vector<std::int32_t>& j, const std::vector<double>& vel)
261{
263 ReturnValue ret;
264 if (!m_allInterfaces.iVelocityDirect) {
265 yCError(CB_RPC, "Invalid interface");
266 ret = ReturnValue::return_code::return_value_error_not_ready;
267 return ret;
268 }
269
270 ret = m_allInterfaces.iVelocityDirect->setRefVelocity(j, vel);
271 if (!ret) {
272 yCError(CB_RPC, "setRefVelocity() failed");
273 }
274 return ret;
275}
276
278{
280 return_getAxes ret;
281 if (!m_allInterfaces.iAxisInfo) {
282 yCError(CB_RPC, "Invalid iAxisInfo interface");
284 return ret;
285 }
286 size_t axes=0;
287 ret.ret = m_allInterfaces.iAxisInfo->getAxes(axes);
288 if (!ret.ret) {
289 yCError(CB_RPC, "getAxes() failed");
290 }
291 ret.axes = axes;
292 return ret;
293}
294
295//--------------------------------------
296// IPidControl RPC methods
297
299{
301 ReturnValue ret;
302 if (!m_allInterfaces.iPidControl) {
303 yCError(CB_RPC, "Invalid interface");
304 ret = ReturnValue::return_code::return_value_error_not_ready;
305 return ret;
306 }
307
308 ret = m_allInterfaces.iPidControl->setPid(pidtype, j, pid);
309 if (!ret) {
310 yCError(CB_RPC, "Unable to setPidRPC");
311 }
312 return ret;
313}
314
315yarp::dev::ReturnValue ControlBoardRPCd::setPidsRPC(const yarp::dev::PidControlTypeEnum pidtype, const std::vector<yarp::dev::Pid>& pids)
316{
318 ReturnValue ret;
319 if (!m_allInterfaces.iPidControl) {
320 yCError(CB_RPC, "Invalid interface");
321 ret = ReturnValue::return_code::return_value_error_not_ready;
322 return ret;
323 }
324
325 ret = m_allInterfaces.iPidControl->setPids(pidtype, pids.data());
326 if (!ret) {
327 yCError(CB_RPC, "Unable to setPidsRPC");
328 }
329 return ret;
330}
331
333{
336 if (!m_allInterfaces.iPidControl)
337 {
338 yCError(CB_RPC, "Invalid interface");
339 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
340 return ret;
341 }
342
343 ret.ret = m_allInterfaces.iPidControl->getAvailablePids(j, ret.avail);
344 if (!ret.ret)
345 {
346 yCError(CB_RPC, "Unable to getAvailablePidsRPC");
347 }
348 return ret;
349}
350
352{
354 return_getPid ret;
355 if (!m_allInterfaces.iPidControl)
356 {
357 yCError(CB_RPC, "Invalid interface");
358 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
359 return ret;
360 }
361
362 ret.ret = m_allInterfaces.iPidControl->getPid(pidtype, j, &ret.pid);
363 if (!ret.ret)
364 {
365 yCError(CB_RPC, "Unable to getPidRPC");
366 }
367 return ret;
368}
369
371{
373 return_getPids ret;
374 if (!m_allInterfaces.iPidControl)
375 {
376 yCError(CB_RPC, "Invalid interface");
377 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
378 return ret;
379 }
380
381 ret.pids.resize(m_njoints);
382 ret.ret = m_allInterfaces.iPidControl->getPids(pidtype, ret.pids.data());
383 if (!ret.ret)
384 {
385 yCError(CB_RPC, "Unable to getPidsRPC");
386 }
387 return ret;
388}
389
391{
394 if (!m_allInterfaces.iPidControl)
395 {
396 yCError(CB_RPC, "Invalid interface");
397 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
398 return ret;
399 }
400
401 ret.ret = m_allInterfaces.iPidControl->getPidExtraInfo(pidtype, j, ret.info);
402 if (!ret.ret)
403 {
404 yCError(CB_RPC, "Unable to getPidExtraInfo");
405 }
406 return ret;
407}
408
410{
413 if (!m_allInterfaces.iPidControl)
414 {
415 yCError(CB_RPC, "Invalid interface");
416 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
417 return ret;
418 }
419
420 ret.info.resize(m_njoints);
421 ret.ret = m_allInterfaces.iPidControl->getPidExtraInfos(pidtype, ret.info);
422 if (!ret.ret)
423 {
424 yCError(CB_RPC, "Unable to getPidExtraInfos");
425 }
426 return ret;
427}
428
430{
433 if (!m_allInterfaces.iPidControl)
434 {
435 yCError(CB_RPC, "Invalid interface");
436 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
437 return ret;
438 }
439
440 ret.ret = m_allInterfaces.iPidControl->getPidOffset(pidtype, j, ret.offset);
441 if (!ret.ret)
442 {
443 yCError(CB_RPC, "Unable to getPidOffset");
444 }
445 return ret;
446}
447
449{
452 if (!m_allInterfaces.iPidControl)
453 {
454 yCError(CB_RPC, "Invalid interface");
455 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
456 return ret;
457 }
458
459 ret.ret = m_allInterfaces.iPidControl->getPidFeedforward(pidtype, j, ret.feedforward);
460 if (!ret.ret)
461 {
462 yCError(CB_RPC, "Unable to getPidFeedforward");
463 }
464 return ret;
465}
466
468{
470 ReturnValue ret;
471 if (!m_allInterfaces.iPidControl) {
472 yCError(CB_RPC, "Invalid interface");
473 ret = ReturnValue::return_code::return_value_error_not_ready;
474 return ret;
475 }
476
477 ret = m_allInterfaces.iPidControl->enablePid(pidtype, j);
478 if (!ret) {
479 yCError(CB_RPC, "Unable to enablePid");
480 }
481 return ret;
482}
483
485{
487 ReturnValue ret;
488 if (!m_allInterfaces.iPidControl) {
489 yCError(CB_RPC, "Invalid interface");
490 ret = ReturnValue::return_code::return_value_error_not_ready;
491 return ret;
492 }
493
494 ret = m_allInterfaces.iPidControl->disablePid(pidtype, j);
495 if (!ret) {
496 yCError(CB_RPC, "Unable to disablePid");
497 }
498 return ret;
499}
500
502{
504 ReturnValue ret;
505 if (!m_allInterfaces.iPidControl) {
506 yCError(CB_RPC, "Invalid interface");
507 ret = ReturnValue::return_code::return_value_error_not_ready;
508 return ret;
509 }
510
511 ret = m_allInterfaces.iPidControl->resetPid(pidtype, j);
512 if (!ret) {
513 yCError(CB_RPC, "Unable to resetPid");
514 }
515 return ret;
516}
517
519{
522 if (!m_allInterfaces.iPidControl)
523 {
524 yCError(CB_RPC, "Invalid interface");
525 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
526 return ret;
527 }
528
529 ret.ret = m_allInterfaces.iPidControl->isPidEnabled(pidtype, j, ret.isEnabled);
530 if (!ret.ret)
531 {
532 yCError(CB_RPC, "Unable to isPidEnabled");
533 }
534 return ret;
535}
536
537ReturnValue ControlBoardRPCd::setPidErrorLimitRPC(const yarp::dev::PidControlTypeEnum pidtype, const std::int16_t j, const double lim)
538{
540 ReturnValue ret;
541 if (!m_allInterfaces.iPidControl) {
542 yCError(CB_RPC, "Invalid interface");
543 ret = ReturnValue::return_code::return_value_error_not_ready;
544 return ret;
545 }
546
547 ret = m_allInterfaces.iPidControl->setPidErrorLimit(pidtype, j, lim);
548 if (!ret) {
549 yCError(CB_RPC, "Unable to setPidErrorLimitRPC");
550 }
551 return ret;
552}
553
555{
557 ReturnValue ret;
558 if (!m_allInterfaces.iPidControl) {
559 yCError(CB_RPC, "Invalid interface");
560 ret = ReturnValue::return_code::return_value_error_not_ready;
561 return ret;
562 }
563
564 ret = m_allInterfaces.iPidControl->setPidErrorLimits(pidtype, limits.data());
565 if (!ret) {
566 yCError(CB_RPC, "Unable to setPidErrorLimitsRPC");
567 }
568 return ret;
569}
570
572{
574 ReturnValue ret;
575 if (!m_allInterfaces.iPidControl) {
576 yCError(CB_RPC, "Invalid interface");
577 ret = ReturnValue::return_code::return_value_error_not_ready;
578 return ret;
579 }
580
581 ret = m_allInterfaces.iPidControl->setPidOffset(pidtype, j, value);
582 if (!ret) {
583 yCError(CB_RPC, "Unable to setPidOffset");
584 }
585 return ret;
586}
587
589{
591 ReturnValue ret;
592 if (!m_allInterfaces.iPidControl) {
593 yCError(CB_RPC, "Invalid interface");
594 ret = ReturnValue::return_code::return_value_error_not_ready;
595 return ret;
596 }
597
598 ret = m_allInterfaces.iPidControl->setPidFeedforward(pidtype, j, value);
599 if (!ret) {
600 yCError(CB_RPC, "Unable to setPidFeedforward");
601 }
602 return ret;
603}
604
605ReturnValue ControlBoardRPCd::setPidReferenceRPC(const yarp::dev::PidControlTypeEnum pidtype, const std::int16_t j, const double ref)
606{
608 ReturnValue ret;
609 if (!m_allInterfaces.iPidControl) {
610 yCError(CB_RPC, "Invalid interface");
611 ret = ReturnValue::return_code::return_value_error_not_ready;
612 return ret;
613 }
614
615 ret = m_allInterfaces.iPidControl->setPidReference(pidtype, j, ref);
616 if (!ret) {
617 yCError(CB_RPC, "Unable to setPidReferenceRPC");
618 }
619 return ret;
620}
621
623{
625 ReturnValue ret;
626 if (!m_allInterfaces.iPidControl) {
627 yCError(CB_RPC, "Invalid interface");
628 ret = ReturnValue::return_code::return_value_error_not_ready;
629 return ret;
630 }
631
632 ret = m_allInterfaces.iPidControl->setPidReferences(pidtype, refs.data());
633 if (!ret) {
634 yCError(CB_RPC, "Unable to setPidReferences");
635 }
636 return ret;
637}
638
640{
643 if (!m_allInterfaces.iPidControl)
644 {
645 yCError(CB_RPC, "Invalid interface");
646 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
647 return ret;
648 }
649
650 ret.ret = m_allInterfaces.iPidControl->getPidError(pidtype, j, &ret.err);
651 if (!ret.ret)
652 {
653 yCError(CB_RPC, "Unable to getPidErrorRPC");
654 }
655 return ret;
656}
657
659{
662 if (!m_allInterfaces.iPidControl)
663 {
664 yCError(CB_RPC, "Invalid interface");
665 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
666 return ret;
667 }
668
669 ret.errs.resize(m_njoints);
670 ret.ret = m_allInterfaces.iPidControl->getPidErrors(pidtype, ret.errs.data());
671 if (!ret.ret)
672 {
673 yCError(CB_RPC, "Unable to getPidErrorsRPC");
674 }
675 return ret;
676}
677
679{
682 if (!m_allInterfaces.iPidControl)
683 {
684 yCError(CB_RPC, "Invalid interface");
685 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
686 return ret;
687 }
688
689 ret.ret = m_allInterfaces.iPidControl->getPidReference(pidtype, j, &ret.ref);
690 if (!ret.ret)
691 {
692 yCError(CB_RPC, "Unable to getPidReferenceRPC");
693 }
694 return ret;
695}
696
698{
701 if (!m_allInterfaces.iPidControl)
702 {
703 yCError(CB_RPC, "Invalid interface");
704 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
705 return ret;
706 }
707
708 ret.refs.resize(m_njoints);
709 ret.ret = m_allInterfaces.iPidControl->getPidReferences(pidtype, ret.refs.data());
710 if (!ret.ret)
711 {
712 yCError(CB_RPC, "Unable to getPidReferencesRPC");
713 }
714 return ret;
715}
716
718{
721 if (!m_allInterfaces.iPidControl)
722 {
723 yCError(CB_RPC, "Invalid interface");
724 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
725 return ret;
726 }
727
728 ret.ret = m_allInterfaces.iPidControl->getPidErrorLimit(pidtype, j, &ret.lim);
729 if (!ret.ret)
730 {
731 yCError(CB_RPC, "Unable to getPidErrorLimitRPC");
732 }
733 return ret;
734}
735
737{
740 if (!m_allInterfaces.iPidControl)
741 {
742 yCError(CB_RPC, "Invalid interface");
743 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
744 return ret;
745 }
746
747 ret.lims.resize(m_njoints);
748 ret.ret = m_allInterfaces.iPidControl->getPidErrorLimits(pidtype, ret.lims.data());
749 if (!ret.ret)
750 {
751 yCError(CB_RPC, "Unable to getPidErrorLimitsRPC");
752 }
753 return ret;
754}
755
757{
760 if (!m_allInterfaces.iPidControl)
761 {
762 yCError(CB_RPC, "Invalid interface");
763 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
764 return ret;
765 }
766
767 ret.ret = m_allInterfaces.iPidControl->getPidOutput(pidtype, j, &ret.out);
768 if (!ret.ret)
769 {
770 yCError(CB_RPC, "Unable to getPidOutputRPC");
771 }
772 return ret;
773}
774
776{
779 if (!m_allInterfaces.iPidControl)
780 {
781 yCError(CB_RPC, "Invalid interface");
782 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
783 return ret;
784 }
785
786 ret.outs.resize(m_njoints);
787 ret.ret = m_allInterfaces.iPidControl->getPidOutputs(pidtype, ret.outs.data());
788 if (!ret.ret)
789 {
790 yCError(CB_RPC, "Unable to getPidOutputsRPC");
791 }
792 return ret;
793}
794
795
796//-------------------
797
798
800{
803 if (!m_allInterfaces.iControlLimits)
804 {
805 yCError(CB_RPC, "Invalid interface");
806 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
807 return ret;
808 }
809
810 ret.ret = m_allInterfaces.iControlLimits->getPosLimits(j, &ret.min, &ret.max);
811 if (!ret.ret)
812 {
813 yCError(CB_RPC, "Unable to getPosLimitsRPC");
814 }
815 return ret;
816}
817
819{
822 if (!m_allInterfaces.iControlLimits)
823 {
824 yCError(CB_RPC, "Invalid interface");
825 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
826 return ret;
827 }
828
829 ret.ret = m_allInterfaces.iControlLimits->getVelLimits(j, &ret.min, &ret.max);
830 if (!ret.ret)
831 {
832 yCError(CB_RPC, "Unable to getVelLimitsRPC");
833 }
834 return ret;
835}
836
837ReturnValue ControlBoardRPCd::setPosLimitsRPC(const std::int16_t j, const double min, const double max)
838{
840 ReturnValue ret;
841 if (!m_allInterfaces.iControlLimits) {
842 yCError(CB_RPC, "Invalid interface");
843 ret = ReturnValue::return_code::return_value_error_not_ready;
844 return ret;
845 }
846
847 ret = m_allInterfaces.iControlLimits->setPosLimits(j, min,max);
848 if (!ret) {
849 yCError(CB_RPC, "Unable to setPosLimits");
850 }
851 return ret;
852}
853
854ReturnValue ControlBoardRPCd::setVelLimitsRPC(const std::int16_t j, const double min, const double max)
855{
857 ReturnValue ret;
858 if (!m_allInterfaces.iControlLimits) {
859 yCError(CB_RPC, "Invalid interface");
860 ret = ReturnValue::return_code::return_value_error_not_ready;
861 return ret;
862 }
863
864 ret = m_allInterfaces.iControlLimits->setVelLimits(j, min,max);
865 if (!ret) {
866 yCError(CB_RPC, "Unable to setVelLimits");
867 }
868 return ret;
869}
870
871//------- IImpedanceControl
872
874{
877 if (!m_allInterfaces.iImpedanceControl)
878 {
879 yCError(CB_RPC, "Invalid interface");
880 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
881 return ret;
882 }
883
884 ret.ret = m_allInterfaces.iImpedanceControl->getImpedance(j, &ret.stiffness, &ret.damping);
885 if (!ret.ret)
886 {
887 yCError(CB_RPC, "Unable to getImpedance");
888 }
889 return ret;
890}
891
893{
896 if (!m_allInterfaces.iImpedanceControl)
897 {
898 yCError(CB_RPC, "Invalid interface");
899 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
900 return ret;
901 }
902
903 ret.ret = m_allInterfaces.iImpedanceControl->getImpedanceOffset(j, &ret.offset);
904 if (!ret.ret)
905 {
906 yCError(CB_RPC, "Unable to getImpedanceOffset");
907 }
908 return ret;
909}
910
912{
915 if (!m_allInterfaces.iImpedanceControl)
916 {
917 yCError(CB_RPC, "Invalid interface");
918 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
919 return ret;
920 }
921
922 ret.ret = m_allInterfaces.iImpedanceControl->getCurrentImpedanceLimit(j, &ret.min_stiffness, &ret.max_stiffness, &ret.min_damping, &ret.max_damping);
923 if (!ret.ret)
924 {
925 yCError(CB_RPC, "Unable to getCurrentImpedanceLimit");
926 }
927 return ret;
928}
929
930ReturnValue ControlBoardRPCd::setImpedanceRPC(const std::int32_t j, const double stiffness, const double damping)
931{
933 ReturnValue ret;
934 if (!m_allInterfaces.iImpedanceControl) {
935 yCError(CB_RPC, "Invalid interface");
936 ret = ReturnValue::return_code::return_value_error_not_ready;
937 return ret;
938 }
939
940 ret = m_allInterfaces.iImpedanceControl->setImpedance(j,stiffness, damping);
941 if (!ret) {
942 yCError(CB_RPC, "Unable to setImpedance");
943 }
944 return ret;
945}
946
947ReturnValue ControlBoardRPCd::setImpedanceOffsetRPC(const std::int32_t j, const double offset)
948{
950 ReturnValue ret;
951 if (!m_allInterfaces.iImpedanceControl) {
952 yCError(CB_RPC, "Invalid interface");
953 ret = ReturnValue::return_code::return_value_error_not_ready;
954 return ret;
955 }
956
957 ret = m_allInterfaces.iImpedanceControl->setImpedanceOffset(j, offset);
958 if (!ret) {
959 yCError(CB_RPC, "Unable to setImpedanceOffset");
960 }
961 return ret;
962}
963
964//------- iAmplifierControl
965
967{
970 if (!m_allInterfaces.iAmplifierControl)
971 {
972 yCError(CB_RPC, "Invalid interface");
973 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
974 return ret;
975 }
976
977 ret.val.resize(m_njoints);
978 ret.ret = m_allInterfaces.iAmplifierControl->getAmpStatus(ret.val.data());
979 if (!ret.ret)
980 {
981 yCError(CB_RPC, "Unable to getAmpStatus");
982 }
983 return ret;
984}
985
987{
990 if (!m_allInterfaces.iAmplifierControl)
991 {
992 yCError(CB_RPC, "Invalid interface");
993 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
994 return ret;
995 }
996
997 ret.ret = m_allInterfaces.iAmplifierControl->getAmpStatus(j, &ret.val);
998 if (!ret.ret)
999 {
1000 yCError(CB_RPC, "Unable to getAmpStatus");
1001 }
1002 return ret;
1003}
1004
1006{
1008 ReturnValue ret;
1009 if (!m_allInterfaces.iAmplifierControl) {
1010 yCError(CB_RPC, "Invalid interface");
1011 ret = ReturnValue::return_code::return_value_error_not_ready;
1012 return ret;
1013 }
1014
1015 ret = m_allInterfaces.iAmplifierControl->enableAmp(m);
1016 if (!ret) {
1017 yCError(CB_RPC, "Unable to enableAmp");
1018 }
1019 return ret;
1020}
1021
1023{
1025 ReturnValue ret;
1026 if (!m_allInterfaces.iAmplifierControl) {
1027 yCError(CB_RPC, "Invalid interface");
1028 ret = ReturnValue::return_code::return_value_error_not_ready;
1029 return ret;
1030 }
1031
1032 ret = m_allInterfaces.iAmplifierControl->disableAmp(m);
1033 if (!ret) {
1034 yCError(CB_RPC, "Unable to disableAmp");
1035 }
1036 return ret;
1037}
1038
1040{
1042 return_getPWM ret;
1043 if (!m_allInterfaces.iAmplifierControl)
1044 {
1045 yCError(CB_RPC, "Invalid interface");
1046 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
1047 return ret;
1048 }
1049
1050 ret.ret = m_allInterfaces.iAmplifierControl->getPWM(j, &ret.val);
1051 if (!ret.ret)
1052 {
1053 yCError(CB_RPC, "Unable to getPWM");
1054 }
1055 return ret;
1056}
1057
1059{
1062 if (!m_allInterfaces.iAmplifierControl)
1063 {
1064 yCError(CB_RPC, "Invalid interface");
1065 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
1066 return ret;
1067 }
1068
1069 ret.ret = m_allInterfaces.iAmplifierControl->getPWMLimit(m, &ret.val);
1070 if (!ret.ret)
1071 {
1072 yCError(CB_RPC, "Unable to getPWMLimit");
1073 }
1074 return ret;
1075}
1076
1077ReturnValue ControlBoardRPCd::setPWMLimitRPC(const std::int32_t m, const double val)
1078{
1080 ReturnValue ret;
1081 if (!m_allInterfaces.iAmplifierControl) {
1082 yCError(CB_RPC, "Invalid interface");
1083 ret = ReturnValue::return_code::return_value_error_not_ready;
1084 return ret;
1085 }
1086
1087 ret = m_allInterfaces.iAmplifierControl->setPWMLimit(m,val);
1088 if (!ret) {
1089 yCError(CB_RPC, "Unable to setPWMLimit");
1090 }
1091 return ret;
1092}
1093
1095{
1098 if (!m_allInterfaces.iAmplifierControl)
1099 {
1100 yCError(CB_RPC, "Invalid interface");
1101 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
1102 return ret;
1103 }
1104
1105 ret.ret = m_allInterfaces.iAmplifierControl->getPowerSupplyVoltage(m, &ret.val);
1106 if (!ret.ret)
1107 {
1108 yCError(CB_RPC, "Unable to getPowerSupplyVoltage");
1109 }
1110 return ret;
1111}
1112
1113ReturnValue ControlBoardRPCd::setPeakCurrentRPC(const std::int32_t m, const double val)
1114{
1116 ReturnValue ret;
1117 if (!m_allInterfaces.iAmplifierControl) {
1118 yCError(CB_RPC, "Invalid interface");
1119 ret = ReturnValue::return_code::return_value_error_not_ready;
1120 return ret;
1121 }
1122
1123 ret = m_allInterfaces.iAmplifierControl->setPeakCurrent(m,val);
1124 if (!ret) {
1125 yCError(CB_RPC, "Unable to setPeakCurrent");
1126 }
1127 return ret;
1128}
1129
1131{
1134 if (!m_allInterfaces.iAmplifierControl)
1135 {
1136 yCError(CB_RPC, "Invalid interface");
1137 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
1138 return ret;
1139 }
1140
1141 ret.ret = m_allInterfaces.iAmplifierControl->getPeakCurrent(m, &ret.val);
1142 if (!ret.ret)
1143 {
1144 yCError(CB_RPC, "Unable to getPeakCurrent");
1145 }
1146 return ret;
1147}
1148
1149ReturnValue ControlBoardRPCd::setNominalCurrentRPC(const std::int32_t m, const double val)
1150{
1152 ReturnValue ret;
1153 if (!m_allInterfaces.iAmplifierControl) {
1154 yCError(CB_RPC, "Invalid interface");
1155 ret = ReturnValue::return_code::return_value_error_not_ready;
1156 return ret;
1157 }
1158
1159 ret = m_allInterfaces.iAmplifierControl->setNominalCurrent(m,val);
1160 if (!ret) {
1161 yCError(CB_RPC, "Unable to setNominalCurrent");
1162 }
1163 return ret;
1164}
1165
1167{
1170 if (!m_allInterfaces.iAmplifierControl)
1171 {
1172 yCError(CB_RPC, "Invalid interface");
1173 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
1174 return ret;
1175 }
1176
1177 ret.ret = m_allInterfaces.iAmplifierControl->getNominalCurrent(m, &ret.val);
1178 if (!ret.ret)
1179 {
1180 yCError(CB_RPC, "Unable to getNominalCurrent");
1181 }
1182 return ret;
1183}
1184
1185ReturnValue ControlBoardRPCd::setMaxCurrentRPC(const std::int32_t m, const double val)
1186{
1188 ReturnValue ret;
1189 if (!m_allInterfaces.iAmplifierControl) {
1190 yCError(CB_RPC, "Invalid interface");
1191 ret = ReturnValue::return_code::return_value_error_not_ready;
1192 return ret;
1193 }
1194
1195 ret = m_allInterfaces.iAmplifierControl->setMaxCurrent(m,val);
1196 if (!ret) {
1197 yCError(CB_RPC, "Unable to setMaxCurrent");
1198 }
1199 return ret;
1200}
1201
1203{
1206 if (!m_allInterfaces.iAmplifierControl)
1207 {
1208 yCError(CB_RPC, "Invalid interface");
1209 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
1210 return ret;
1211 }
1212
1213 ret.ret = m_allInterfaces.iAmplifierControl->getMaxCurrent(m, &ret.val);
1214 if (!ret.ret)
1215 {
1216 yCError(CB_RPC, "Unable to getMaxCurrent");
1217 }
1218 return ret;
1219}
1220
1221//------- iCalibration
1222
1224{
1226 ReturnValue ret;
1227 if (!m_allInterfaces.iRemoteCalibrator) {
1228 yCError(CB_RPC, "Invalid interface");
1229 ret = ReturnValue::return_code::return_value_error_not_ready;
1230 return ret;
1231 }
1232
1233 ret = m_allInterfaces.iRemoteCalibrator->calibrateSingleJoint(j);
1234 if (!ret) {
1235 yCError(CB_RPC, "Unable to calibrateSingleJoint");
1236 }
1237 return ret;
1238}
1239
1241{
1243 ReturnValue ret;
1244 if (!m_allInterfaces.iRemoteCalibrator) {
1245 yCError(CB_RPC, "Invalid interface");
1246 ret = ReturnValue::return_code::return_value_error_not_ready;
1247 return ret;
1248 }
1249
1250 ret = m_allInterfaces.iRemoteCalibrator->calibrateWholePart();
1251 if (!ret) {
1252 yCError(CB_RPC, "Unable to calibrateWholePart");
1253 }
1254 return ret;
1255}
1256
1258{
1260 ReturnValue ret;
1261 if (!m_allInterfaces.iRemoteCalibrator) {
1262 yCError(CB_RPC, "Invalid interface");
1263 ret = ReturnValue::return_code::return_value_error_not_ready;
1264 return ret;
1265 }
1266
1267 ret = m_allInterfaces.iRemoteCalibrator->homingSingleJoint(j);
1268 if (!ret) {
1269 yCError(CB_RPC, "Unable to homingSingleJoint");
1270 }
1271 return ret;
1272}
1273
1275{
1277 ReturnValue ret;
1278 if (!m_allInterfaces.iRemoteCalibrator) {
1279 yCError(CB_RPC, "Invalid interface");
1280 ret = ReturnValue::return_code::return_value_error_not_ready;
1281 return ret;
1282 }
1283
1284 ret = m_allInterfaces.iRemoteCalibrator->homingWholePart();
1285 if (!ret) {
1286 yCError(CB_RPC, "Unable to homingWholePartRPC");
1287 }
1288 return ret;
1289}
1290
1291ReturnValue ControlBoardRPCd::parkSingleJointRPC(const std::int32_t j, const bool wait)
1292{
1294 ReturnValue ret;
1295 if (!m_allInterfaces.iRemoteCalibrator) {
1296 yCError(CB_RPC, "Invalid interface");
1297 ret = ReturnValue::return_code::return_value_error_not_ready;
1298 return ret;
1299 }
1300
1301 ret = m_allInterfaces.iRemoteCalibrator->parkSingleJoint(j, wait);
1302 if (!ret) {
1303 yCError(CB_RPC, "Unable to parkSingleJoint");
1304 }
1305 return ret;
1306}
1307
1309{
1311 ReturnValue ret;
1312 if (!m_allInterfaces.iRemoteCalibrator) {
1313 yCError(CB_RPC, "Invalid interface");
1314 ret = ReturnValue::return_code::return_value_error_not_ready;
1315 return ret;
1316 }
1317
1318 ret = m_allInterfaces.iRemoteCalibrator->parkWholePart();
1319 if (!ret) {
1320 yCError(CB_RPC, "Unable to parkWholePart");
1321 }
1322 return ret;
1323}
1324
1326{
1328 ReturnValue ret;
1329 if (!m_allInterfaces.iRemoteCalibrator) {
1330 yCError(CB_RPC, "Invalid interface");
1331 ret = ReturnValue::return_code::return_value_error_not_ready;
1332 return ret;
1333 }
1334
1335 ret = m_allInterfaces.iRemoteCalibrator->quitCalibrate();
1336 if (!ret) {
1337 yCError(CB_RPC, "Unable to quitCalibrate");
1338 }
1339 return ret;
1340}
1341
1343{
1345 ReturnValue ret;
1346 if (!m_allInterfaces.iRemoteCalibrator) {
1347 yCError(CB_RPC, "Invalid interface");
1348 ret = ReturnValue::return_code::return_value_error_not_ready;
1349 return ret;
1350 }
1351
1352 ret = m_allInterfaces.iRemoteCalibrator->quitPark();
1353 if (!ret) {
1354 yCError(CB_RPC, "Unable to quitPark");
1355 }
1356 return ret;
1357}
1358
1360{
1363 if (!m_allInterfaces.iRemoteCalibrator)
1364 {
1365 yCError(CB_RPC, "Invalid interface");
1366 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
1367 return ret;
1368 }
1369
1370 ret.ret = m_allInterfaces.iRemoteCalibrator->isCalibratorDevicePresent(&ret.isPresent);
1371 if (!ret.ret)
1372 {
1373 yCError(CB_RPC, "Unable to isCalibratorDevicePresent");
1374 }
1375 return ret;
1376}
1377
1378//IInteractionMode
1380{
1383 if (!m_allInterfaces.iInteractionMode)
1384 {
1385 yCError(CB_RPC, "Invalid interface");
1386 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
1387 return ret;
1388 }
1389
1390 ret.ret = m_allInterfaces.iInteractionMode->getInteractionMode(axis, ret.mode);
1391 if (!ret.ret)
1392 {
1393 yCError(CB_RPC, "Unable to getInteractionMode");
1394 }
1395 return ret;
1396}
1397
1399{
1402 if (!m_allInterfaces.iInteractionMode)
1403 {
1404 yCError(CB_RPC, "Invalid interface");
1405 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
1406 return ret;
1407 }
1408
1409 ret.modes.resize(joints.size());
1410 ret.ret = m_allInterfaces.iInteractionMode->getInteractionModes(joints, ret.modes);
1411 if (!ret.ret)
1412 {
1413 yCError(CB_RPC, "Unable to getInteractionModes");
1414 }
1415 return ret;
1416}
1417
1419{
1422 if (!m_allInterfaces.iInteractionMode)
1423 {
1424 yCError(CB_RPC, "Invalid interface");
1425 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
1426 return ret;
1427 }
1428
1429 ret.modes.resize(m_njoints);
1430 ret.ret = m_allInterfaces.iInteractionMode->getInteractionModes(ret.modes);
1431 if (!ret.ret)
1432 {
1433 yCError(CB_RPC, "Unable to getInteractionModes");
1434 }
1435 return ret;
1436}
1437
1439{
1441 ReturnValue ret;
1442 if (!m_allInterfaces.iInteractionMode) {
1443 yCError(CB_RPC, "Invalid interface");
1444 ret = ReturnValue::return_code::return_value_error_not_ready;
1445 return ret;
1446 }
1447
1448 ret = m_allInterfaces.iInteractionMode->setInteractionMode(axis, mode);
1449 if (!ret) {
1450 yCError(CB_RPC, "Unable to setInteractionModeOne");
1451 }
1452 return ret;
1453}
1454
1455yarp::dev::ReturnValue ControlBoardRPCd::setInteractionModesGroupRPC(const std::vector<std::int32_t>& joints, const std::vector<yarp::dev::InteractionModeEnum>& modes)
1456{
1458 ReturnValue ret;
1459 if (!m_allInterfaces.iInteractionMode) {
1460 yCError(CB_RPC, "Invalid interface");
1461 ret = ReturnValue::return_code::return_value_error_not_ready;
1462 return ret;
1463 }
1464
1465 ret = m_allInterfaces.iInteractionMode->setInteractionModes(joints, modes);
1466 if (!ret) {
1467 yCError(CB_RPC, "Unable to setInteractionModes");
1468 }
1469 return ret;
1470}
1471
1472yarp::dev::ReturnValue ControlBoardRPCd::setInteractionModesAllRPC(const std::vector<yarp::dev::InteractionModeEnum>& modes)
1473{
1475 ReturnValue ret;
1476 if (!m_allInterfaces.iInteractionMode) {
1477 yCError(CB_RPC, "Invalid interface");
1478 ret = ReturnValue::return_code::return_value_error_not_ready;
1479 return ret;
1480 }
1481
1482 ret = m_allInterfaces.iInteractionMode->setInteractionModes(modes);
1483 if (!ret) {
1484 yCError(CB_RPC, "Unable to setInteractionModes");
1485 }
1486 return ret;
1487}
1488
1489//IAxis
1490
1492{
1495 if (!m_allInterfaces.iAxisInfo)
1496 {
1497 yCError(CB_RPC, "Invalid interface");
1498 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
1499 return ret;
1500 }
1501
1502 ret.ret = m_allInterfaces.iAxisInfo->getAxisName(j, ret.name);
1503 if (!ret.ret)
1504 {
1505 yCError(CB_RPC, "Unable to getAxisName");
1506 }
1507 return ret;
1508}
1509
1511{
1514 if (!m_allInterfaces.iAxisInfo)
1515 {
1516 yCError(CB_RPC, "Invalid interface");
1517 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
1518 return ret;
1519 }
1520
1521 ret.ret = m_allInterfaces.iAxisInfo->getJointType(j, ret.joint);
1522 if (!ret.ret)
1523 {
1524 yCError(CB_RPC, "Unable to getJointType");
1525 }
1526 return ret;
1527}
1528
1529// iControlCalibration
1530
1532{
1534 ReturnValue ret;
1535 if (!m_allInterfaces.iControlCalibration) {
1536 yCError(CB_RPC, "Invalid interface");
1537 ret = ReturnValue::return_code::return_value_error_not_ready;
1538 return ret;
1539 }
1540
1541 ret = m_allInterfaces.iControlCalibration->calibrateRobot();
1542 if (!ret) {
1543 yCError(CB_RPC, "Unable to calibrateRobot");
1544 }
1545 return ret;
1546}
1547
1549{
1551 ReturnValue ret;
1552 if (!m_allInterfaces.iControlCalibration) {
1553 yCError(CB_RPC, "Invalid interface");
1554 ret = ReturnValue::return_code::return_value_error_not_ready;
1555 return ret;
1556 }
1557
1558 ret = m_allInterfaces.iControlCalibration->abortCalibration();
1559 if (!ret) {
1560 yCError(CB_RPC, "Unable to abortCalibration");
1561 }
1562 return ret;
1563}
1564
1566{
1568 ReturnValue ret;
1569 if (!m_allInterfaces.iControlCalibration) {
1570 yCError(CB_RPC, "Invalid interface");
1571 ret = ReturnValue::return_code::return_value_error_not_ready;
1572 return ret;
1573 }
1574
1575 ret = m_allInterfaces.iControlCalibration->abortPark();
1576 if (!ret) {
1577 yCError(CB_RPC, "Unable to abortPark");
1578 }
1579 return ret;
1580}
1581
1583{
1585 ReturnValue ret;
1586 if (!m_allInterfaces.iControlCalibration) {
1587 yCError(CB_RPC, "Invalid interface");
1588 ret = ReturnValue::return_code::return_value_error_not_ready;
1589 return ret;
1590 }
1591
1592 ret = m_allInterfaces.iControlCalibration->park(wait);
1593 if (!ret) {
1594 yCError(CB_RPC, "Unable to park");
1595 }
1596 return ret;
1597}
1598
1599ReturnValue ControlBoardRPCd::calibrateAxisWithParamsRPC(const std::int32_t j, const std::int32_t ui, const double v1, const double v2, const double v3)
1600{
1602 ReturnValue ret;
1603 if (!m_allInterfaces.iControlCalibration) {
1604 yCError(CB_RPC, "Invalid interface");
1605 ret = ReturnValue::return_code::return_value_error_not_ready;
1606 return ret;
1607 }
1608
1609 ret = m_allInterfaces.iControlCalibration->calibrateAxisWithParams(j, ui, v1, v2, v3);
1610 if (!ret) {
1611 yCError(CB_RPC, "Unable to calibrateAxisWithParams");
1612 }
1613 return ret;
1614}
1615
1617{
1619 ReturnValue ret;
1620 if (!m_allInterfaces.iControlCalibration) {
1621 yCError(CB_RPC, "Invalid interface");
1622 ret = ReturnValue::return_code::return_value_error_not_ready;
1623 return ret;
1624 }
1625
1627 params.param1 = yparams.param1;
1628 params.param2 = yparams.param2;
1629 params.param3 = yparams.param3;
1630 params.param4 = yparams.param4;
1631 params.param5 = yparams.param5;
1632 params.paramZero = yparams.paramZero;
1633 ret = m_allInterfaces.iControlCalibration->setCalibrationParameters(j, params);
1634 if (!ret) {
1635 yCError(CB_RPC, "Unable to setCalibrationParameters");
1636 }
1637 return ret;
1638}
1639
1641{
1643 ReturnValue ret;
1644 if (!m_allInterfaces.iControlCalibration) {
1645 yCError(CB_RPC, "Invalid interface");
1646 ret = ReturnValue::return_code::return_value_error_not_ready;
1647 return ret;
1648 }
1649
1650 ret = m_allInterfaces.iControlCalibration->calibrationDone(j);
1651 if (!ret) {
1652 yCError(CB_RPC, "Unable to calibrationDone");
1653 }
1654 return ret;
1655}
1656
1657//------- IJointFault
1658
1660{
1663 if (!m_allInterfaces.iJointFault)
1664 {
1665 yCError(CB_RPC, "Invalid interface");
1666 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
1667 return ret;
1668 }
1669
1670 ret.ret = m_allInterfaces.iJointFault->getLastJointFault(j, ret.fault, ret.message);
1671 if (!ret.ret)
1672 {
1673 yCError(CB_RPC, "Unable to getLastJointFault");
1674 }
1675 return ret;
1676}
1677
1678//------- IRemoteVariable
1679
1681{
1684 if (!m_allInterfaces.iRemoteVariables)
1685 {
1686 yCError(CB_RPC, "Invalid interface");
1687 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
1688 return ret;
1689 }
1690
1691 ret.ret = m_allInterfaces.iRemoteVariables->getRemoteVariable(key, ret.val);
1692 if (!ret.ret)
1693 {
1694 yCError(CB_RPC, "Unable to getRemoteVariable");
1695 }
1696 return ret;
1697}
1698
1700{
1702 ReturnValue ret;
1703 if (!m_allInterfaces.iRemoteVariables) {
1704 yCError(CB_RPC, "Invalid interface");
1705 ret = ReturnValue::return_code::return_value_error_not_ready;
1706 return ret;
1707 }
1708
1709 ret = m_allInterfaces.iRemoteVariables->setRemoteVariable(key, val);
1710 if (!ret) {
1711 yCError(CB_RPC, "Unable to setRemoteVariable");
1712 }
1713 return ret;
1714}
1715
1717{
1720 if (!m_allInterfaces.iRemoteVariables)
1721 {
1722 yCError(CB_RPC, "Invalid interface");
1723 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
1724 return ret;
1725 }
1726
1727 yarp::os::Bottle listOfKeys;
1728 ret.ret = m_allInterfaces.iRemoteVariables->getRemoteVariablesList(&listOfKeys);
1729 if (!ret.ret)
1730 {
1731 yCError(CB_RPC, "Unable to getRemoteVariablesList");
1732 return ret;
1733 }
1734 ret.listOfKeys.clear();
1735 ret.listOfKeys.push_back(listOfKeys);
1736 return ret;
1737}
1738
1739//------- ICurrentControl
1740
1742{
1745 if (!m_allInterfaces.iCurrentControl) {
1746 yCError(CB_RPC, "Invalid iCurrentControl interface");
1748 return ret;
1749 }
1750 ret.refs.resize(m_njoints);
1751 ret.ret = m_allInterfaces.iCurrentControl->getRefCurrents(ret.refs.data());
1752 if (!ret.ret) {
1753 yCError(CB_RPC, "getRefCurrents() failed");
1754 }
1755 return ret;
1756}
1757
1759{
1762 if (!m_allInterfaces.iCurrentControl) {
1763 yCError(CB_RPC, "Invalid interface");
1764 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
1765 return ret;
1766 }
1767
1768 ret.ret = m_allInterfaces.iCurrentControl->getRefCurrent(j, &ret.ref);
1769 if (!ret.ret) {
1770 yCError(CB_RPC, "Unable to getRefCurrent");
1771 }
1772 return ret;
1773}
1774
1776{
1778 ReturnValue ret;
1779 if (!m_allInterfaces.iCurrentControl) {
1780 yCError(CB_RPC, "Invalid interface");
1781 ret = ReturnValue::return_code::return_value_error_not_ready;
1782 return ret;
1783 }
1784
1785 ret = m_allInterfaces.iCurrentControl->setRefCurrents(refs.data());
1786 if (!ret) {
1787 yCError(CB_RPC, "Unable to setRefCurrents");
1788 return ReturnValue::return_code::return_value_error_generic;
1789 }
1790 return ret;
1791}
1792
1794{
1796 ReturnValue ret;
1797 if (!m_allInterfaces.iCurrentControl) {
1798 yCError(CB_RPC, "Invalid interface");
1799 ret = ReturnValue::return_code::return_value_error_not_ready;
1800 return ret;
1801 }
1802
1803 ret = m_allInterfaces.iCurrentControl->setRefCurrent(j, ref);
1804 if (!ret) {
1805 yCError(CB_RPC, "Unable to setRefCurrent");
1806 return ReturnValue::return_code::return_value_error_generic;
1807 }
1808 return ret;
1809}
1810
1811yarp::dev::ReturnValue ControlBoardRPCd::setRefCurrentGroupRPC(const std::vector<std::int32_t>& j, const std::vector<double>& refs)
1812{
1814 ReturnValue ret;
1815 if (!m_allInterfaces.iCurrentControl) {
1816 yCError(CB_RPC, "Invalid interface");
1817 ret = ReturnValue::return_code::return_value_error_not_ready;
1818 return ret;
1819 }
1820
1821 ret = m_allInterfaces.iCurrentControl->setRefCurrents(j.size(), j.data(), refs.data());
1822 if (!ret) {
1823 yCError(CB_RPC, "Unable to setRefCurrents");
1824 return ReturnValue::return_code::return_value_error_generic;
1825 }
1826 return ret;
1827}
1828
1830{
1833 if (!m_allInterfaces.iCurrentControl) {
1834 yCError(CB_RPC, "Invalid iCurrentControl interface");
1836 return ret;
1837 }
1838 ret.currs.resize(m_njoints);
1839 ret.ret = m_allInterfaces.iCurrentControl->getCurrents(ret.currs.data());
1840 if (!ret.ret) {
1841 yCError(CB_RPC, "getCurrents() failed");
1842 }
1843 return ret;
1844}
1845
1847{
1850 if (!m_allInterfaces.iCurrentControl) {
1851 yCError(CB_RPC, "Invalid interface");
1852 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
1853 return ret;
1854 }
1855
1856 ret.ret = m_allInterfaces.iCurrentControl->getCurrent(j, &ret.curr);
1857 if (!ret.ret) {
1858 yCError(CB_RPC, "Unable to getCurrent");
1859 }
1860 return ret;
1861}
1862
1864{
1867 if (!m_allInterfaces.iCurrentControl) {
1868 yCError(CB_RPC, "Invalid interface");
1869 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
1870 return ret;
1871 }
1872
1873 ret.ret = m_allInterfaces.iCurrentControl->getCurrentRange(j, &ret.min, &ret.max);
1874 if (!ret.ret) {
1875 yCError(CB_RPC, "Unable to getCurrentRange");
1876 }
1877 return ret;
1878}
1879
1881{
1884 if (!m_allInterfaces.iCurrentControl) {
1885 yCError(CB_RPC, "Invalid iCurrentControl interface");
1887 return ret;
1888 }
1889 ret.mins.resize(m_njoints);
1890 ret.maxs.resize(m_njoints);
1891 ret.ret = m_allInterfaces.iCurrentControl->getCurrentRanges(ret.mins.data(), ret.maxs.data());
1892 if (!ret.ret) {
1893 yCError(CB_RPC, "getCurrentRanges() failed");
1894 }
1895 return ret;
1896}
1897
1898//------- IPWMControl
1899
1901{
1903 ReturnValue ret;
1904 if (!m_allInterfaces.iPWMControl) {
1905 yCError(CB_RPC, "Invalid interface");
1906 ret = ReturnValue::return_code::return_value_error_not_ready;
1907 return ret;
1908 }
1909
1910 ret = m_allInterfaces.iPWMControl->setRefDutyCycle(j, v);
1911 if (!ret) {
1912 yCError(CB_RPC, "Unable to setRefDutyCycle");
1913 return ReturnValue::return_code::return_value_error_generic;
1914 }
1915 return ret;
1916}
1917
1919{
1921 ReturnValue ret;
1922 if (!m_allInterfaces.iPWMControl) {
1923 yCError(CB_RPC, "Invalid interface");
1924 ret = ReturnValue::return_code::return_value_error_not_ready;
1925 return ret;
1926 }
1927
1928 ret = m_allInterfaces.iPWMControl->setRefDutyCycles(v.data());
1929 if (!ret) {
1930 yCError(CB_RPC, "Unable to setRefDutyCycles");
1931 return ReturnValue::return_code::return_value_error_generic;
1932 }
1933 return ret;
1934}
1935
1937{
1940 if (!m_allInterfaces.iPWMControl) {
1941 yCError(CB_RPC, "Invalid interface");
1942 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
1943 return ret;
1944 }
1945
1946 ret.ret = m_allInterfaces.iPWMControl->getRefDutyCycle(j, &ret.val);
1947 if (!ret.ret) {
1948 yCError(CB_RPC, "Unable to getRefDutyCycle");
1949 }
1950 return ret;
1951}
1952
1954{
1957 if (!m_allInterfaces.iPWMControl) {
1958 yCError(CB_RPC, "Invalid interface");
1959 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
1960 return ret;
1961 }
1962
1963 ret.val.resize(m_njoints);
1964 ret.ret = m_allInterfaces.iPWMControl->getRefDutyCycles(ret.val.data());
1965 if (!ret.ret) {
1966 yCError(CB_RPC, "Unable to getRefDutyCycles");
1967 }
1968 return ret;
1969}
1970
1972{
1975 if (!m_allInterfaces.iPWMControl) {
1976 yCError(CB_RPC, "Invalid interface");
1977 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
1978 return ret;
1979 }
1980
1981 ret.ret = m_allInterfaces.iPWMControl->getDutyCycle(j, &ret.val);
1982 if (!ret.ret) {
1983 yCError(CB_RPC, "Unable to getDutyCycle");
1984 }
1985 return ret;
1986}
1987
1989{
1992 if (!m_allInterfaces.iPWMControl) {
1993 yCError(CB_RPC, "Invalid interface");
1994 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
1995 return ret;
1996 }
1997
1998 ret.val.resize(m_njoints);
1999 ret.ret = m_allInterfaces.iPWMControl->getDutyCycles(ret.val.data());
2000 if (!ret.ret) {
2001 yCError(CB_RPC, "Unable to getDutyCycles");
2002 }
2003 return ret;
2004}
2005
2006//------- IEncoders
2007
2009{
2011 ReturnValue ret;
2012 if (!m_allInterfaces.iEncodersTimed) {
2013 yCError(CB_RPC, "Invalid interface");
2014 ret = ReturnValue::return_code::return_value_error_not_ready;
2015 return ret;
2016 }
2017
2018 ret = m_allInterfaces.iEncodersTimed->resetEncoder(j);
2019 if (!ret) {
2020 yCError(CB_RPC, "Unable to resetEncoder");
2021 return ReturnValue::return_code::return_value_error_generic;
2022 }
2023 return ret;
2024}
2025
2027{
2029 ReturnValue ret;
2030 if (!m_allInterfaces.iEncodersTimed) {
2031 yCError(CB_RPC, "Invalid interface");
2032 ret = ReturnValue::return_code::return_value_error_not_ready;
2033 return ret;
2034 }
2035
2036 ret = m_allInterfaces.iEncodersTimed->resetEncoders();
2037 if (!ret) {
2038 yCError(CB_RPC, "Unable to resetEncoders");
2039 return ReturnValue::return_code::return_value_error_generic;
2040 }
2041 return ret;
2042}
2043
2044yarp::dev::ReturnValue ControlBoardRPCd::setEncoderOneRPC(const std::int32_t j, const double val)
2045{
2047 ReturnValue ret;
2048 if (!m_allInterfaces.iEncodersTimed) {
2049 yCError(CB_RPC, "Invalid interface");
2050 ret = ReturnValue::return_code::return_value_error_not_ready;
2051 return ret;
2052 }
2053
2054 ret = m_allInterfaces.iEncodersTimed->setEncoder(j,val);
2055 if (!ret) {
2056 yCError(CB_RPC, "Unable to setEncoder");
2057 return ReturnValue::return_code::return_value_error_generic;
2058 }
2059 return ret;
2060}
2061
2063{
2065 ReturnValue ret;
2066 if (!m_allInterfaces.iEncodersTimed) {
2067 yCError(CB_RPC, "Invalid interface");
2068 ret = ReturnValue::return_code::return_value_error_not_ready;
2069 return ret;
2070 }
2071
2072 ret = m_allInterfaces.iEncodersTimed->setEncoders(vals.data());
2073 if (!ret) {
2074 yCError(CB_RPC, "Unable to setEncoders");
2075 return ReturnValue::return_code::return_value_error_generic;
2076 }
2077 return ret;
2078}
2079
2081{
2084 if (!m_allInterfaces.iEncodersTimed) {
2085 yCError(CB_RPC, "Invalid interface");
2086 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2087 return ret;
2088 }
2089
2090 ret.ret = m_allInterfaces.iEncodersTimed->getEncoder(j, &ret.val);
2091 if (!ret.ret) {
2092 yCError(CB_RPC, "Unable to getEncoder");
2093 }
2094 return ret;
2095}
2096
2098{
2101 if (!m_allInterfaces.iEncodersTimed) {
2102 yCError(CB_RPC, "Invalid interface");
2103 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2104 return ret;
2105 }
2106
2107 ret.ret = m_allInterfaces.iEncodersTimed->getEncoderTimed(j, &ret.val, &ret.time);
2108 if (!ret.ret) {
2109 yCError(CB_RPC, "Unable to getEncoderTimed");
2110 }
2111 return ret;
2112}
2113
2115{
2118 if (!m_allInterfaces.iEncodersTimed) {
2119 yCError(CB_RPC, "Invalid interface");
2120 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2121 return ret;
2122 }
2123
2124 ret.val.resize(m_njoints);
2125 ret.ret = m_allInterfaces.iEncodersTimed->getEncoders(ret.val.data());
2126 if (!ret.ret) {
2127 yCError(CB_RPC, "Unable to getEncoders");
2128 }
2129 return ret;
2130}
2131
2133{
2136 if (!m_allInterfaces.iEncodersTimed) {
2137 yCError(CB_RPC, "Invalid interface");
2138 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2139 return ret;
2140 }
2141
2142 ret.val.resize(m_njoints);
2143 ret.time.resize(m_njoints);
2144 ret.ret = m_allInterfaces.iEncodersTimed->getEncodersTimed(ret.val.data(), ret.time.data());
2145 if (!ret.ret) {
2146 yCError(CB_RPC, "Unable to getEncodersTimed");
2147 }
2148 return ret;
2149}
2150
2152{
2155 if (!m_allInterfaces.iEncodersTimed) {
2156 yCError(CB_RPC, "Invalid interface");
2157 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2158 return ret;
2159 }
2160
2161 ret.ret = m_allInterfaces.iEncodersTimed->getEncoderSpeed(j, &ret.val);
2162 if (!ret.ret) {
2163 yCError(CB_RPC, "Unable to getEncoderSpeed");
2164 }
2165 return ret;
2166}
2167
2169{
2172 if (!m_allInterfaces.iEncodersTimed) {
2173 yCError(CB_RPC, "Invalid interface");
2174 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2175 return ret;
2176 }
2177
2178 ret.val.resize(m_njoints);
2179 ret.ret = m_allInterfaces.iEncodersTimed->getEncoderSpeeds(ret.val.data());
2180 if (!ret.ret) {
2181 yCError(CB_RPC, "Unable to getEncodersSpeed");
2182 }
2183 return ret;
2184}
2185
2187{
2190 if (!m_allInterfaces.iEncodersTimed) {
2191 yCError(CB_RPC, "Invalid interface");
2192 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2193 return ret;
2194 }
2195
2196 ret.ret = m_allInterfaces.iEncodersTimed->getEncoderAcceleration(j, &ret.val);
2197 if (!ret.ret) {
2198 yCError(CB_RPC, "Unable to getEncoderAcceleration");
2199 }
2200 return ret;
2201}
2202
2204{
2207 if (!m_allInterfaces.iEncodersTimed) {
2208 yCError(CB_RPC, "Invalid interface");
2209 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2210 return ret;
2211 }
2212
2213 ret.val.resize(m_njoints);
2214 ret.ret = m_allInterfaces.iEncodersTimed->getEncoderAccelerations(ret.val.data());
2215 if (!ret.ret) {
2216 yCError(CB_RPC, "Unable to getEncoderAccelerations");
2217 }
2218 return ret;
2219}
2220
2221
2222//------- IMotorEncoders
2223
2225{
2227 ReturnValue ret;
2228 if (!m_allInterfaces.iMotorEncoders) {
2229 yCError(CB_RPC, "Invalid interface");
2230 ret = ReturnValue::return_code::return_value_error_not_ready;
2231 return ret;
2232 }
2233
2234 ret = m_allInterfaces.iMotorEncoders->resetMotorEncoder(j);
2235 if (!ret) {
2236 yCError(CB_RPC, "Unable to resetMotorEncoder");
2237 }
2238 return ret;
2239}
2240
2242{
2244 ReturnValue ret;
2245 if (!m_allInterfaces.iMotorEncoders) {
2246 yCError(CB_RPC, "Invalid interface");
2247 ret = ReturnValue::return_code::return_value_error_not_ready;
2248 return ret;
2249 }
2250
2251 ret = m_allInterfaces.iMotorEncoders->resetMotorEncoders();
2252 if (!ret) {
2253 yCError(CB_RPC, "Unable to resetMotorEncoders");
2254 }
2255 return ret;
2256}
2257
2259{
2261 ReturnValue ret;
2262 if (!m_allInterfaces.iMotorEncoders) {
2263 yCError(CB_RPC, "Invalid interface");
2264 ret = ReturnValue::return_code::return_value_error_not_ready;
2265 return ret;
2266 }
2267
2268 ret = m_allInterfaces.iMotorEncoders->setMotorEncoder(j, val);
2269 if (!ret) {
2270 yCError(CB_RPC, "Unable to setMotorEncoder");
2271 }
2272 return ret;
2273}
2274
2276{
2278 ReturnValue ret;
2279 if (!m_allInterfaces.iMotorEncoders) {
2280 yCError(CB_RPC, "Invalid interface");
2281 ret = ReturnValue::return_code::return_value_error_not_ready;
2282 return ret;
2283 }
2284
2285 ret = m_allInterfaces.iMotorEncoders->setMotorEncoderCountsPerRevolution(j, val);
2286 if (!ret) {
2287 yCError(CB_RPC, "Unable to setMotorEncoderCountsPerRevolution");
2288 }
2289 return ret;
2290}
2291
2293{
2296 if (!m_allInterfaces.iMotorEncoders) {
2297 yCError(CB_RPC, "Invalid interface");
2298 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2299 return ret;
2300 }
2301
2302 ret.ret = m_allInterfaces.iMotorEncoders->getMotorEncoderCountsPerRevolution(m, &ret.cpr);
2303 if (!ret.ret) {
2304 yCError(CB_RPC, "Unable to getMotorEncoderCountsPerRevolution");
2305 }
2306 return ret;
2307}
2308
2310{
2312 ReturnValue ret;
2313 if (!m_allInterfaces.iMotorEncoders) {
2314 yCError(CB_RPC, "Invalid interface");
2315 ret = ReturnValue::return_code::return_value_error_not_ready;
2316 return ret;
2317 }
2318
2319 ret = m_allInterfaces.iMotorEncoders->setMotorEncoders(vals.data());
2320 if (!ret) {
2321 yCError(CB_RPC, "Unable to setMotorEncoders");
2322 return ReturnValue::return_code::return_value_error_generic;
2323 }
2324 return ret;
2325}
2326
2328{
2331 if (!m_allInterfaces.iMotorEncoders) {
2332 yCError(CB_RPC, "Invalid interface");
2333 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2334 return ret;
2335 }
2336
2337 ret.ret = m_allInterfaces.iMotorEncoders->getMotorEncoder(j, &ret.val);
2338 if (!ret.ret) {
2339 yCError(CB_RPC, "Unable to getMotorEncoder");
2340 }
2341 return ret;
2342}
2343
2345{
2348 if (!m_allInterfaces.iMotorEncoders) {
2349 yCError(CB_RPC, "Invalid interface");
2350 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2351 return ret;
2352 }
2353
2354 int nmotors = 0;
2355 ret.ret = m_allInterfaces.iMotorEncoders->getNumberOfMotorEncoders(&nmotors);
2356 if (!ret.ret) {
2357 yCError(CB_RPC, "Unable to getNumberOfMotorEncoders");
2358 return ret;
2359 }
2360 ret.val.resize(nmotors);
2361 ret.ret = m_allInterfaces.iMotorEncoders->getMotorEncoders(ret.val.data());
2362 if (!ret.ret) {
2363 yCError(CB_RPC, "Unable to getMotorEncoders");
2364 }
2365 return ret;
2366}
2367
2369{
2372 if (!m_allInterfaces.iMotorEncoders) {
2373 yCError(CB_RPC, "Invalid interface");
2374 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2375 return ret;
2376 }
2377
2378 ret.ret = m_allInterfaces.iMotorEncoders->getMotorEncoderTimed(j, &ret.val, &ret.time);
2379 if (!ret.ret) {
2380 yCError(CB_RPC, "Unable to getMotorEncoderTimed");
2381 }
2382 return ret;
2383}
2384
2386{
2389 if (!m_allInterfaces.iMotorEncoders) {
2390 yCError(CB_RPC, "Invalid interface");
2391 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2392 return ret;
2393 }
2394
2395 int nmotors = 0;
2396 ret.ret = m_allInterfaces.iMotorEncoders->getNumberOfMotorEncoders(&nmotors);
2397 if (!ret.ret) {
2398 yCError(CB_RPC, "Unable to getNumberOfMotorEncoders");
2399 return ret;
2400 }
2401 ret.val.resize(nmotors);
2402 ret.time.resize(nmotors);
2403 ret.ret = m_allInterfaces.iMotorEncoders->getMotorEncodersTimed(ret.val.data(), ret.time.data());
2404 if (!ret.ret) {
2405 yCError(CB_RPC, "Unable to getMotorEncodersTimed");
2406 }
2407 return ret;
2408}
2409
2411{
2414 if (!m_allInterfaces.iMotorEncoders) {
2415 yCError(CB_RPC, "Invalid interface");
2416 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2417 return ret;
2418 }
2419
2420 ret.ret = m_allInterfaces.iMotorEncoders->getMotorEncoderSpeed(j, &ret.val);
2421 if (!ret.ret) {
2422 yCError(CB_RPC, "Unable to getMotorEncoderSpeed");
2423 }
2424 return ret;
2425}
2426
2428{
2431 if (!m_allInterfaces.iMotorEncoders) {
2432 yCError(CB_RPC, "Invalid interface");
2433 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2434 return ret;
2435 }
2436
2437 int nmotors = 0;
2438 ret.ret = m_allInterfaces.iMotorEncoders->getNumberOfMotorEncoders(&nmotors);
2439 if (!ret.ret) {
2440 yCError(CB_RPC, "Unable to getNumberOfMotorEncoders");
2441 return ret;
2442 }
2443 ret.val.resize(nmotors);
2444 ret.ret = m_allInterfaces.iMotorEncoders->getMotorEncoderSpeeds(ret.val.data());
2445 if (!ret.ret) {
2446 yCError(CB_RPC, "Unable to getMotorEncoderSpeeds");
2447 }
2448 return ret;
2449}
2450
2452{
2455 if (!m_allInterfaces.iMotorEncoders) {
2456 yCError(CB_RPC, "Invalid interface");
2457 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2458 return ret;
2459 }
2460
2461 ret.ret = m_allInterfaces.iMotorEncoders->getMotorEncoderAcceleration(j, &ret.val);
2462 if (!ret.ret) {
2463 yCError(CB_RPC, "Unable to getMotorEncoderAcceleration");
2464 }
2465 return ret;
2466}
2467
2469{
2472 if (!m_allInterfaces.iMotorEncoders) {
2473 yCError(CB_RPC, "Invalid interface");
2474 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2475 return ret;
2476 }
2477
2478 int nmotors = 0;
2479 ret.ret = m_allInterfaces.iMotorEncoders->getNumberOfMotorEncoders(&nmotors);
2480 if (!ret.ret) {
2481 yCError(CB_RPC, "Unable to getNumberOfMotorEncoders");
2482 return ret;
2483 }
2484 ret.val.resize(nmotors);
2485 ret.ret = m_allInterfaces.iMotorEncoders->getMotorEncoderAccelerations(ret.val.data());
2486 if (!ret.ret) {
2487 yCError(CB_RPC, "Unable to getMotorEncoderAccelerations");
2488 }
2489 return ret;
2490}
2491
2493{
2496 if (!m_allInterfaces.iMotorEncoders) {
2497 yCError(CB_RPC, "Invalid interface");
2498 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2499 return ret;
2500 }
2501
2502 ret.ret = m_allInterfaces.iMotorEncoders->getNumberOfMotorEncoders(&ret.num);
2503 if (!ret.ret) {
2504 yCError(CB_RPC, "Unable to getNumberOfMotorEncoders");
2505 }
2506 return ret;
2507}
2508
2509
2510//------- ITorque
2511ReturnValue ControlBoardRPCd::setRefTorqueOneRPC(const std::int32_t j, const double vel)
2512{
2514 ReturnValue ret;
2515 if (!m_allInterfaces.iTorqueControl) {
2516 yCError(CB_RPC, "Invalid interface");
2517 ret = ReturnValue::return_code::return_value_error_not_ready;
2518 return ret;
2519 }
2520
2521 ret = m_allInterfaces.iTorqueControl->setRefTorque(j, vel);
2522 if (!ret) {
2523 yCError(CB_RPC, "setRefTorque() failed");
2524 }
2525 return ret;
2526}
2527
2529{
2531 ReturnValue ret;
2532 if (!m_allInterfaces.iTorqueControl) {
2533 yCError(CB_RPC, "Invalid interface");
2534 ret = ReturnValue::return_code::return_value_error_not_ready;
2535 return ret;
2536 }
2537
2538 ret = m_allInterfaces.iTorqueControl->setRefTorques(trq.data());
2539 if (!ret) {
2540 yCError(CB_RPC, "setRefTorques() failed");
2541 }
2542 return ret;
2543}
2544
2545ReturnValue ControlBoardRPCd::setRefTorqueGroupRPC(const std::vector<std::int32_t>& j, const std::vector<double>& trq)
2546{
2548 ReturnValue ret;
2549 if (!m_allInterfaces.iTorqueControl) {
2550 yCError(CB_RPC, "Invalid interface");
2551 ret = ReturnValue::return_code::return_value_error_not_ready;
2552 return ret;
2553 }
2554
2555 ret = m_allInterfaces.iTorqueControl->setRefTorques(j.size(), j.data(), trq.data());
2556 if (!ret) {
2557 yCError(CB_RPC, "setRefTorques() failed");
2558 }
2559 return ret;
2560}
2561
2563{
2566 if (!m_allInterfaces.iTorqueControl) {
2567 yCError(CB_RPC, "Invalid interface");
2568 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2569 return ret;
2570 }
2571
2572 ret.ret = m_allInterfaces.iTorqueControl->getRefTorque(j, &ret.val);
2573 if (!ret.ret) {
2574 yCError(CB_RPC, "Unable to getRefTorque");
2575 }
2576 return ret;
2577}
2578
2580{
2583 if (!m_allInterfaces.iTorqueControl) {
2584 yCError(CB_RPC, "Invalid interface");
2585 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2586 return ret;
2587 }
2588
2589 ret.val.resize(m_njoints);
2590 ret.ret = m_allInterfaces.iTorqueControl->getRefTorques(ret.val.data());
2591 if (!ret.ret) {
2592 yCError(CB_RPC, "Unable to getRefTorques");
2593 }
2594 return ret;
2595}
2596
2598{
2601 if (!m_allInterfaces.iTorqueControl) {
2602 yCError(CB_RPC, "Invalid interface");
2603 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2604 return ret;
2605 }
2606
2607 ret.val.resize(j.size());
2608 //iTorqueControl interface does not have a group method
2610 return ret;
2611}
2612
2614{
2617 if (!m_allInterfaces.iTorqueControl) {
2618 yCError(CB_RPC, "Invalid interface");
2619 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2620 return ret;
2621 }
2622
2623 ret.ret = m_allInterfaces.iTorqueControl->getTorqueRange(j, &ret.min, &ret.max);
2624 if (!ret.ret) {
2625 yCError(CB_RPC, "Unable to getTorqueRange");
2626 }
2627 return ret;
2628}
2629
2631{
2634 if (!m_allInterfaces.iTorqueControl) {
2635 yCError(CB_RPC, "Invalid interface");
2636 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2637 return ret;
2638 }
2639
2640 ret.mins.resize(m_njoints);
2641 ret.maxs.resize(m_njoints);
2642 ret.ret = m_allInterfaces.iTorqueControl->getTorqueRanges(ret.mins.data(),ret.maxs.data());
2643 if (!ret.ret) {
2644 yCError(CB_RPC, "Unable to getTorqueRanges");
2645 }
2646 return ret;
2647}
2648
2649//------- IPositionDirect
2650
2652{
2654 ReturnValue ret;
2655 if (!m_allInterfaces.iPositionDirect) {
2656 yCError(CB_RPC, "Invalid interface");
2657 ret = ReturnValue::return_code::return_value_error_not_ready;
2658 return ret;
2659 }
2660
2661 ret = m_allInterfaces.iPositionDirect->setPosition(j, ref);
2662 if (!ret) {
2663 yCError(CB_RPC, "Unable to setPosition");
2664 }
2665 return ret;
2666}
2667
2669{
2671 ReturnValue ret;
2672 if (!m_allInterfaces.iPositionDirect) {
2673 yCError(CB_RPC, "Invalid interface");
2674 ret = ReturnValue::return_code::return_value_error_not_ready;
2675 return ret;
2676 }
2677
2678 ret = m_allInterfaces.iPositionDirect->setPositions(refs.data());
2679 if (!ret) {
2680 yCError(CB_RPC, "Unable to setPositions");
2681 }
2682 return ret;
2683}
2684
2685yarp::dev::ReturnValue ControlBoardRPCd::setRefPositionGroupRPC(const std::vector<std::int32_t>& joints, const std::vector<double>& refs)
2686{
2688 ReturnValue ret;
2689 if (!m_allInterfaces.iPositionDirect) {
2690 yCError(CB_RPC, "Invalid interface");
2691 ret = ReturnValue::return_code::return_value_error_not_ready;
2692 return ret;
2693 }
2694
2695 ret = m_allInterfaces.iPositionDirect->setPositions(joints.size(), joints.data(), refs.data());
2696 if (!ret) {
2697 yCError(CB_RPC, "Unable to setPositions");
2698 }
2699 return ret;
2700}
2701
2702
2704{
2707 if (!m_allInterfaces.iPositionDirect) {
2708 yCError(CB_RPC, "Invalid interface");
2709 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2710 return ret;
2711 }
2712
2713 ret.ret = m_allInterfaces.iPositionDirect->getRefPosition(j, &ret.val);
2714 if (!ret.ret) {
2715 yCError(CB_RPC, "Unable to getRefPosition");
2716 }
2717 return ret;
2718}
2719
2721{
2724 if (!m_allInterfaces.iPositionDirect) {
2725 yCError(CB_RPC, "Invalid interface");
2726 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2727 return ret;
2728 }
2729
2730 ret.val.resize(m_njoints);
2731 ret.ret = m_allInterfaces.iPositionDirect->getRefPositions(ret.val.data());
2732 if (!ret.ret) {
2733 yCError(CB_RPC, "Unable to getRefPositions");
2734 }
2735 return ret;
2736}
2737
2739{
2742 if (!m_allInterfaces.iPositionDirect) {
2743 yCError(CB_RPC, "Invalid interface");
2744 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2745 return ret;
2746 }
2747
2748 ret.val.resize(j.size());
2749 ret.ret = m_allInterfaces.iPositionDirect->getRefPositions(j.size(), j.data(), ret.val.data());
2750 if (!ret.ret) {
2751 yCError(CB_RPC, "Unable to getRefPositions");
2752 }
2753 return ret;
2754}
2755
2756//------- IPositionControl
2757
2759{
2761 ReturnValue ret;
2762 if (!m_allInterfaces.iPositionControl) {
2763 yCError(CB_RPC, "Invalid interface");
2764 ret = ReturnValue::return_code::return_value_error_not_ready;
2765 return ret;
2766 }
2767
2768 ret = m_allInterfaces.iPositionControl->positionMove(j, ref);
2769 if (!ret) {
2770 yCError(CB_RPC, "Unable to positionMove");
2771 }
2772 return ret;
2773}
2774
2775yarp::dev::ReturnValue ControlBoardRPCd::positionMoveGroupRPC(const std::vector<std::int32_t>& joints, const std::vector<double>& refs)
2776{
2778 ReturnValue ret;
2779 if (!m_allInterfaces.iPositionControl) {
2780 yCError(CB_RPC, "Invalid interface");
2781 ret = ReturnValue::return_code::return_value_error_not_ready;
2782 return ret;
2783 }
2784
2785 ret = m_allInterfaces.iPositionControl->positionMove(joints.size(), joints.data(), refs.data());
2786 if (!ret) {
2787 yCError(CB_RPC, "Unable to positionMove");
2788 return ReturnValue::return_code::return_value_error_generic;
2789 }
2790 return ret;
2791}
2792
2794{
2796 ReturnValue ret;
2797 if (!m_allInterfaces.iPositionControl) {
2798 yCError(CB_RPC, "Invalid interface");
2799 ret = ReturnValue::return_code::return_value_error_not_ready;
2800 return ret;
2801 }
2802
2803 ret = m_allInterfaces.iPositionControl->positionMove(refs.data());
2804 if (!ret) {
2805 yCError(CB_RPC, "Unable to positionMove");
2806 return ReturnValue::return_code::return_value_error_generic;
2807 }
2808 return ret;
2809}
2810
2811yarp::dev::ReturnValue ControlBoardRPCd::relativeMoveOneRPC(const std::int32_t j, const double delta)
2812{
2814 ReturnValue ret;
2815 if (!m_allInterfaces.iPositionControl) {
2816 yCError(CB_RPC, "Invalid interface");
2817 ret = ReturnValue::return_code::return_value_error_not_ready;
2818 return ret;
2819 }
2820
2821 ret = m_allInterfaces.iPositionControl->relativeMove(j, delta);
2822 if (!ret) {
2823 yCError(CB_RPC, "Unable to relativeMove");
2824 }
2825 return ret;
2826}
2827
2828yarp::dev::ReturnValue ControlBoardRPCd::relativeMoveGroupRPC(const std::vector<std::int32_t>& joints, const std::vector<double>& refs)
2829{
2831 ReturnValue ret;
2832 if (!m_allInterfaces.iPositionControl) {
2833 yCError(CB_RPC, "Invalid interface");
2834 ret = ReturnValue::return_code::return_value_error_not_ready;
2835 return ret;
2836 }
2837
2838 ret = m_allInterfaces.iPositionControl->relativeMove(joints.size(), joints.data(), refs.data());
2839 if (!ret) {
2840 yCError(CB_RPC, "Unable to relativeMove");
2841 return ReturnValue::return_code::return_value_error_generic;
2842 }
2843 return ret;
2844}
2845
2847{
2849 ReturnValue ret;
2850 if (!m_allInterfaces.iPositionControl) {
2851 yCError(CB_RPC, "Invalid interface");
2852 ret = ReturnValue::return_code::return_value_error_not_ready;
2853 return ret;
2854 }
2855
2856 ret = m_allInterfaces.iPositionControl->relativeMove(deltas.data());
2857 if (!ret) {
2858 yCError(CB_RPC, "Unable to relativeMove");
2859 return ReturnValue::return_code::return_value_error_generic;
2860 }
2861 return ret;
2862}
2863
2865{
2867 ReturnValue ret;
2868 if (!m_allInterfaces.iPositionControl) {
2869 yCError(CB_RPC, "Invalid interface");
2870 ret = ReturnValue::return_code::return_value_error_not_ready;
2871 return ret;
2872 }
2873
2874 ret = m_allInterfaces.iPositionControl->setTrajSpeed(j, sp);
2875 if (!ret) {
2876 yCError(CB_RPC, "Unable to setTrajSpeed");
2877 return ReturnValue::return_code::return_value_error_generic;
2878 }
2879 return ret;
2880}
2881
2882yarp::dev::ReturnValue ControlBoardRPCd::setTrajSpeedGroupRPC(const std::vector<std::int32_t>& joints, const std::vector<double>& spds)
2883{
2885 ReturnValue ret;
2886 if (!m_allInterfaces.iPositionControl) {
2887 yCError(CB_RPC, "Invalid interface");
2888 ret = ReturnValue::return_code::return_value_error_not_ready;
2889 return ret;
2890 }
2891
2892 ret = m_allInterfaces.iPositionControl->setTrajSpeeds(joints.size(), joints.data(), spds.data());
2893 if (!ret) {
2894 yCError(CB_RPC, "Unable to setTrajSpeeds");
2895 return ReturnValue::return_code::return_value_error_generic;
2896 }
2897 return ret;
2898}
2899
2901{
2903 ReturnValue ret;
2904 if (!m_allInterfaces.iPositionControl) {
2905 yCError(CB_RPC, "Invalid interface");
2906 ret = ReturnValue::return_code::return_value_error_not_ready;
2907 return ret;
2908 }
2909
2910 ret = m_allInterfaces.iPositionControl->setTrajSpeeds(spds.data());
2911 if (!ret) {
2912 yCError(CB_RPC, "Unable to setTrajSpeeds");
2913 return ReturnValue::return_code::return_value_error_generic;
2914 }
2915 return ret;
2916}
2917
2919{
2921 ReturnValue ret;
2922 if (!m_allInterfaces.iPositionControl) {
2923 yCError(CB_RPC, "Invalid interface");
2924 ret = ReturnValue::return_code::return_value_error_not_ready;
2925 return ret;
2926 }
2927
2928 ret = m_allInterfaces.iPositionControl->setTrajAcceleration(j, acc);
2929 if (!ret) {
2930 yCError(CB_RPC, "Unable to setTrajAcceleration");
2931 }
2932 return ret;
2933}
2934
2935yarp::dev::ReturnValue ControlBoardRPCd::setTrajAccelerationsGroupRPC(const std::vector<std::int32_t>& joints, const std::vector<double>& accs)
2936{
2938 ReturnValue ret;
2939 if (!m_allInterfaces.iPositionControl) {
2940 yCError(CB_RPC, "Invalid interface");
2941 ret = ReturnValue::return_code::return_value_error_not_ready;
2942 return ret;
2943 }
2944
2945 ret = m_allInterfaces.iPositionControl->setTrajAccelerations(joints.size(), joints.data(), accs.data());
2946 if (!ret) {
2947 yCError(CB_RPC, "Unable to setTrajAccelerations");
2948 return ReturnValue::return_code::return_value_error_generic;
2949 }
2950 return ret;
2951}
2952
2954{
2956 ReturnValue ret;
2957 if (!m_allInterfaces.iPositionControl) {
2958 yCError(CB_RPC, "Invalid interface");
2959 ret = ReturnValue::return_code::return_value_error_not_ready;
2960 return ret;
2961 }
2962
2963 ret = m_allInterfaces.iPositionControl->setTrajAccelerations(accs.data());
2964 if (!ret) {
2965 yCError(CB_RPC, "Unable to setTrajAccelerations");
2966 return ReturnValue::return_code::return_value_error_generic;
2967 }
2968 return ret;
2969}
2970
2972{
2974 ReturnValue ret;
2975 if (!m_allInterfaces.iPositionControl) {
2976 yCError(CB_RPC, "Invalid interface");
2977 ret = ReturnValue::return_code::return_value_error_not_ready;
2978 return ret;
2979 }
2980
2981 ret = m_allInterfaces.iPositionControl->stop(j);
2982 if (!ret) {
2983 yCError(CB_RPC, "Unable to stop");
2984 }
2985 return ret;
2986}
2987
2988yarp::dev::ReturnValue ControlBoardRPCd::stopGroupRPC(const std::vector<std::int32_t>& joints)
2989{
2991 ReturnValue ret;
2992 if (!m_allInterfaces.iPositionControl) {
2993 yCError(CB_RPC, "Invalid interface");
2994 ret = ReturnValue::return_code::return_value_error_not_ready;
2995 return ret;
2996 }
2997
2998 ret = m_allInterfaces.iPositionControl->stop(joints.size(),joints.data());
2999 if (!ret) {
3000 yCError(CB_RPC, "Unable to stop");
3001 }
3002 return ret;
3003}
3004
3006{
3008 ReturnValue ret;
3009 if (!m_allInterfaces.iPositionControl) {
3010 yCError(CB_RPC, "Invalid interface");
3011 ret = ReturnValue::return_code::return_value_error_not_ready;
3012 return ret;
3013 }
3014
3015 ret = m_allInterfaces.iPositionControl->stop();
3016 if (!ret) {
3017 yCError(CB_RPC, "Unable to stop");
3018 }
3019 return ret;
3020}
3021
3023{
3025 ReturnValue ret;
3026 if (!m_allInterfaces.iVelocityControl) {
3027 yCError(CB_RPC, "Invalid interface");
3028 ret = ReturnValue::return_code::return_value_error_not_ready;
3029 return ret;
3030 }
3031
3032 ret = m_allInterfaces.iVelocityControl->velocityMove(j, ref);
3033 if (!ret) {
3034 yCError(CB_RPC, "Unable to velocityMove");
3035 }
3036 return ret;
3037}
3038
3039yarp::dev::ReturnValue ControlBoardRPCd::velocityMoveGroupRPC(const std::vector<std::int32_t>& joints, const std::vector<double>& refs)
3040{
3042 ReturnValue ret;
3043 if (!m_allInterfaces.iVelocityControl) {
3044 yCError(CB_RPC, "Invalid interface");
3045 ret = ReturnValue::return_code::return_value_error_not_ready;
3046 return ret;
3047 }
3048
3049 ret = m_allInterfaces.iVelocityControl->velocityMove(joints.size(), joints.data(), refs.data());
3050 if (!ret) {
3051 yCError(CB_RPC, "Unable to velocityMove");
3052 }
3053 return ret;
3054}
3055
3057{
3059 ReturnValue ret;
3060 if (!m_allInterfaces.iVelocityControl) {
3061 yCError(CB_RPC, "Invalid interface");
3062 ret = ReturnValue::return_code::return_value_error_not_ready;
3063 return ret;
3064 }
3065
3066 ret = m_allInterfaces.iVelocityControl->velocityMove(refs.data());
3067 if (!ret) {
3068 yCError(CB_RPC, "Unable to velocityMove");
3069 }
3070 return ret;
3071}
3072
3073
3075{
3078 if (!m_allInterfaces.iPositionControl) {
3079 yCError(CB_RPC, "Invalid interface");
3080 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
3081 return ret;
3082 }
3083
3084 ret.ret = m_allInterfaces.iPositionControl->getTargetPosition(j, &ret.val);
3085 if (!ret.ret) {
3086 yCError(CB_RPC, "Unable to getTargetPosition");
3087 }
3088 return ret;
3089}
3090
3092{
3095 if (!m_allInterfaces.iPositionControl) {
3096 yCError(CB_RPC, "Invalid interface");
3097 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
3098 return ret;
3099 }
3100
3101 ret.val.resize(joints.size());
3102 ret.ret = m_allInterfaces.iPositionControl->getTargetPositions(joints.size(), joints.data(), ret.val.data());
3103 if (!ret.ret) {
3104 yCError(CB_RPC, "Unable to getTargetPositions");
3105 }
3106 return ret;
3107}
3108
3110{
3113 if (!m_allInterfaces.iPositionControl) {
3114 yCError(CB_RPC, "Invalid interface");
3115 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
3116 return ret;
3117 }
3118
3119 ret.val.resize(m_njoints);
3120 ret.ret = m_allInterfaces.iPositionControl->getTargetPositions(ret.val.data());
3121 if (!ret.ret) {
3122 yCError(CB_RPC, "Unable to getTargetPositions");
3123 }
3124 return ret;
3125}
3126
3128{
3131 if (!m_allInterfaces.iPositionControl) {
3132 yCError(CB_RPC, "Invalid interface");
3133 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
3134 return ret;
3135 }
3136
3137 ret.ret = m_allInterfaces.iPositionControl->getTrajSpeed(j, &ret.val);
3138 if (!ret.ret) {
3139 yCError(CB_RPC, "Unable to getTrajSpeed");
3140 }
3141 return ret;
3142}
3143
3144return_getTrajSpeedsGroup ControlBoardRPCd::getTrajSpeedsGroupRPC(const std::vector<std::int32_t>& joints) const
3145{
3148 if (!m_allInterfaces.iPositionControl) {
3149 yCError(CB_RPC, "Invalid iPositionControl interface");
3151 return ret;
3152 }
3153 ret.val.resize(joints.size());
3154 ret.ret = m_allInterfaces.iPositionControl->getTrajSpeeds(joints.size(), joints.data(), ret.val.data());
3155 if (!ret.ret) {
3156 yCError(CB_RPC, "getTrajSpeeds() failed");
3157 }
3158 return ret;
3159}
3160
3162{
3165 if (!m_allInterfaces.iPositionControl) {
3166 yCError(CB_RPC, "Invalid iPositionControl interface");
3168 return ret;
3169 }
3170 ret.val.resize(m_njoints);
3171 ret.ret = m_allInterfaces.iPositionControl->getTrajSpeeds(ret.val.data());
3172 if (!ret.ret) {
3173 yCError(CB_RPC, "getTrajSpeeds() failed");
3174 }
3175 return ret;
3176}
3177
3179{
3182 if (!m_allInterfaces.iPositionControl) {
3183 yCError(CB_RPC, "Invalid interface");
3184 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
3185 return ret;
3186 }
3187
3188 ret.ret = m_allInterfaces.iPositionControl->getTrajAcceleration(j, &ret.val);
3189 if (!ret.ret) {
3190 yCError(CB_RPC, "Unable to getTrajAcceleration");
3191 }
3192 return ret;
3193}
3194
3196{
3199 if (!m_allInterfaces.iPositionControl) {
3200 yCError(CB_RPC, "Invalid iPositionControl interface");
3202 return ret;
3203 }
3204 ret.val.resize(joints.size());
3205 ret.ret = m_allInterfaces.iPositionControl->getTrajAccelerations(joints.size(), joints.data(), ret.val.data());
3206 if (!ret.ret) {
3207 yCError(CB_RPC, "getTrajAccelerations() failed");
3208 }
3209 return ret;
3210}
3211
3213{
3216 if (!m_allInterfaces.iPositionControl) {
3217 yCError(CB_RPC, "Invalid iPositionControl interface");
3219 return ret;
3220 }
3221 ret.val.resize(m_njoints);
3222 ret.ret = m_allInterfaces.iPositionControl->getTrajAccelerations(ret.val.data());
3223 if (!ret.ret) {
3224 yCError(CB_RPC, "getTrajAccelerations() failed");
3225 }
3226 return ret;
3227}
3228
3230{
3233 if (!m_allInterfaces.iPositionControl) {
3234 yCError(CB_RPC, "Invalid interface");
3235 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
3236 return ret;
3237 }
3238
3239 ret.ret = m_allInterfaces.iPositionControl->checkMotionDone(j, ret.flag);
3240 if (!ret.ret) {
3241 yCError(CB_RPC, "Unable to checkMotionDone");
3242 }
3243 return ret;
3244}
3245
3247{
3250 if (!m_allInterfaces.iPositionControl) {
3251 yCError(CB_RPC, "Invalid iPositionControl interface");
3253 return ret;
3254 }
3255
3256 ret.ret = m_allInterfaces.iPositionControl->checkMotionDone(joints, ret.flag);
3257 if (!ret.ret) {
3258 yCError(CB_RPC, "checkMotionDone() failed");
3259 }
3260 return ret;
3261}
3262
3264{
3267 if (!m_allInterfaces.iPositionControl) {
3268 yCError(CB_RPC, "Invalid iPositionControl interface");
3270 return ret;
3271 }
3272
3273 ret.ret = m_allInterfaces.iPositionControl->checkMotionDone(ret.flag);
3274 if (!ret.ret) {
3275 yCError(CB_RPC, "checkMotionDone() failed");
3276 }
3277 return ret;
3278}
3279
3280//------- IMotorControl
3281
3283{
3286 if (!m_allInterfaces.iMotor) {
3287 yCError(CB_RPC, "Invalid interface");
3288 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
3289 return ret;
3290 }
3291
3292 ret.ret = m_allInterfaces.iMotor->getNumberOfMotors(&ret.val);
3293 if (!ret.ret) {
3294 yCError(CB_RPC, "Unable to getNumberOfMotors");
3295 }
3296 return ret;
3297}
3298
3300{
3303 if (!m_allInterfaces.iMotor) {
3304 yCError(CB_RPC, "Invalid interface");
3305 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
3306 return ret;
3307 }
3308
3309 ret.ret = m_allInterfaces.iMotor->getTemperature(m,&ret.val);
3310 if (!ret.ret) {
3311 yCError(CB_RPC, "Unable to getTemperature");
3312 }
3313 return ret;
3314}
3315
3317{
3320 if (!m_allInterfaces.iMotor) {
3321 yCError(CB_RPC, "Invalid iMotor interface");
3323 return ret;
3324 }
3325 int nmotors = 0;
3326 ret.ret = m_allInterfaces.iMotor->getNumberOfMotors(&nmotors);
3327 if (!ret.ret) {
3328 yCError(CB_RPC, "Unable to getNumberOfMotors");
3329 return ret;
3330 }
3331 ret.val.resize(nmotors);
3332 ret.ret = m_allInterfaces.iMotor->getTemperatures(ret.val.data());
3333 if (!ret.ret) {
3334 yCError(CB_RPC, "getTemperatures() failed");
3335 }
3336 return ret;
3337}
3338
3340{
3343 if (!m_allInterfaces.iMotor) {
3344 yCError(CB_RPC, "Invalid interface");
3345 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
3346 return ret;
3347 }
3348
3349 ret.ret = m_allInterfaces.iMotor->getTemperatureLimit(m,&ret.val);
3350 if (!ret.ret) {
3351 yCError(CB_RPC, "Unable to getTemperatureLimit");
3352 }
3353 return ret;
3354}
3355
3357{
3359 ReturnValue ret;
3360 if (!m_allInterfaces.iMotor) {
3361 yCError(CB_RPC, "Invalid interface");
3362 ret = ReturnValue::return_code::return_value_error_not_ready;
3363 return ret;
3364 }
3365
3366 ret = m_allInterfaces.iMotor->setTemperatureLimit(m, val);
3367 if (!ret) {
3368 yCError(CB_RPC, "Unable to setTemperatureLimit");
3369 }
3370 return ret;
3371}
3372
3374{
3377 if (!m_allInterfaces.iMotor) {
3378 yCError(CB_RPC, "Invalid interface");
3379 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
3380 return ret;
3381 }
3382
3383 ret.ret = m_allInterfaces.iMotor->getGearboxRatio(m,&ret.val);
3384 if (!ret.ret) {
3385 yCError(CB_RPC, "Unable to getGearboxRatio");
3386 }
3387 return ret;
3388}
3389
3391{
3393 ReturnValue ret;
3394 if (!m_allInterfaces.iMotor) {
3395 yCError(CB_RPC, "Invalid interface");
3396 ret = ReturnValue::return_code::return_value_error_not_ready;
3397 return ret;
3398 }
3399
3400 ret = m_allInterfaces.iMotor->setGearboxRatio(m, val);
3401 if (!ret) {
3402 yCError(CB_RPC, "Unable to setGearboxRatio");
3403 }
3404 return ret;
3405}
3406
3407//------- IMotorControl
3409{
3411 ReturnValue ret;
3412 if (!m_allInterfaces.iTorqueControl) {
3413 yCError(CB_RPC, "Invalid interface");
3414 ret = ReturnValue::return_code::return_value_error_not_ready;
3415 return ret;
3416 }
3417
3419 params.bemf = yparams.bemf;
3420 params.bemf_scale = yparams.bemf_scale;
3421 params.coulombNeg = yparams.coulombNeg;
3422 params.coulombPos = yparams.coulombPos;
3423 params.ktau = yparams.ktau;
3424 params.ktau_scale = yparams.ktau_scale;
3425 params.velocityThres = yparams.velocityThres;
3426 params.viscousNeg = yparams.viscousNeg;
3427 params.viscousPos = yparams.viscousPos;
3428 ret = m_allInterfaces.iTorqueControl->setMotorTorqueParams(j, params);
3429 if (!ret) {
3430 yCError(CB_RPC, "Unable to setMotorTorqueParams");
3431 }
3432 return ret;
3433}
3434
3436{
3439 if (!m_allInterfaces.iTorqueControl) {
3440 yCError(CB_RPC, "Invalid interface");
3441 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
3442 return ret;
3443 }
3444
3446 ret.ret = m_allInterfaces.iTorqueControl->getMotorTorqueParams(j,&params);
3447 if (!ret.ret) {
3448 yCError(CB_RPC, "Unable to getMotorTorqueParams");
3449 return ret;
3450 }
3451 ret.params.bemf = params.bemf;
3452 ret.params.bemf_scale = params.bemf_scale;
3453 ret.params.coulombNeg = params.coulombNeg;
3454 ret.params.coulombPos = params.coulombPos;
3455 ret.params.ktau = params.ktau;
3456 ret.params.ktau_scale = params.ktau_scale;
3457 ret.params.velocityThres = params.velocityThres;
3458 ret.params.viscousNeg = params.viscousNeg;
3459 ret.params.viscousPos = params.viscousPos;
3460 return ret;
3461}
3462
3463//------- IVelocityControl
3465{
3468 if (!m_allInterfaces.iVelocityControl) {
3469 yCError(CB_RPC, "Invalid interface");
3470 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
3471 return ret;
3472 }
3473
3474 ret.ret = m_allInterfaces.iVelocityControl->getTargetVelocity(j,&ret.val);
3475 if (!ret.ret) {
3476 yCError(CB_RPC, "Unable to getTargetVelocity");
3477 }
3478 return ret;
3479}
3480
3482{
3485 if (!m_allInterfaces.iVelocityControl) {
3486 yCError(CB_RPC, "Invalid iVelocityControl interface");
3488 return ret;
3489 }
3490 ret.val.resize(joints.size());
3491 ret.ret = m_allInterfaces.iVelocityControl->getTargetVelocities(joints.size(), joints.data(), ret.val.data());
3492 if (!ret.ret) {
3493 yCError(CB_RPC, "getTargetVelocity() failed");
3494 }
3495 return ret;
3496}
3497
3499{
3502 if (!m_allInterfaces.iVelocityControl) {
3503 yCError(CB_RPC, "Invalid iVelocityControl interface");
3505 return ret;
3506 }
3507 ret.val.resize(m_njoints);
3508 ret.ret = m_allInterfaces.iVelocityControl->getTargetVelocities(ret.val.data());
3509 if (!ret.ret) {
3510 yCError(CB_RPC, "getTargetVelocity() failed");
3511 }
3512 return ret;
3513}
3514
3516{
3518 ret.ret = ReturnValue_ok;
3519 ret.interfaces["iAmplifierControl"] = m_allInterfaces.iAmplifierControl!=nullptr;
3520 ret.interfaces["iAxisInfo"] = m_allInterfaces.iAxisInfo!=nullptr;
3521 ret.interfaces["iControlCalibration"] = m_allInterfaces.iControlCalibration!=nullptr;
3522 ret.interfaces["iControlLimits"] = m_allInterfaces.iControlLimits!=nullptr;
3523 ret.interfaces["iControlMode"] = m_allInterfaces.iControlMode!=nullptr;
3524 ret.interfaces["iCurrentControl"] = m_allInterfaces.iCurrentControl!=nullptr;
3525 ret.interfaces["iEncodersTimed"] = m_allInterfaces.iEncodersTimed!=nullptr;
3526 ret.interfaces["iImpedanceControl"] = m_allInterfaces.iImpedanceControl!=nullptr;
3527 ret.interfaces["iInteractionMode"] = m_allInterfaces.iInteractionMode!=nullptr;
3528 ret.interfaces["iJointBrake"] = m_allInterfaces.iJointBrake!=nullptr;
3529 ret.interfaces["iJointFault"] = m_allInterfaces.iJointFault!=nullptr;
3530 ret.interfaces["iMotor"] = m_allInterfaces.iMotor!=nullptr;
3531 ret.interfaces["iMotorEncoders"] = m_allInterfaces.iMotorEncoders!=nullptr;
3532 ret.interfaces["iPidControl"] = m_allInterfaces.iPidControl!=nullptr;
3533 ret.interfaces["iPositionControl"] = m_allInterfaces.iPositionControl!=nullptr;
3534 ret.interfaces["iPositionDirect"] = m_allInterfaces.iPositionDirect!=nullptr;
3535 ret.interfaces["iPreciselyTimed"] = m_allInterfaces.iPreciselyTimed!=nullptr;
3536 ret.interfaces["iPWMControl"] = m_allInterfaces.iPWMControl!=nullptr;
3537 ret.interfaces["iRemoteCalibrator"] = m_allInterfaces.iRemoteCalibrator!=nullptr;
3538 ret.interfaces["iRemoteVariables"] = m_allInterfaces.iRemoteVariables!=nullptr;
3539 ret.interfaces["iTorqueControl"] = m_allInterfaces.iTorqueControl!=nullptr;
3540 ret.interfaces["iVelocityControl"] = m_allInterfaces.iVelocityControl!=nullptr;
3541 ret.interfaces["iVelocityDirect"] = m_allInterfaces.iVelocityDirect!=nullptr;
3542 return ret;
3543}
#define LOCKMUTEXSERVER
#define ReturnValue_ok
Definition ReturnValue.h:82
#define ReturnValue_error_not_implemented_by_device
Definition ReturnValue.h:84
yarp::dev::ReturnValue setRemoteVariableRPC(const std::string &key, const yarp::os::Bottle &val) override
yarp::dev::ReturnValue setControlModeAllRPC(const std::vector< yarp::dev::SelectableControlModeEnum > &modes) override
yarp::dev::ReturnValue velocityMoveAllRPC(const std::vector< double > &refs) override
yarp::dev::ReturnValue resetMotorEncodersRPC() override
yarp::dev::ReturnValue parkRPC(const bool wait) override
return_getJointType getJointTypeRPC(const std::int32_t j) override
yarp::dev::ReturnValue setTrajSpeedOneRPC(const std::int32_t j, const double sp) override
return_getRefVelocityAll getRefVelocityAllRPC() const override
return_getTorqueRangeOne getTorqueRangeOneRPC(const std::int32_t j) const override
yarp::dev::ReturnValue setEncoderOneRPC(const std::int32_t j, const double val) override
return_getNominalCurrent getNominalCurrentRPC(const std::int32_t m) const override
yarp::dev::ReturnValue setInteractionModesGroupRPC(const std::vector< std::int32_t > &joints, const std::vector< yarp::dev::InteractionModeEnum > &modes) override
yarp::dev::ReturnValue setRefPositionAllRPC(const std::vector< double > &refs) override
return_getRefPositionAll getRefPositionAllRPC() const override
yarp::dev::ReturnValue setPidErrorLimitRPC(const yarp::dev::PidControlTypeEnum pidtype, const std::int16_t j, const double limit) override
yarp::dev::ReturnValue setPidReferenceRPC(const yarp::dev::PidControlTypeEnum pidtype, const std::int16_t j, const double ref) override
yarp::dev::ReturnValue setRefVelocityGroupRPC(const std::vector< std::int32_t > &j, const std::vector< double > &vel) override
yarp::dev::ReturnValue setRefTorqueAllRPC(const std::vector< double > &vel) override
yarp::dev::ReturnValue setTemperatureLimitRPC(const std::int32_t m, const double val) override
return_getInteractionModeGroup getInteractionModesGroupRPC(const std::vector< std::int32_t > &joints) const override
return_getMotorEncoderOne getMotorEncoderOneRPC(const std::int32_t j) const override
yarp::dev::ReturnValue setPeakCurrentRPC(const std::int32_t m, const double val) override
return_getPid getPidRPC(const yarp::dev::PidControlTypeEnum pidtype, const std::int16_t j) const override
return_getAvailableControlModes getAvailableControlModesRPC(const std::int16_t j) const override
yarp::dev::ReturnValue setRefTorqueGroupRPC(const std::vector< std::int32_t > &j, const std::vector< double > &vel) override
yarp::dev::ReturnValue calibrateAxisWithParamsRPC(const std::int32_t j, const std::int32_t ui, const double v1, const double v2, const double v3) override
return_isPidEnabled isPidEnabledRPC(const yarp::dev::PidControlTypeEnum pidtype, const std::int16_t j) const override
yarp::dev::ReturnValue resetEncoderOneRPC(const std::int32_t j) override
return_getAxes getAxesRPC() const override
yarp::dev::ReturnValue setTrajAccelerationsGroupRPC(const std::vector< std::int32_t > &joints, const std::vector< double > &accs) override
yarp::dev::ReturnValue setRefVelocityOneRPC(const std::int32_t j, const double vel) override
yarp::dev::ReturnValue abortCalibrationRPC() override
yarp::dev::ReturnValue setMotorEncoderRPC(const std::int32_t j, const double val) override
yarp::dev::ReturnValue setPidErrorLimitsRPC(const yarp::dev::PidControlTypeEnum pidtype, const std::vector< double > &limits) override
yarp::dev::ReturnValue setPidRPC(const yarp::dev::PidControlTypeEnum pidtype, const std::int16_t j, const yarp::dev::Pid &pid) override
yarp::dev::ReturnValue setControlModeGroupRPC(const std::vector< std::int32_t > &j, const std::vector< yarp::dev::SelectableControlModeEnum > &modes) override
yarp::dev::ReturnValue parkWholePartRPC() override
return_getMotorEncoderSpeedAll getMotorEncoderSpeedAllRPC() const override
return_getTrajAccelerationOne getTrajAccelerationOneRPC(const std::int32_t j) const override
return_getMotorEncoderAccelerationAll getMotorEncoderAccelerationAllRPC() const override
return_getTrajSpeedsGroup getTrajSpeedsGroupRPC(const std::vector< std::int32_t > &joints) const override
yarp::dev::ReturnValue velocityMoveGroupRPC(const std::vector< std::int32_t > &joints, const std::vector< double > &refs) override
return_getDeviceInterfaces getDeviceInterfacesRPC() const override
yarp::dev::ReturnValue positionMoveOneRPC(const std::int32_t j, const double ref) override
return_getRefPositionOne getRefPositionOneRPC(const std::int32_t j) const override
return_getPidExtraInfo getPidExtraInfoRPC(const yarp::dev::PidControlTypeEnum pidtype, const std::int16_t j) const override
return_getEncoderSpeedOne getEncoderSpeedOneRPC(const std::int32_t j) const override
return_getRemoteVariable getRemoteVariableRPC(const std::string &key) const override
yarp::dev::ReturnValue calibrateWholePartRPC() override
yarp::dev::ReturnValue positionMoveGroupRPC(const std::vector< std::int32_t > &joints, const std::vector< double > &refs) override
return_getRefDutyCycleAll getRefDutyCycleAllRPC() const override
yarp::dev::ReturnValue setMotorEncodersAllRPC(const std::vector< double > &vals) override
return_checkMotionDoneOne checkMotionDoneOneRPC(const std::int32_t j) const override
return_getEncoderTimedOne getEncoderTimedOneRPC(const std::int32_t j) const override
yarp::dev::ReturnValue disableAmpRPC(const std::int32_t j) override
yarp::dev::ReturnValue setPWMLimitRPC(const std::int32_t m, const double val) override
return_getMotorEncoderAccelerationOne getMotorEncoderAccelerationOneRPC(const std::int32_t j) const override
yarp::dev::ReturnValue setRefCurrentAllRPC(const std::vector< double > &refs) override
return_getEncoderAccelerationOne getEncoderAccelerationOneRPC(const std::int32_t j) const override
return_getRefTorqueAll getRefTorqueAllRPC() const override
return_getVelLimits getVelLimitsRPC(const std::int16_t j) const override
yarp::dev::ReturnValue setImpedanceRPC(const std::int32_t j, const double stiffness, const double damping) override
yarp::dev::ReturnValue calibrateSingleJointRPC(const std::int32_t j) override
return_getTrajAccelerationGroup getTrajAccelerationGroupRPC(const std::vector< std::int32_t > &joints) const override
return_getTrajSpeedOne getTrajSpeedOneRPC(const std::int32_t j) const override
return_getPidErrors getPidErrorsRPC(const yarp::dev::PidControlTypeEnum pidtype) const override
return_getRefDutyCycleOne getRefDutyCycleOneRPC(const std::int32_t j) const override
return_getTrajAccelerationAll getTrajAccelerationAllRPC() const override
yarp::dev::ReturnValue resetPidRPC(const yarp::dev::PidControlTypeEnum pidtype, const std::int16_t j) override
return_getMotorTorqueParams getMotorTorqueParamsRPC(const std::int32_t j) override
yarp::dev::ReturnValue setTrajAccelerationOneRPC(const std::int32_t j, const double acc) override
return_getPidErrorLimit getPidErrorLimitRPC(const yarp::dev::PidControlTypeEnum pidtype, const std::int16_t j) const override
return_getRemoteVariablesList getRemoteVariablesListRPC() const override
return_getImpedance getImpedanceRPC(const std::int32_t j) const override
return_getMotorEncoderAll getMotorEncoderAllRPC() const override
return_getTargetPositionAll getTargetPositionAllRPC() const override
return_getMaxCurrent getMaxCurrentRPC(const std::int32_t j) const override
yarp::dev::ReturnValue setRefPositionGroupRPC(const std::vector< std::int32_t > &joints, const std::vector< double > &refs) override
return_getTemperatureOne getTemperatureOneRPC(const std::int32_t m) const override
yarp::dev::ReturnValue stopAllRPC() override
return_getPidReference getPidReferenceRPC(const yarp::dev::PidControlTypeEnum pidtype, const std::int16_t j) const override
yarp::dev::ReturnValue positionMoveAllRPC(const std::vector< double > &refs) override
return_getTorqueRangeAll getTorqueRangeAllRPC() const override
return_getMotorEncoderCountsPerRevolution getMotorEncoderCountsPerRevolutionRPC(const std::int32_t m) const override
yarp::dev::ReturnValue setRefCurrentOneRPC(const std::int32_t j, const double ref) override
return_getGearboxRatio getGearboxRatioRPC(const std::int32_t m) const override
yarp::dev::ReturnValue setPidFeedforwardOneRPC(const yarp::dev::PidControlTypeEnum pidtype, const std::int16_t j, const double value) override
yarp::dev::ReturnValue setRefPositionOneRPC(const std::int32_t j, double ref) override
return_getAmpStatusAll getAmpStatusAllRPC() const override
yarp::dev::ReturnValue parkSingleJointRPC(const std::int32_t j, const bool wait) override
return_getAmpStatusOne getAmpStatusOneRPC(const std::int32_t j) const override
yarp::dev::ReturnValue quitCalibrateRPC() override
return_getImpedanceOffset getImpedanceOffsetRPC(const std::int32_t j) const override
return_getRefCurrentAll getRefCurrentAllRPC() const override
yarp::dev::ReturnValue setManualBrakeActiveRPC(const std::int32_t j, const bool active) override
yarp::dev::ReturnValue resetEncoderAllRPC() override
yarp::dev::ReturnValue homingSingleJointRPC(const std::int32_t j) override
return_getTargetVelocityGroup getTargetVelocityGroupRPC(const std::vector< std::int32_t > &joints) const override
yarp::dev::ReturnValue setVelLimitsRPC(const std::int16_t j, const double min, const double max) override
return_getNumberOfMotors getNumberOfMotorsRPC() const override
yarp::dev::ReturnValue setTrajSpeedAllRPC(const std::vector< double > &spds) override
return_getAvailablePids getAvailablePidsRPC(const std::int16_t j) const override
yarp::dev::ReturnValue stopOneRPC(const std::int32_t j) override
yarp::dev::ReturnValue relativeMoveAllRPC(const std::vector< double > &deltas) override
return_getPidReferences getPidReferencesRPC(const yarp::dev::PidControlTypeEnum pidtype) const override
return_getEncoderSpeedAll getEncoderSpeedAllRPC() const override
return_getPWMLimit getPWMLimitRPC(const std::int32_t m) const override
yarp::dev::ReturnValue setImpedanceOffsetRPC(const std::int32_t j, const double offset) override
return_getPidOutput getPidOutputRPC(const yarp::dev::PidControlTypeEnum pidtype, const std::int16_t j) const override
yarp::dev::ReturnValue setInteractionModeOneRPC(const std::int32_t axis, const yarp::dev::InteractionModeEnum mode) override
return_getDutyCycleOne getDutyCycleOneRPC(const std::int32_t j) const override
yarp::dev::ReturnValue velocityMoveOneRPC(const std::int32_t j, double ref) override
return_getCurrentRangeAll getCurrentRangeAllRPC() const override
yarp::dev::ReturnValue homingWholePartRPC() override
return_getTargetVelocityAll getTargetVelocityAllRPC() const override
yarp::dev::ReturnValue setRefVelocityAllRPC(const std::vector< double > &vel) override
return_getCurrentAll getCurrentAllRPC() const override
yarp::dev::ReturnValue disablePidRPC(const yarp::dev::PidControlTypeEnum pidtype, const std::int16_t j) override
yarp::dev::ReturnValue setControlModeOneRPC(const std::int32_t j, const yarp::dev::SelectableControlModeEnum mod) override
yarp::dev::ReturnValue calibrateRobotRPC() override
yarp::dev::ReturnValue relativeMoveGroupRPC(const std::vector< std::int32_t > &joints, const std::vector< double > &refs) override
yarp::dev::ReturnValue setRefDutyCycleAllRPC(const std::vector< double > &v) override
yarp::dev::ReturnValue setNominalCurrentRPC(const std::int32_t m, const double val) override
yarp::dev::ReturnValue setMotorTorqueParamsRPC(const std::int32_t j, const yMotorTorqueParameters &params) override
return_getPidOffset getPidOffsetRPC(const yarp::dev::PidControlTypeEnum pidtype, const std::int16_t j) const override
return_getMotorEncoderTimedAll getMotorEncodersTimedAllRPC() const override
return_isCalibratorDevicePresent isCalibratorDevicePresentRPC() const override
return_getPidOutputs getPidOutputsRPC(const yarp::dev::PidControlTypeEnum pidtype) const override
yarp::dev::ReturnValue abortParkRPC() override
return_getTargetPositionOne getTargetPositionOneRPC(const std::int32_t j) const override
return_getRefVelocityGroup getRefVelocityGroupRPC(const std::vector< std::int32_t > &jnts) const override
yarp::dev::ReturnValue quitParkRPC() override
return_getEncoderAccelerationAll getEncoderAccelerationAllRPC() const override
return_checkMotionDoneGroup checkMotionDoneGroupRPC(const std::vector< std::int32_t > &joints) const override
return_getInteractionModeOne getInteractionModeOneRPC(const std::int32_t axis) const override
return_getPowerSupplyVoltage getPowerSupplyVoltageRPC(const std::int32_t m) const override
return_getCurrentOne getCurrentOneRPC(const std::int32_t j) const override
yarp::dev::ReturnValue setTrajSpeedGroupRPC(const std::vector< std::int32_t > &joints, const std::vector< double > &spds) override
return_getTemperatureLimit getTemperatureLimitRPC(const std::int32_t m) const override
yarp::dev::ReturnValue setPosLimitsRPC(const std::int16_t j, const double min, const double max) override
return_getEncoderTimedAll getEncoderTimedAllRPC() const override
yarp::dev::ReturnValue setPidsRPC(const yarp::dev::PidControlTypeEnum pidtype, const std::vector< yarp::dev::Pid > &pids) override
return_getCurrentImpedanceLimit getCurrentImpedanceLimitRPC(const std::int32_t j) const override
yarp::dev::ReturnValue setRefTorqueOneRPC(const std::int32_t j, const double vel) override
return_getTargetVelocityOne getTargetVelocityOneRPC(const std::int32_t j) const override
return_getTrajSpeedsAll getTrajSpeedsAllRPC() const override
return_getPids getPidsRPC(const yarp::dev::PidControlTypeEnum pidtype) const override
return_getRefTorqueGroup getRefTorqueGroupRPC(const std::vector< std::int32_t > &j) const override
yarp::dev::ReturnValue setMaxCurrentRPC(const std::int32_t j, const double v) override
return_getPidExtraInfos getPidExtraInfosRPC(const yarp::dev::PidControlTypeEnum pidtypeo) const override
return_getEncoderAll getEncoderAllRPC() const override
return_getCurrentRangeOne getCurrentRangeOneRPC(const std::int32_t j) const override
return_getNumberOfMotorEncoders getNumberOfMotorEncodersRPC() const override
return_getPWM getPWMRPC(const std::int32_t m) const override
return_getRefTorqueOne getRefTorqueOneRPC(const std::int32_t j) const override
return_getPosLimits getPosLimitsRPC(const std::int16_t j) const override
return_getAxisName getAxisNameRPC(const std::int32_t j) override
return_getTemperatureAll getTemperatureAllRPC() const override
return_getTargetPositionGroup getTargetPositionGroupRPC(const std::vector< std::int32_t > &joints) const override
return_getInteractionModeAll getInteractionModesAllRPC() const override
yarp::dev::ReturnValue setRefDutyCycleOneRPC(const std::int32_t j, const double v) override
return_getRefVelocityOne getRefVelocityOneRPC(const std::int32_t j) const override
return_getPidFeedforward getPidFeedforwardRPC(const yarp::dev::PidControlTypeEnum pidtype, const std::int16_t j) const override
yarp::dev::ReturnValue setAutoBrakeEnabledRPC(const std::int32_t j, const bool enabled) override
yarp::dev::ReturnValue resetMotorEncoderRPC(const std::int32_t j) override
return_getPidErrorLimits getPidErrorLimitsRPC(const yarp::dev::PidControlTypeEnum pidtype) const override
yarp::dev::ReturnValue relativeMoveOneRPC(const std::int32_t j, const double delta) override
yarp::dev::ReturnValue enableAmpRPC(const std::int32_t j) override
yarp::dev::ReturnValue setRefCurrentGroupRPC(const std::vector< std::int32_t > &j, const std::vector< double > &refs) override
yarp::dev::ReturnValue setInteractionModesAllRPC(const std::vector< yarp::dev::InteractionModeEnum > &modes) override
return_getRefPositionGroup getRefPositionGroupRPC(const std::vector< std::int32_t > &j) const override
yarp::dev::ReturnValue setTrajAccelerationsAllRPC(const std::vector< double > &accs) override
yarp::dev::ReturnValue setMotorEncoderCountsPerRevolutionRPC(const std::int32_t j, const double val) override
yarp::dev::ReturnValue setPidReferencesRPC(const yarp::dev::PidControlTypeEnum pidtype, const std::vector< double > &refs) override
yarp::dev::ReturnValue calibrationDoneRPC(const std::int32_t j) override
yarp::dev::ReturnValue enablePidRPC(const yarp::dev::PidControlTypeEnum pidtype, const std::int16_t j) override
return_isJointBraked isJointBrakedRPC(const std::int32_t j) const override
yarp::dev::ReturnValue setCalibrationParametersRPC(const std::int32_t j, const yCalibrationParameters &params) override
return_getAutoBrakeEnabled getAutoBrakeEnabledRPC(const std::int32_t j) const override
return_getLastJointFault getLastJointFaultRPC(const std::int32_t j) const override
return_getMotorEncoderSpeedOne getMotorEncoderSpeedOneRPC(const std::int32_t j) const override
yarp::dev::ReturnValue setPidOffsetOneRPC(const yarp::dev::PidControlTypeEnum pidtype, const std::int16_t j, const double value) override
return_getPeakCurrent getPeakCurrentRPC(const std::int32_t m) const override
return_getMotorEncoderTimedOne getMotorEncoderTimedOneRPC(const std::int32_t j) const override
yarp::dev::ReturnValue setGearboxRatioRPC(const std::int32_t m, const double val) override
return_getDutyCycleAll getDutyCycleAllRPC() const override
yarp::dev::ReturnValue setEncoderAllRPC(const std::vector< double > &vals) override
return_getRefCurrentOne getRefCurrentOneRPC(const std::int32_t j) const override
return_checkMotionDoneAll checkMotionDoneAllRPC() const override
yarp::dev::ReturnValue stopGroupRPC(const std::vector< std::int32_t > &joints) override
return_getEncoderOne getEncoderOneRPC(const std::int32_t j) const override
return_getPidError getPidErrorRPC(const yarp::dev::PidControlTypeEnum pidtype, const std::int16_t j) const override
std::map< std::string, bool > interfaces
virtual yarp::dev::ReturnValue setPWMLimit(int j, const double val)=0
virtual yarp::dev::ReturnValue setNominalCurrent(int m, const double val)=0
virtual yarp::dev::ReturnValue getPeakCurrent(int m, double *val)=0
virtual yarp::dev::ReturnValue disableAmp(int j)=0
Disable the amplifier on a specific joint.
virtual yarp::dev::ReturnValue getPWMLimit(int j, double *val)=0
virtual yarp::dev::ReturnValue setPeakCurrent(int m, const double val)=0
virtual yarp::dev::ReturnValue getMaxCurrent(int j, double *v)=0
Returns the maximum electric current allowed for a given motor.
virtual yarp::dev::ReturnValue getPWM(int j, double *val)=0
virtual yarp::dev::ReturnValue getAmpStatus(int *st)=0
virtual yarp::dev::ReturnValue setMaxCurrent(int j, double v)=0
virtual yarp::dev::ReturnValue getNominalCurrent(int m, double *val)=0
virtual yarp::dev::ReturnValue enableAmp(int j)=0
Enable the amplifier on a specific joint.
virtual yarp::dev::ReturnValue getPowerSupplyVoltage(int j, double *val)=0
virtual yarp::dev::ReturnValue getAxes(size_t &ax)=0
Get the number of controlled axes.
virtual yarp::dev::ReturnValue getJointType(int axis, yarp::dev::JointTypeEnum &type)
Definition IAxisInfo.h:64
virtual yarp::dev::ReturnValue getAxisName(int axis, std::string &name)=0
virtual yarp::dev::ReturnValue calibrationDone(int j)=0
Check if the calibration is terminated, on a particular joint.
virtual yarp::dev::ReturnValue abortPark()
virtual yarp::dev::ReturnValue calibrateAxisWithParams(int axis, unsigned int type, double p1, double p2, double p3)=0
Start calibration, this method is very often platform specific.
virtual yarp::dev::ReturnValue calibrateRobot()
Calibrate robot by using an external calibrator.
virtual yarp::dev::ReturnValue abortCalibration()
virtual yarp::dev::ReturnValue setCalibrationParameters(int axis, const CalibrationParameters &params)=0
Start calibration, this method is very often platform specific.
virtual yarp::dev::ReturnValue park(bool wait=true)
virtual yarp::dev::ReturnValue setPosLimits(int axis, double min, double max)=0
Set the software limits for a particular axis, the behavior of the control card when these limits are...
virtual yarp::dev::ReturnValue getVelLimits(int axis, double *min, double *max)=0
Get the software speed limits for a particular axis.
virtual yarp::dev::ReturnValue getPosLimits(int axis, double *min, double *max)=0
Get the software limits for a particular axis.
virtual yarp::dev::ReturnValue setVelLimits(int axis, double min, double max)=0
Set the software speed limits for a particular axis, the behavior of the control card when these limi...
virtual yarp::dev::ReturnValue setControlModes(const std::vector< int > &joints, const std::vector< yarp::dev::SelectableControlModeEnum > &mode)=0
Set the current control mode for a subset of axes.
virtual yarp::dev::ReturnValue setControlMode(int j, yarp::dev::SelectableControlModeEnum mode)=0
Set the current control mode.
virtual yarp::dev::ReturnValue getAvailableControlModes(int j, std::vector< yarp::dev::SelectableControlModeEnum > &avail)=0
Return a list of available control mode for the given joint.
virtual yarp::dev::ReturnValue setRefCurrent(int m, double curr)=0
Set the reference value of the current for a single motor.
virtual yarp::dev::ReturnValue setRefCurrents(const double *currs)=0
Set the reference value of the currents for all motors.
virtual yarp::dev::ReturnValue getCurrent(int m, double *curr)=0
Get the instantaneous current measurement for a single motor.
virtual yarp::dev::ReturnValue getCurrentRange(int m, double *min, double *max)=0
Get the full scale of the current measurement for a given motor (e.g.
virtual yarp::dev::ReturnValue getCurrentRanges(double *min, double *max)=0
Get the full scale of the current measurements for all motors motor (e.g.
virtual yarp::dev::ReturnValue getRefCurrent(int m, double *curr)=0
Get the reference value of the current for a single motor.
virtual yarp::dev::ReturnValue getRefCurrents(double *currs)=0
Get the reference value of the currents for all motors.
virtual yarp::dev::ReturnValue getCurrents(double *currs)=0
Get the instantaneous current measurement for all motors.
virtual yarp::dev::ReturnValue getEncoderTimed(int j, double *encs, double *time)=0
Read the instantaneous acceleration of all axes.
virtual yarp::dev::ReturnValue getEncodersTimed(double *encs, double *time)=0
Read the instantaneous acceleration of all axes.
virtual yarp::dev::ReturnValue getEncoderAcceleration(int j, double *spds)=0
Read the instantaneous acceleration of an axis.
virtual yarp::dev::ReturnValue getEncoderAccelerations(double *accs)=0
Read the instantaneous acceleration of all axes.
virtual yarp::dev::ReturnValue getEncoderSpeeds(double *spds)=0
Read the instantaneous speed of all axes.
virtual yarp::dev::ReturnValue getEncoders(double *encs)=0
Read the position of all axes.
virtual yarp::dev::ReturnValue setEncoders(const double *vals)=0
Set the value of all encoders.
virtual yarp::dev::ReturnValue getEncoderSpeed(int j, double *sp)=0
Read the istantaneous speed of an axis.
virtual yarp::dev::ReturnValue getEncoder(int j, double *v)=0
Read the value of an encoder.
virtual yarp::dev::ReturnValue resetEncoder(int j)=0
Reset encoder, single joint.
virtual yarp::dev::ReturnValue resetEncoders()=0
Reset encoders.
virtual yarp::dev::ReturnValue setEncoder(int j, double val)=0
Set the value of the encoder for a given joint.
virtual yarp::dev::ReturnValue getCurrentImpedanceLimit(int j, double *min_stiff, double *max_stiff, double *min_damp, double *max_damp)=0
Get the current impedance limits for a specific joint.
virtual yarp::dev::ReturnValue getImpedance(int j, double *stiffness, double *damping)=0
Get current impedance gains (stiffness,damping,offset) for a specific joint.
virtual yarp::dev::ReturnValue getImpedanceOffset(int j, double *offset)=0
Get current force Offset for a specific joint.
virtual yarp::dev::ReturnValue setImpedanceOffset(int j, double offset)=0
Set current force Offset for a specific joint.
virtual yarp::dev::ReturnValue setImpedance(int j, double stiffness, double damping)=0
Set current impedance gains (stiffness,damping) for a specific joint.
virtual yarp::dev::ReturnValue setInteractionModes(const std::vector< int > &joints, const std::vector< yarp::dev::InteractionModeEnum > &modes)=0
Set the interaction mode of the robot for a set of joints, values can be stiff or compliant.
virtual yarp::dev::ReturnValue getInteractionMode(int axis, yarp::dev::InteractionModeEnum &mode)=0
Get the current interaction mode of the robot, values can be stiff or compliant.
virtual yarp::dev::ReturnValue setInteractionMode(int axis, yarp::dev::InteractionModeEnum mode)=0
Set the interaction mode of the robot, values can be stiff or compliant.
virtual yarp::dev::ReturnValue getInteractionModes(const std::vector< int > &joints, std::vector< yarp::dev::InteractionModeEnum > &modes)=0
Get the current interaction mode of the robot for a set of joints, values can be stiff or compliant.
virtual yarp::dev::ReturnValue setAutoBrakeEnabled(int j, bool enabled)=0
Enables/Disables the automatic joint brake.
virtual yarp::dev::ReturnValue isJointBraked(int j, bool &braked) const =0
Check is the joint brake is currently active.
virtual yarp::dev::ReturnValue getAutoBrakeEnabled(int j, bool &enabled) const =0
checks if the automatic joint brake mode is enabled or disabled.
virtual yarp::dev::ReturnValue setManualBrakeActive(int j, bool active)=0
Enables/Disables manually the joint brake.
virtual yarp::dev::ReturnValue getLastJointFault(int j, int &fault, std::string &message)=0
virtual yarp::dev::ReturnValue getMotorEncoderSpeed(int m, double *sp)=0
Read the instantaneous speed of a motor encoder.
virtual yarp::dev::ReturnValue getNumberOfMotorEncoders(int *num)=0
Get the number of available motor encoders.
virtual yarp::dev::ReturnValue getMotorEncoders(double *encs)=0
Read the position of all motor encoders.
virtual yarp::dev::ReturnValue resetMotorEncoders()=0
Reset motor encoders.
virtual yarp::dev::ReturnValue getMotorEncoderAcceleration(int m, double *acc)=0
Read the instantaneous acceleration of a motor encoder.
virtual yarp::dev::ReturnValue setMotorEncoder(int m, const double val)=0
Set the value of the motor encoder for a given motor.
virtual yarp::dev::ReturnValue getMotorEncoderSpeeds(double *spds)=0
Read the instantaneous speed of all motor encoders.
virtual yarp::dev::ReturnValue getMotorEncoderCountsPerRevolution(int m, double *cpr)=0
Gets number of counts per revolution for motor encoder m.
virtual yarp::dev::ReturnValue resetMotorEncoder(int m)=0
Reset motor encoder, single motor.
virtual yarp::dev::ReturnValue setMotorEncoderCountsPerRevolution(int m, const double cpr)=0
Sets number of counts per revolution for motor encoder m.
virtual yarp::dev::ReturnValue getMotorEncoderAccelerations(double *accs)=0
Read the instantaneous acceleration of all motor encoders.
virtual yarp::dev::ReturnValue setMotorEncoders(const double *vals)=0
Set the value of all motor encoders.
virtual yarp::dev::ReturnValue getMotorEncodersTimed(double *encs, double *time)=0
Read the instantaneous position of all motor encoders.
virtual yarp::dev::ReturnValue getMotorEncoder(int m, double *v)=0
Read the value of a motor encoder.
virtual yarp::dev::ReturnValue getMotorEncoderTimed(int m, double *encs, double *time)=0
Read the instantaneous position of a motor encoder.
virtual yarp::dev::ReturnValue getTemperatureLimit(int m, double *temp)=0
Retrieves the current temperature limit for a specific motor.
virtual yarp::dev::ReturnValue setGearboxRatio(int m, const double val)=0
Set the gearbox ratio for a specific motor.
virtual yarp::dev::ReturnValue getTemperature(int m, double *val)=0
Get temperature of a motor.
virtual yarp::dev::ReturnValue getGearboxRatio(int m, double *val)=0
Get the gearbox ratio for a specific motor.
virtual yarp::dev::ReturnValue getNumberOfMotors(int *num)=0
Get the number of available motors.
virtual yarp::dev::ReturnValue setTemperatureLimit(int m, const double temp)=0
Set the temperature limit for a specific motor.
virtual yarp::dev::ReturnValue getTemperatures(double *vals)=0
Get temperature of all the motors.
virtual yarp::dev::ReturnValue getRefDutyCycles(double *refs)=0
Gets the last reference sent using the setRefDutyCycles function.
virtual yarp::dev::ReturnValue getDutyCycle(int m, double *val)=0
Gets the current dutycycle of the output of the amplifier (i.e.
virtual yarp::dev::ReturnValue setRefDutyCycles(const double *refs)=0
Sets the reference dutycycle for all the motors.
virtual yarp::dev::ReturnValue setRefDutyCycle(int m, double ref)=0
Sets the reference dutycycle to a single motor.
virtual yarp::dev::ReturnValue getDutyCycles(double *vals)=0
Gets the current dutycycle of the output of the amplifier (i.e.
virtual yarp::dev::ReturnValue getRefDutyCycle(int m, double *ref)=0
Gets the last reference sent using the setRefDutyCycle function.
virtual yarp::dev::ReturnValue disablePid(const PidControlTypeEnum &pidtype, int j)=0
Disable the PID computation for a joint.
virtual yarp::dev::ReturnValue getPidErrorLimit(const PidControlTypeEnum &pidtype, int j, double *limit)=0
Get the error limit for the controller on a specific joint.
virtual yarp::dev::ReturnValue getPidErrorLimits(const PidControlTypeEnum &pidtype, double *limits)=0
Get the error limit for all controllers.
virtual yarp::dev::ReturnValue setPids(const PidControlTypeEnum &pidtype, const Pid *pids)=0
Set new PID value on multiple axes.
virtual yarp::dev::ReturnValue setPidErrorLimits(const PidControlTypeEnum &pidtype, const double *limits)=0
Get the error limit for the controller on all joints.
virtual yarp::dev::ReturnValue getPidErrors(const PidControlTypeEnum &pidtype, double *errs)=0
Get the error of all joints.
virtual yarp::dev::ReturnValue getPidOutput(const PidControlTypeEnum &pidtype, int j, double *out)=0
Get the output of the controller (e.g.
virtual yarp::dev::ReturnValue getPidFeedforward(const PidControlTypeEnum &pidtype, int j, double &v)=0
Get the currently set feedforward value for the specified PID controller.
virtual yarp::dev::ReturnValue getPidOffset(const PidControlTypeEnum &pidtype, int j, double &v)=0
Get the currently set offset value for the specified PID controller.
virtual yarp::dev::ReturnValue getPidExtraInfos(const PidControlTypeEnum &pidtype, std::vector< yarp::dev::PidExtraInfo > &info)=0
Get PID extra info and measurement units for a specific joint.
virtual yarp::dev::ReturnValue isPidEnabled(const PidControlTypeEnum &pidtype, int j, bool &enabled)=0
Get the current status (enabled/disabled) of the PID.
virtual yarp::dev::ReturnValue resetPid(const PidControlTypeEnum &pidtype, int j)=0
Reset the controller of a given joint, usually sets the current status of the joint as the reference ...
virtual yarp::dev::ReturnValue getAvailablePids(int j, std::vector< PidControlTypeEnum > &avail)=0
Return a list of available pid types mode for the given joint.
virtual yarp::dev::ReturnValue getPids(const PidControlTypeEnum &pidtype, Pid *pids)=0
Get current PID value for a specific joint.
virtual yarp::dev::ReturnValue getPidExtraInfo(const PidControlTypeEnum &pidtype, int j, yarp::dev::PidExtraInfo &info)=0
Get PID extra info and measurement units for a specific joint.
virtual yarp::dev::ReturnValue setPidReferences(const PidControlTypeEnum &pidtype, const double *refs)=0
Set the controller reference, multiple axes.
virtual yarp::dev::ReturnValue setPidReference(const PidControlTypeEnum &pidtype, int j, double ref)=0
Set the controller reference for a given axis.
virtual yarp::dev::ReturnValue setPidErrorLimit(const PidControlTypeEnum &pidtype, int j, double limit)=0
Set the error limit for the controller on a specific joint.
virtual yarp::dev::ReturnValue setPid(const PidControlTypeEnum &pidtype, int j, const Pid &pid)=0
Set new PID value for a joint axis.
virtual yarp::dev::ReturnValue getPidError(const PidControlTypeEnum &pidtype, int j, double *err)=0
Get the current error for a joint.
virtual yarp::dev::ReturnValue getPidReferences(const PidControlTypeEnum &pidtype, double *refs)=0
Get the current reference of all PID controllers.
virtual yarp::dev::ReturnValue setPidFeedforward(const PidControlTypeEnum &pidtype, int j, double v)=0
Set the feedforward value for the specified PID controller.
virtual yarp::dev::ReturnValue enablePid(const PidControlTypeEnum &pidtype, int j)=0
Enable the PID computation for a joint.
virtual yarp::dev::ReturnValue getPidReference(const PidControlTypeEnum &pidtype, int j, double *ref)=0
Get the current reference of the PID controller for a specific joint.
virtual yarp::dev::ReturnValue getPid(const PidControlTypeEnum &pidtype, int j, Pid *pid)=0
Get current PID value for a specific joint.
virtual yarp::dev::ReturnValue setPidOffset(const PidControlTypeEnum &pidtype, int j, double v)=0
Set an offset value for a given controller.
virtual yarp::dev::ReturnValue getPidOutputs(const PidControlTypeEnum &pidtype, double *outs)=0
Get the output of the controllers (e.g.
virtual yarp::dev::ReturnValue getTargetPosition(const int joint, double *ref)=0
Get the last position reference for the specified axis.
virtual yarp::dev::ReturnValue setTrajSpeed(int j, double sp)=0
Set reference speed for a joint, this is the speed used during the interpolation of the trajectory.
virtual yarp::dev::ReturnValue getTargetPositions(double *refs)=0
Get the last position reference for all axes.
virtual yarp::dev::ReturnValue setTrajAcceleration(int j, double acc)=0
Set reference acceleration for a joint.
virtual yarp::dev::ReturnValue relativeMove(int j, double delta)=0
Set relative position.
virtual yarp::dev::ReturnValue getTrajSpeeds(double *spds)=0
Get reference speed of all joints.
virtual yarp::dev::ReturnValue setTrajSpeeds(const double *spds)=0
Set reference speed on all joints.
virtual yarp::dev::ReturnValue positionMove(int j, double ref)=0
Set new reference point for a single axis.
virtual yarp::dev::ReturnValue getTrajAccelerations(double *accs)=0
Get reference acceleration of all joints.
virtual yarp::dev::ReturnValue checkMotionDone(int j, bool &flag)=0
Check if the current trajectory is terminated.
virtual yarp::dev::ReturnValue getTrajSpeed(int j, double *ref)=0
Get reference speed for a joint.
virtual yarp::dev::ReturnValue setTrajAccelerations(const double *accs)=0
Set reference acceleration on all joints.
virtual yarp::dev::ReturnValue stop(int j)=0
Stop motion, single joint.
virtual yarp::dev::ReturnValue getTrajAcceleration(int j, double *acc)=0
Get reference acceleration for a joint.
virtual yarp::dev::ReturnValue getRefPosition(const int joint, double *ref)=0
Get the last position reference for the specified axis.
virtual yarp::dev::ReturnValue setPositions(const int n_joint, const int *joints, const double *refs)=0
Set new reference point for all axes.
virtual yarp::dev::ReturnValue setPosition(int j, double ref)=0
Set new position for a single axis.
virtual yarp::dev::ReturnValue getRefPositions(double *refs)=0
Get the last position reference for all axes.
virtual yarp::dev::ReturnValue calibrateWholePart()=0
calibrateWholePart: call the procedure for calibrating the whole device
virtual yarp::dev::ReturnValue homingWholePart()=0
homingWholePart: call the homing procedure for a the whole part/device
virtual yarp::dev::ReturnValue parkWholePart()=0
parkWholePart: start the parking procedure for the whole part
virtual yarp::dev::ReturnValue calibrateSingleJoint(int j)=0
calibrateSingleJoint: call the calibration procedure for the single joint
virtual yarp::dev::ReturnValue isCalibratorDevicePresent(bool *isCalib)
isCalibratorDevicePresent: check if a calibrator device has been set
virtual yarp::dev::ReturnValue homingSingleJoint(int j)=0
homingSingleJoint: call the homing procedure for a single joint
virtual yarp::dev::ReturnValue parkSingleJoint(int j, bool _wait=true)=0
parkSingleJoint(): start the parking procedure for the single joint
virtual yarp::dev::ReturnValue quitCalibrate()=0
quitCalibrate: interrupt the calibration procedure
virtual yarp::dev::ReturnValue quitPark()=0
quitPark: interrupt the park procedure
virtual yarp::dev::ReturnValue getRemoteVariablesList(yarp::os::Bottle *listOfKeys)=0
virtual yarp::dev::ReturnValue getRemoteVariable(std::string key, yarp::os::Bottle &val)=0
virtual yarp::dev::ReturnValue setRemoteVariable(std::string key, const yarp::os::Bottle &val)=0
virtual yarp::dev::ReturnValue getMotorTorqueParams(int j, yarp::dev::MotorTorqueParameters *params)=0
Get a subset of motor parameters (bemf, ktau etc) useful for torque control.
virtual yarp::dev::ReturnValue getTorqueRanges(double *min, double *max)=0
Get the full scale of the torque sensors of all joints.
virtual yarp::dev::ReturnValue getTorqueRange(int j, double *min, double *max)=0
Get the full scale of the torque sensor of a given joint.
virtual yarp::dev::ReturnValue setMotorTorqueParams(int j, const yarp::dev::MotorTorqueParameters params)=0
Set a subset of motor parameters (bemf, ktau etc) useful for torque control.
virtual yarp::dev::ReturnValue getRefTorque(int j, double *t)=0
Get the reference value of the torque for a given joint.
virtual yarp::dev::ReturnValue setRefTorque(int j, double t)=0
Set the reference value of the torque for a given joint.
virtual yarp::dev::ReturnValue setRefTorques(const double *t)=0
Set the reference value of the torque for all joints.
virtual yarp::dev::ReturnValue getRefTorques(double *t)=0
Get the reference value of the torque for all joints.
virtual yarp::dev::ReturnValue getTargetVelocities(double *vels)=0
Get the last reference speed set by velocityMove for all joints.
virtual yarp::dev::ReturnValue getTargetVelocity(const int joint, double *vel)=0
Get the last reference speed set by velocityMove for single joint.
virtual yarp::dev::ReturnValue velocityMove(int j, double sp)=0
Start motion at a given speed, single joint.
virtual yarp::dev::ReturnValue getRefVelocity(const int jnt, double &vel)=0
Get the last reference velocity set by setRefVelocity() for a single joint.
virtual yarp::dev::ReturnValue setRefVelocity(int jnt, double vel)=0
Set the velocity of single joint.
Contains the parameters for a PID.
@ return_value_error_not_ready
Method failed due to invalid internal status/invalid request.
A simple collection of objects that can be described and transmitted in a portable way.
Definition Bottle.h:65
A mini-server for performing network communication in the background.
#define yCError(component,...)
#define YARP_LOG_COMPONENT(name,...)
STL namespace.
For streams capable of holding different kinds of content, check what they actually have.
SelectableControlModeEnum
PidControlTypeEnum
Definition PidEnums.h:15
An interface to the operating system, including Port based communication.
Definition OSTestMsg.cpp:13
yarp::dev::IJointBrake * iJointBrake
yarp::dev::IRemoteCalibrator * iRemoteCalibrator
yarp::dev::IControlMode * iControlMode
yarp::dev::IJointFault * iJointFault
yarp::dev::IPidControl * iPidControl
yarp::dev::IAmplifierControl * iAmplifierControl
yarp::dev::ITorqueControl * iTorqueControl
yarp::dev::IPWMControl * iPWMControl
yarp::dev::IImpedanceControl * iImpedanceControl
yarp::dev::IVelocityDirect * iVelocityDirect
yarp::dev::IVelocityControl * iVelocityControl
yarp::dev::IInteractionMode * iInteractionMode
yarp::dev::IEncodersTimed * iEncodersTimed
yarp::dev::IRemoteVariables * iRemoteVariables
yarp::dev::IControlLimits * iControlLimits
yarp::dev::IAxisInfo * iAxisInfo
yarp::dev::IPositionDirect * iPositionDirect
yarp::dev::ICurrentControl * iCurrentControl
yarp::dev::IPreciselyTimed * iPreciselyTimed
yarp::dev::IMotorEncoders * iMotorEncoders
yarp::dev::IControlCalibration * iControlCalibration
yarp::dev::IMotor * iMotor
yarp::dev::IPositionControl * iPositionControl