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{
52 if (!m_allInterfaces.iControlMode)
53 {
54 yCError(CB_RPC, "Invalid interface");
55 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
56 return ret;
57 }
58
59 ret.ret = m_allInterfaces.iControlMode->getControlMode(j, ret.mode);
60 if (!ret.ret)
61 {
62 yCError(CB_RPC, "getControlMode() failed");
63 }
64 return ret;
65}
66
68{
71 if (!m_allInterfaces.iControlMode)
72 {
73 yCError(CB_RPC, "Invalid interface");
74 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
75 return ret;
76 }
77
78 ret.modes.resize(m_njoints);
79 ret.ret = m_allInterfaces.iControlMode->getControlModes(ret.modes);
80 if (!ret.ret)
81 {
82 yCError(CB_RPC, "getControlModes() failed");
83 }
84 return ret;
85}
86
88{
91 if (!m_allInterfaces.iControlMode)
92 {
93 yCError(CB_RPC, "Invalid interface");
94 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
95 return ret;
96 }
97
98 ret.modes.resize(j.size());
99 ret.ret = m_allInterfaces.iControlMode->getControlModes(j, ret.modes);
100 if (!ret.ret)
101 {
102 yCError(CB_RPC, "getControlModes() failed");
103 }
104 return ret;
105}
106
108{
110 ReturnValue ret;
111 if (!m_allInterfaces.iControlMode) {
112 yCError(CB_RPC, "Invalid interface");
113 ret = ReturnValue::return_code::return_value_error_not_ready;
114 return ret;
115 }
116
117 ret = m_allInterfaces.iControlMode->setControlMode(j, mod);
118 if (!ret) {
119 yCError(CB_RPC, "setControlMode() failed");
120 }
121 return ret;
122}
123
124ReturnValue ControlBoardRPCd::setControlModeAllRPC(const std::vector<yarp::dev::SelectableControlModeEnum>& modes)
125{
127 ReturnValue ret;
128 if (!m_allInterfaces.iControlMode) {
129 yCError(CB_RPC, "Invalid interface");
130 ret = ReturnValue::return_code::return_value_error_not_ready;
131 return ret;
132 }
133
134 ret = m_allInterfaces.iControlMode->setControlModes(modes);
135
136 if (!ret) {
137 yCError(CB_RPC, "setControlModes() failed");
138 }
139 return ret;
140}
141
142ReturnValue ControlBoardRPCd::setControlModeGroupRPC(const std::vector<std::int32_t>& j, const std::vector<yarp::dev::SelectableControlModeEnum>& modes)
143{
145 ReturnValue ret;
146 if (!m_allInterfaces.iControlMode) {
147 yCError(CB_RPC, "Invalid interface");
148 ret = ReturnValue::return_code::return_value_error_not_ready;
149 return ret;
150 }
151
152 ret = m_allInterfaces.iControlMode->setControlModes(j, modes);
153
154 if (!ret) {
155 yCError(CB_RPC, "setControlModes() failed");
156 }
157 return ret;
158}
159
160//--------------------------------------
161// IJointBraked RPC methods
162
164{
167 if (!m_allInterfaces.iJointBrake)
168 {
169 yCError(CB_RPC, "Invalid interface");
170 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
171 return ret;
172 }
173
174 ret.ret = m_allInterfaces.iJointBrake->isJointBraked(j, ret.isBraked);
175 if (!ret.ret)
176 {
177 yCError(CB_RPC, "isJointBraked() failed");
178 }
179 return ret;
180}
181
182ReturnValue ControlBoardRPCd::setManualBrakeActiveRPC(const std::int32_t j, const bool active)
183{
185 ReturnValue ret;
186 if (!m_allInterfaces.iJointBrake) {
187 yCError(CB_RPC, "Invalid interface");
188 ret = ReturnValue::return_code::return_value_error_not_ready;
189 return ret;
190 }
191
192 ret = m_allInterfaces.iJointBrake->setManualBrakeActive(j, active);
193 if (!ret) {
194 yCError(CB_RPC, "setManualBrakeActive() failed");
195 }
196 return ret;
197}
198
199ReturnValue ControlBoardRPCd::setAutoBrakeEnabledRPC(const std::int32_t j, const bool enabled)
200{
202 ReturnValue ret;
203 if (!m_allInterfaces.iJointBrake) {
204 yCError(CB_RPC, "Invalid interface");
205 ret = ReturnValue::return_code::return_value_error_not_ready;
206 return ret;
207 }
208
209 ret = m_allInterfaces.iJointBrake->setAutoBrakeEnabled(j, enabled);
210 if (!ret) {
211 yCError(CB_RPC, "setAutoBrakeEnabled() failed");
212 }
213 return ret;
214}
215
217{
220 if (!m_allInterfaces.iJointBrake) {
221 yCError(CB_RPC, "Invalid interface");
222 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
223 return ret;
224 }
225
226 ret.ret = m_allInterfaces.iJointBrake->getAutoBrakeEnabled(j, ret.enabled);
227 if (!ret.ret) {
228 yCError(CB_RPC, "getAutoBrakeEnabled() failed");
229 }
230 return ret;
231}
232
233//--------------------------------------
234// IVelocityDirect RPC methods
235
237{
240 if (!m_allInterfaces.iVelocityDirect) {
241 yCError(CB_RPC, "Invalid IVelocityDirect interface");
243 return ret;
244 }
245 ret.ret = m_allInterfaces.iVelocityDirect->getRefVelocity(j, ret.vel);
246 if (!ret.ret) {
247 yCError(CB_RPC, "getRefVelocity() failed");
248 }
249 return ret;
250}
251
253{
256 if (!m_allInterfaces.iVelocityDirect) {
257 yCError(CB_RPC, "Invalid IVelocityDirect interface");
259 return ret;
260 }
261 ret.ret = m_allInterfaces.iVelocityDirect->getRefVelocity(ret.vel);
262 if (!ret.ret) {
263 yCError(CB_RPC, "getRefVelocity() failed");
264 }
265 return ret;
266}
267
269{
272 if (!m_allInterfaces.iVelocityDirect) {
273 yCError(CB_RPC, "Invalid IVelocityDirect interface");
275 return ret;
276 }
277 ret.vel.resize(jnts.size());
278 ret.ret = m_allInterfaces.iVelocityDirect->getRefVelocity(jnts, ret.vel);
279 if (!ret.ret) {
280 yCError(CB_RPC, "getRefVelocity() failed");
281 }
282 return ret;
283}
284
285ReturnValue ControlBoardRPCd::setRefVelocityOneRPC(const std::int32_t j, const double vel)
286{
288 ReturnValue ret;
289 if (!m_allInterfaces.iVelocityDirect) {
290 yCError(CB_RPC, "Invalid interface");
291 ret = ReturnValue::return_code::return_value_error_not_ready;
292 return ret;
293 }
294
295 ret = m_allInterfaces.iVelocityDirect->setRefVelocity(j, vel);
296 if (!ret) {
297 yCError(CB_RPC, "setRefVelocity() failed");
298 }
299 return ret;
300}
301
303{
305 ReturnValue ret;
306 if (!m_allInterfaces.iVelocityDirect) {
307 yCError(CB_RPC, "Invalid interface");
308 ret = ReturnValue::return_code::return_value_error_not_ready;
309 return ret;
310 }
311
312 ret = m_allInterfaces.iVelocityDirect->setRefVelocity(vel);
313 if (!ret) {
314 yCError(CB_RPC, "setRefVelocity() failed");
315 }
316 return ret;
317}
318
319ReturnValue ControlBoardRPCd::setRefVelocityGroupRPC(const std::vector<std::int32_t>& j, const std::vector<double>& vel)
320{
322 ReturnValue ret;
323 if (!m_allInterfaces.iVelocityDirect) {
324 yCError(CB_RPC, "Invalid interface");
325 ret = ReturnValue::return_code::return_value_error_not_ready;
326 return ret;
327 }
328
329 ret = m_allInterfaces.iVelocityDirect->setRefVelocity(j, vel);
330 if (!ret) {
331 yCError(CB_RPC, "setRefVelocity() failed");
332 }
333 return ret;
334}
335
337{
339 return_getAxes ret;
340 if (!m_allInterfaces.iAxisInfo) {
341 yCError(CB_RPC, "Invalid iAxisInfo interface");
343 return ret;
344 }
345 size_t axes=0;
346 ret.ret = m_allInterfaces.iAxisInfo->getAxes(axes);
347 if (!ret.ret) {
348 yCError(CB_RPC, "getAxes() failed");
349 }
350 ret.axes = axes;
351 return ret;
352}
353
354//--------------------------------------
355// IPidControl RPC methods
356
358{
360 ReturnValue ret;
361 if (!m_allInterfaces.iPidControl) {
362 yCError(CB_RPC, "Invalid interface");
363 ret = ReturnValue::return_code::return_value_error_not_ready;
364 return ret;
365 }
366
367 ret = m_allInterfaces.iPidControl->setPid(pidtype, j, pid);
368 if (!ret) {
369 yCError(CB_RPC, "Unable to setPidRPC");
370 }
371 return ret;
372}
373
374yarp::dev::ReturnValue ControlBoardRPCd::setPidsRPC(const yarp::dev::PidControlTypeEnum pidtype, const std::vector<yarp::dev::Pid>& pids)
375{
377 ReturnValue ret;
378 if (!m_allInterfaces.iPidControl) {
379 yCError(CB_RPC, "Invalid interface");
380 ret = ReturnValue::return_code::return_value_error_not_ready;
381 return ret;
382 }
383
384 ret = m_allInterfaces.iPidControl->setPids(pidtype, pids.data());
385 if (!ret) {
386 yCError(CB_RPC, "Unable to setPidsRPC");
387 }
388 return ret;
389}
390
392{
395 if (!m_allInterfaces.iPidControl)
396 {
397 yCError(CB_RPC, "Invalid interface");
398 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
399 return ret;
400 }
401
402 ret.ret = m_allInterfaces.iPidControl->getAvailablePids(j, ret.avail);
403 if (!ret.ret)
404 {
405 yCError(CB_RPC, "Unable to getAvailablePidsRPC");
406 }
407 return ret;
408}
409
411{
413 return_getPid ret;
414 if (!m_allInterfaces.iPidControl)
415 {
416 yCError(CB_RPC, "Invalid interface");
417 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
418 return ret;
419 }
420
421 ret.ret = m_allInterfaces.iPidControl->getPid(pidtype, j, &ret.pid);
422 if (!ret.ret)
423 {
424 yCError(CB_RPC, "Unable to getPidRPC");
425 }
426 return ret;
427}
428
430{
432 return_getPids ret;
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.pids.resize(m_njoints);
441 ret.ret = m_allInterfaces.iPidControl->getPids(pidtype, ret.pids.data());
442 if (!ret.ret)
443 {
444 yCError(CB_RPC, "Unable to getPidsRPC");
445 }
446 return ret;
447}
448
450{
453 if (!m_allInterfaces.iPidControl)
454 {
455 yCError(CB_RPC, "Invalid interface");
456 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
457 return ret;
458 }
459
460 ret.ret = m_allInterfaces.iPidControl->getPidExtraInfo(pidtype, j, ret.info);
461 if (!ret.ret)
462 {
463 yCError(CB_RPC, "Unable to getPidExtraInfo");
464 }
465 return ret;
466}
467
469{
472 if (!m_allInterfaces.iPidControl)
473 {
474 yCError(CB_RPC, "Invalid interface");
475 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
476 return ret;
477 }
478
479 ret.info.resize(m_njoints);
480 ret.ret = m_allInterfaces.iPidControl->getPidExtraInfos(pidtype, ret.info);
481 if (!ret.ret)
482 {
483 yCError(CB_RPC, "Unable to getPidExtraInfos");
484 }
485 return ret;
486}
487
489{
492 if (!m_allInterfaces.iPidControl)
493 {
494 yCError(CB_RPC, "Invalid interface");
495 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
496 return ret;
497 }
498
499 ret.ret = m_allInterfaces.iPidControl->getPidOffset(pidtype, j, ret.offset);
500 if (!ret.ret)
501 {
502 yCError(CB_RPC, "Unable to getPidOffset");
503 }
504 return ret;
505}
506
508{
511 if (!m_allInterfaces.iPidControl)
512 {
513 yCError(CB_RPC, "Invalid interface");
514 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
515 return ret;
516 }
517
518 ret.ret = m_allInterfaces.iPidControl->getPidFeedforward(pidtype, j, ret.feedforward);
519 if (!ret.ret)
520 {
521 yCError(CB_RPC, "Unable to getPidFeedforward");
522 }
523 return ret;
524}
525
527{
529 ReturnValue ret;
530 if (!m_allInterfaces.iPidControl) {
531 yCError(CB_RPC, "Invalid interface");
532 ret = ReturnValue::return_code::return_value_error_not_ready;
533 return ret;
534 }
535
536 ret = m_allInterfaces.iPidControl->enablePid(pidtype, j);
537 if (!ret) {
538 yCError(CB_RPC, "Unable to enablePid");
539 }
540 return ret;
541}
542
544{
546 ReturnValue ret;
547 if (!m_allInterfaces.iPidControl) {
548 yCError(CB_RPC, "Invalid interface");
549 ret = ReturnValue::return_code::return_value_error_not_ready;
550 return ret;
551 }
552
553 ret = m_allInterfaces.iPidControl->disablePid(pidtype, j);
554 if (!ret) {
555 yCError(CB_RPC, "Unable to disablePid");
556 }
557 return ret;
558}
559
561{
563 ReturnValue ret;
564 if (!m_allInterfaces.iPidControl) {
565 yCError(CB_RPC, "Invalid interface");
566 ret = ReturnValue::return_code::return_value_error_not_ready;
567 return ret;
568 }
569
570 ret = m_allInterfaces.iPidControl->resetPid(pidtype, j);
571 if (!ret) {
572 yCError(CB_RPC, "Unable to resetPid");
573 }
574 return ret;
575}
576
578{
581 if (!m_allInterfaces.iPidControl)
582 {
583 yCError(CB_RPC, "Invalid interface");
584 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
585 return ret;
586 }
587
588 ret.ret = m_allInterfaces.iPidControl->isPidEnabled(pidtype, j, ret.isEnabled);
589 if (!ret.ret)
590 {
591 yCError(CB_RPC, "Unable to isPidEnabled");
592 }
593 return ret;
594}
595
596ReturnValue ControlBoardRPCd::setPidErrorLimitRPC(const yarp::dev::PidControlTypeEnum pidtype, const std::int16_t j, const double lim)
597{
599 ReturnValue ret;
600 if (!m_allInterfaces.iPidControl) {
601 yCError(CB_RPC, "Invalid interface");
602 ret = ReturnValue::return_code::return_value_error_not_ready;
603 return ret;
604 }
605
606 ret = m_allInterfaces.iPidControl->setPidErrorLimit(pidtype, j, lim);
607 if (!ret) {
608 yCError(CB_RPC, "Unable to setPidErrorLimitRPC");
609 }
610 return ret;
611}
612
614{
616 ReturnValue ret;
617 if (!m_allInterfaces.iPidControl) {
618 yCError(CB_RPC, "Invalid interface");
619 ret = ReturnValue::return_code::return_value_error_not_ready;
620 return ret;
621 }
622
623 ret = m_allInterfaces.iPidControl->setPidErrorLimits(pidtype, limits.data());
624 if (!ret) {
625 yCError(CB_RPC, "Unable to setPidErrorLimitsRPC");
626 }
627 return ret;
628}
629
631{
633 ReturnValue ret;
634 if (!m_allInterfaces.iPidControl) {
635 yCError(CB_RPC, "Invalid interface");
636 ret = ReturnValue::return_code::return_value_error_not_ready;
637 return ret;
638 }
639
640 ret = m_allInterfaces.iPidControl->setPidOffset(pidtype, j, value);
641 if (!ret) {
642 yCError(CB_RPC, "Unable to setPidOffset");
643 }
644 return ret;
645}
646
648{
650 ReturnValue ret;
651 if (!m_allInterfaces.iPidControl) {
652 yCError(CB_RPC, "Invalid interface");
653 ret = ReturnValue::return_code::return_value_error_not_ready;
654 return ret;
655 }
656
657 ret = m_allInterfaces.iPidControl->setPidFeedforward(pidtype, j, value);
658 if (!ret) {
659 yCError(CB_RPC, "Unable to setPidFeedforward");
660 }
661 return ret;
662}
663
664ReturnValue ControlBoardRPCd::setPidReferenceRPC(const yarp::dev::PidControlTypeEnum pidtype, const std::int16_t j, const double ref)
665{
667 ReturnValue ret;
668 if (!m_allInterfaces.iPidControl) {
669 yCError(CB_RPC, "Invalid interface");
670 ret = ReturnValue::return_code::return_value_error_not_ready;
671 return ret;
672 }
673
674 ret = m_allInterfaces.iPidControl->setPidReference(pidtype, j, ref);
675 if (!ret) {
676 yCError(CB_RPC, "Unable to setPidReferenceRPC");
677 }
678 return ret;
679}
680
682{
684 ReturnValue ret;
685 if (!m_allInterfaces.iPidControl) {
686 yCError(CB_RPC, "Invalid interface");
687 ret = ReturnValue::return_code::return_value_error_not_ready;
688 return ret;
689 }
690
691 ret = m_allInterfaces.iPidControl->setPidReferences(pidtype, refs.data());
692 if (!ret) {
693 yCError(CB_RPC, "Unable to setPidReferences");
694 }
695 return ret;
696}
697
699{
702 if (!m_allInterfaces.iPidControl)
703 {
704 yCError(CB_RPC, "Invalid interface");
705 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
706 return ret;
707 }
708
709 ret.ret = m_allInterfaces.iPidControl->getPidError(pidtype, j, &ret.err);
710 if (!ret.ret)
711 {
712 yCError(CB_RPC, "Unable to getPidErrorRPC");
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.errs.resize(m_njoints);
729 ret.ret = m_allInterfaces.iPidControl->getPidErrors(pidtype, ret.errs.data());
730 if (!ret.ret)
731 {
732 yCError(CB_RPC, "Unable to getPidErrorsRPC");
733 }
734 return ret;
735}
736
738{
741 if (!m_allInterfaces.iPidControl)
742 {
743 yCError(CB_RPC, "Invalid interface");
744 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
745 return ret;
746 }
747
748 ret.ret = m_allInterfaces.iPidControl->getPidReference(pidtype, j, &ret.ref);
749 if (!ret.ret)
750 {
751 yCError(CB_RPC, "Unable to getPidReferenceRPC");
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.refs.resize(m_njoints);
768 ret.ret = m_allInterfaces.iPidControl->getPidReferences(pidtype, ret.refs.data());
769 if (!ret.ret)
770 {
771 yCError(CB_RPC, "Unable to getPidReferencesRPC");
772 }
773 return ret;
774}
775
777{
780 if (!m_allInterfaces.iPidControl)
781 {
782 yCError(CB_RPC, "Invalid interface");
783 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
784 return ret;
785 }
786
787 ret.ret = m_allInterfaces.iPidControl->getPidErrorLimit(pidtype, j, &ret.lim);
788 if (!ret.ret)
789 {
790 yCError(CB_RPC, "Unable to getPidErrorLimitRPC");
791 }
792 return ret;
793}
794
796{
799 if (!m_allInterfaces.iPidControl)
800 {
801 yCError(CB_RPC, "Invalid interface");
802 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
803 return ret;
804 }
805
806 ret.lims.resize(m_njoints);
807 ret.ret = m_allInterfaces.iPidControl->getPidErrorLimits(pidtype, ret.lims.data());
808 if (!ret.ret)
809 {
810 yCError(CB_RPC, "Unable to getPidErrorLimitsRPC");
811 }
812 return ret;
813}
814
816{
819 if (!m_allInterfaces.iPidControl)
820 {
821 yCError(CB_RPC, "Invalid interface");
822 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
823 return ret;
824 }
825
826 ret.ret = m_allInterfaces.iPidControl->getPidOutput(pidtype, j, &ret.out);
827 if (!ret.ret)
828 {
829 yCError(CB_RPC, "Unable to getPidOutputRPC");
830 }
831 return ret;
832}
833
835{
838 if (!m_allInterfaces.iPidControl)
839 {
840 yCError(CB_RPC, "Invalid interface");
841 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
842 return ret;
843 }
844
845 ret.outs.resize(m_njoints);
846 ret.ret = m_allInterfaces.iPidControl->getPidOutputs(pidtype, ret.outs.data());
847 if (!ret.ret)
848 {
849 yCError(CB_RPC, "Unable to getPidOutputsRPC");
850 }
851 return ret;
852}
853
854
855//-------------------
856
857
859{
862 if (!m_allInterfaces.iControlLimits)
863 {
864 yCError(CB_RPC, "Invalid interface");
865 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
866 return ret;
867 }
868
869 ret.ret = m_allInterfaces.iControlLimits->getPosLimits(j, &ret.min, &ret.max);
870 if (!ret.ret)
871 {
872 yCError(CB_RPC, "Unable to getPosLimitsRPC");
873 }
874 return ret;
875}
876
878{
881 if (!m_allInterfaces.iControlLimits)
882 {
883 yCError(CB_RPC, "Invalid interface");
884 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
885 return ret;
886 }
887
888 ret.ret = m_allInterfaces.iControlLimits->getVelLimits(j, &ret.min, &ret.max);
889 if (!ret.ret)
890 {
891 yCError(CB_RPC, "Unable to getVelLimitsRPC");
892 }
893 return ret;
894}
895
896ReturnValue ControlBoardRPCd::setPosLimitsRPC(const std::int16_t j, const double min, const double max)
897{
899 ReturnValue ret;
900 if (!m_allInterfaces.iControlLimits) {
901 yCError(CB_RPC, "Invalid interface");
902 ret = ReturnValue::return_code::return_value_error_not_ready;
903 return ret;
904 }
905
906 ret = m_allInterfaces.iControlLimits->setPosLimits(j, min,max);
907 if (!ret) {
908 yCError(CB_RPC, "Unable to setPosLimits");
909 }
910 return ret;
911}
912
913ReturnValue ControlBoardRPCd::setVelLimitsRPC(const std::int16_t j, const double min, const double max)
914{
916 ReturnValue ret;
917 if (!m_allInterfaces.iControlLimits) {
918 yCError(CB_RPC, "Invalid interface");
919 ret = ReturnValue::return_code::return_value_error_not_ready;
920 return ret;
921 }
922
923 ret = m_allInterfaces.iControlLimits->setVelLimits(j, min,max);
924 if (!ret) {
925 yCError(CB_RPC, "Unable to setVelLimits");
926 }
927 return ret;
928}
929
930//------- IImpedanceControl
931
933{
936 if (!m_allInterfaces.iImpedanceControl)
937 {
938 yCError(CB_RPC, "Invalid interface");
939 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
940 return ret;
941 }
942
943 ret.ret = m_allInterfaces.iImpedanceControl->getImpedance(j, &ret.stiffness, &ret.damping);
944 if (!ret.ret)
945 {
946 yCError(CB_RPC, "Unable to getImpedance");
947 }
948 return ret;
949}
950
952{
955 if (!m_allInterfaces.iImpedanceControl)
956 {
957 yCError(CB_RPC, "Invalid interface");
958 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
959 return ret;
960 }
961
962 ret.ret = m_allInterfaces.iImpedanceControl->getImpedanceOffset(j, &ret.offset);
963 if (!ret.ret)
964 {
965 yCError(CB_RPC, "Unable to getImpedanceOffset");
966 }
967 return ret;
968}
969
971{
974 if (!m_allInterfaces.iImpedanceControl)
975 {
976 yCError(CB_RPC, "Invalid interface");
977 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
978 return ret;
979 }
980
981 ret.ret = m_allInterfaces.iImpedanceControl->getCurrentImpedanceLimit(j, &ret.min_stiffness, &ret.max_stiffness, &ret.min_damping, &ret.max_damping);
982 if (!ret.ret)
983 {
984 yCError(CB_RPC, "Unable to getCurrentImpedanceLimit");
985 }
986 return ret;
987}
988
989ReturnValue ControlBoardRPCd::setImpedanceRPC(const std::int32_t j, const double stiffness, const double damping)
990{
992 ReturnValue ret;
993 if (!m_allInterfaces.iImpedanceControl) {
994 yCError(CB_RPC, "Invalid interface");
995 ret = ReturnValue::return_code::return_value_error_not_ready;
996 return ret;
997 }
998
999 ret = m_allInterfaces.iImpedanceControl->setImpedance(j,stiffness, damping);
1000 if (!ret) {
1001 yCError(CB_RPC, "Unable to setImpedance");
1002 }
1003 return ret;
1004}
1005
1006ReturnValue ControlBoardRPCd::setImpedanceOffsetRPC(const std::int32_t j, const double offset)
1007{
1009 ReturnValue ret;
1010 if (!m_allInterfaces.iImpedanceControl) {
1011 yCError(CB_RPC, "Invalid interface");
1012 ret = ReturnValue::return_code::return_value_error_not_ready;
1013 return ret;
1014 }
1015
1016 ret = m_allInterfaces.iImpedanceControl->setImpedanceOffset(j, offset);
1017 if (!ret) {
1018 yCError(CB_RPC, "Unable to setImpedanceOffset");
1019 }
1020 return ret;
1021}
1022
1023//------- iAmplifierControl
1024
1026{
1029 if (!m_allInterfaces.iAmplifierControl)
1030 {
1031 yCError(CB_RPC, "Invalid interface");
1032 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
1033 return ret;
1034 }
1035
1036 ret.val.resize(m_njoints);
1037 ret.ret = m_allInterfaces.iAmplifierControl->getAmpStatus(ret.val.data());
1038 if (!ret.ret)
1039 {
1040 yCError(CB_RPC, "Unable to getAmpStatus");
1041 }
1042 return ret;
1043}
1044
1046{
1049 if (!m_allInterfaces.iAmplifierControl)
1050 {
1051 yCError(CB_RPC, "Invalid interface");
1052 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
1053 return ret;
1054 }
1055
1056 ret.ret = m_allInterfaces.iAmplifierControl->getAmpStatus(j, &ret.val);
1057 if (!ret.ret)
1058 {
1059 yCError(CB_RPC, "Unable to getAmpStatus");
1060 }
1061 return ret;
1062}
1063
1065{
1067 ReturnValue ret;
1068 if (!m_allInterfaces.iAmplifierControl) {
1069 yCError(CB_RPC, "Invalid interface");
1070 ret = ReturnValue::return_code::return_value_error_not_ready;
1071 return ret;
1072 }
1073
1074 ret = m_allInterfaces.iAmplifierControl->enableAmp(m);
1075 if (!ret) {
1076 yCError(CB_RPC, "Unable to enableAmp");
1077 }
1078 return ret;
1079}
1080
1082{
1084 ReturnValue ret;
1085 if (!m_allInterfaces.iAmplifierControl) {
1086 yCError(CB_RPC, "Invalid interface");
1087 ret = ReturnValue::return_code::return_value_error_not_ready;
1088 return ret;
1089 }
1090
1091 ret = m_allInterfaces.iAmplifierControl->disableAmp(m);
1092 if (!ret) {
1093 yCError(CB_RPC, "Unable to disableAmp");
1094 }
1095 return ret;
1096}
1097
1099{
1101 return_getPWM ret;
1102 if (!m_allInterfaces.iAmplifierControl)
1103 {
1104 yCError(CB_RPC, "Invalid interface");
1105 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
1106 return ret;
1107 }
1108
1109 ret.ret = m_allInterfaces.iAmplifierControl->getPWM(j, &ret.val);
1110 if (!ret.ret)
1111 {
1112 yCError(CB_RPC, "Unable to getPWM");
1113 }
1114 return ret;
1115}
1116
1118{
1121 if (!m_allInterfaces.iAmplifierControl)
1122 {
1123 yCError(CB_RPC, "Invalid interface");
1124 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
1125 return ret;
1126 }
1127
1128 ret.ret = m_allInterfaces.iAmplifierControl->getPWMLimit(m, &ret.val);
1129 if (!ret.ret)
1130 {
1131 yCError(CB_RPC, "Unable to getPWMLimit");
1132 }
1133 return ret;
1134}
1135
1136ReturnValue ControlBoardRPCd::setPWMLimitRPC(const std::int32_t m, const double val)
1137{
1139 ReturnValue ret;
1140 if (!m_allInterfaces.iAmplifierControl) {
1141 yCError(CB_RPC, "Invalid interface");
1142 ret = ReturnValue::return_code::return_value_error_not_ready;
1143 return ret;
1144 }
1145
1146 ret = m_allInterfaces.iAmplifierControl->setPWMLimit(m,val);
1147 if (!ret) {
1148 yCError(CB_RPC, "Unable to setPWMLimit");
1149 }
1150 return ret;
1151}
1152
1154{
1157 if (!m_allInterfaces.iAmplifierControl)
1158 {
1159 yCError(CB_RPC, "Invalid interface");
1160 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
1161 return ret;
1162 }
1163
1164 ret.ret = m_allInterfaces.iAmplifierControl->getPowerSupplyVoltage(m, &ret.val);
1165 if (!ret.ret)
1166 {
1167 yCError(CB_RPC, "Unable to getPowerSupplyVoltage");
1168 }
1169 return ret;
1170}
1171
1172ReturnValue ControlBoardRPCd::setPeakCurrentRPC(const std::int32_t m, const double val)
1173{
1175 ReturnValue ret;
1176 if (!m_allInterfaces.iAmplifierControl) {
1177 yCError(CB_RPC, "Invalid interface");
1178 ret = ReturnValue::return_code::return_value_error_not_ready;
1179 return ret;
1180 }
1181
1182 ret = m_allInterfaces.iAmplifierControl->setPeakCurrent(m,val);
1183 if (!ret) {
1184 yCError(CB_RPC, "Unable to setPeakCurrent");
1185 }
1186 return ret;
1187}
1188
1190{
1193 if (!m_allInterfaces.iAmplifierControl)
1194 {
1195 yCError(CB_RPC, "Invalid interface");
1196 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
1197 return ret;
1198 }
1199
1200 ret.ret = m_allInterfaces.iAmplifierControl->getPeakCurrent(m, &ret.val);
1201 if (!ret.ret)
1202 {
1203 yCError(CB_RPC, "Unable to getPeakCurrent");
1204 }
1205 return ret;
1206}
1207
1208ReturnValue ControlBoardRPCd::setNominalCurrentRPC(const std::int32_t m, const double val)
1209{
1211 ReturnValue ret;
1212 if (!m_allInterfaces.iAmplifierControl) {
1213 yCError(CB_RPC, "Invalid interface");
1214 ret = ReturnValue::return_code::return_value_error_not_ready;
1215 return ret;
1216 }
1217
1218 ret = m_allInterfaces.iAmplifierControl->setNominalCurrent(m,val);
1219 if (!ret) {
1220 yCError(CB_RPC, "Unable to setNominalCurrent");
1221 }
1222 return ret;
1223}
1224
1226{
1229 if (!m_allInterfaces.iAmplifierControl)
1230 {
1231 yCError(CB_RPC, "Invalid interface");
1232 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
1233 return ret;
1234 }
1235
1236 ret.ret = m_allInterfaces.iAmplifierControl->getNominalCurrent(m, &ret.val);
1237 if (!ret.ret)
1238 {
1239 yCError(CB_RPC, "Unable to getNominalCurrent");
1240 }
1241 return ret;
1242}
1243
1244ReturnValue ControlBoardRPCd::setMaxCurrentRPC(const std::int32_t m, const double val)
1245{
1247 ReturnValue ret;
1248 if (!m_allInterfaces.iAmplifierControl) {
1249 yCError(CB_RPC, "Invalid interface");
1250 ret = ReturnValue::return_code::return_value_error_not_ready;
1251 return ret;
1252 }
1253
1254 ret = m_allInterfaces.iAmplifierControl->setMaxCurrent(m,val);
1255 if (!ret) {
1256 yCError(CB_RPC, "Unable to setMaxCurrent");
1257 }
1258 return ret;
1259}
1260
1262{
1265 if (!m_allInterfaces.iAmplifierControl)
1266 {
1267 yCError(CB_RPC, "Invalid interface");
1268 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
1269 return ret;
1270 }
1271
1272 ret.ret = m_allInterfaces.iAmplifierControl->getMaxCurrent(m, &ret.val);
1273 if (!ret.ret)
1274 {
1275 yCError(CB_RPC, "Unable to getMaxCurrent");
1276 }
1277 return ret;
1278}
1279
1280//------- iCalibration
1281
1283{
1285 ReturnValue ret;
1286 if (!m_allInterfaces.iRemoteCalibrator) {
1287 yCError(CB_RPC, "Invalid interface");
1288 ret = ReturnValue::return_code::return_value_error_not_ready;
1289 return ret;
1290 }
1291
1292 ret = m_allInterfaces.iRemoteCalibrator->calibrateSingleJoint(j);
1293 if (!ret) {
1294 yCError(CB_RPC, "Unable to calibrateSingleJoint");
1295 }
1296 return ret;
1297}
1298
1300{
1302 ReturnValue ret;
1303 if (!m_allInterfaces.iRemoteCalibrator) {
1304 yCError(CB_RPC, "Invalid interface");
1305 ret = ReturnValue::return_code::return_value_error_not_ready;
1306 return ret;
1307 }
1308
1309 ret = m_allInterfaces.iRemoteCalibrator->calibrateWholePart();
1310 if (!ret) {
1311 yCError(CB_RPC, "Unable to calibrateWholePart");
1312 }
1313 return ret;
1314}
1315
1317{
1319 ReturnValue ret;
1320 if (!m_allInterfaces.iRemoteCalibrator) {
1321 yCError(CB_RPC, "Invalid interface");
1322 ret = ReturnValue::return_code::return_value_error_not_ready;
1323 return ret;
1324 }
1325
1326 ret = m_allInterfaces.iRemoteCalibrator->homingSingleJoint(j);
1327 if (!ret) {
1328 yCError(CB_RPC, "Unable to homingSingleJoint");
1329 }
1330 return ret;
1331}
1332
1334{
1336 ReturnValue ret;
1337 if (!m_allInterfaces.iRemoteCalibrator) {
1338 yCError(CB_RPC, "Invalid interface");
1339 ret = ReturnValue::return_code::return_value_error_not_ready;
1340 return ret;
1341 }
1342
1343 ret = m_allInterfaces.iRemoteCalibrator->homingWholePart();
1344 if (!ret) {
1345 yCError(CB_RPC, "Unable to homingWholePartRPC");
1346 }
1347 return ret;
1348}
1349
1350ReturnValue ControlBoardRPCd::parkSingleJointRPC(const std::int32_t j, const bool wait)
1351{
1353 ReturnValue ret;
1354 if (!m_allInterfaces.iRemoteCalibrator) {
1355 yCError(CB_RPC, "Invalid interface");
1356 ret = ReturnValue::return_code::return_value_error_not_ready;
1357 return ret;
1358 }
1359
1360 ret = m_allInterfaces.iRemoteCalibrator->parkSingleJoint(j, wait);
1361 if (!ret) {
1362 yCError(CB_RPC, "Unable to parkSingleJoint");
1363 }
1364 return ret;
1365}
1366
1368{
1370 ReturnValue ret;
1371 if (!m_allInterfaces.iRemoteCalibrator) {
1372 yCError(CB_RPC, "Invalid interface");
1373 ret = ReturnValue::return_code::return_value_error_not_ready;
1374 return ret;
1375 }
1376
1377 ret = m_allInterfaces.iRemoteCalibrator->parkWholePart();
1378 if (!ret) {
1379 yCError(CB_RPC, "Unable to parkWholePart");
1380 }
1381 return ret;
1382}
1383
1385{
1387 ReturnValue ret;
1388 if (!m_allInterfaces.iRemoteCalibrator) {
1389 yCError(CB_RPC, "Invalid interface");
1390 ret = ReturnValue::return_code::return_value_error_not_ready;
1391 return ret;
1392 }
1393
1394 ret = m_allInterfaces.iRemoteCalibrator->quitCalibrate();
1395 if (!ret) {
1396 yCError(CB_RPC, "Unable to quitCalibrate");
1397 }
1398 return ret;
1399}
1400
1402{
1404 ReturnValue ret;
1405 if (!m_allInterfaces.iRemoteCalibrator) {
1406 yCError(CB_RPC, "Invalid interface");
1407 ret = ReturnValue::return_code::return_value_error_not_ready;
1408 return ret;
1409 }
1410
1411 ret = m_allInterfaces.iRemoteCalibrator->quitPark();
1412 if (!ret) {
1413 yCError(CB_RPC, "Unable to quitPark");
1414 }
1415 return ret;
1416}
1417
1419{
1422 if (!m_allInterfaces.iRemoteCalibrator)
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.ret = m_allInterfaces.iRemoteCalibrator->isCalibratorDevicePresent(&ret.isPresent);
1430 if (!ret.ret)
1431 {
1432 yCError(CB_RPC, "Unable to isCalibratorDevicePresent");
1433 }
1434 return ret;
1435}
1436
1437//IInteractionMode
1439{
1442 if (!m_allInterfaces.iInteractionMode)
1443 {
1444 yCError(CB_RPC, "Invalid interface");
1445 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
1446 return ret;
1447 }
1448
1449 ret.ret = m_allInterfaces.iInteractionMode->getInteractionMode(axis, ret.mode);
1450 if (!ret.ret)
1451 {
1452 yCError(CB_RPC, "Unable to getInteractionMode");
1453 }
1454 return ret;
1455}
1456
1458{
1461 if (!m_allInterfaces.iInteractionMode)
1462 {
1463 yCError(CB_RPC, "Invalid interface");
1464 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
1465 return ret;
1466 }
1467
1468 ret.modes.resize(joints.size());
1469 ret.ret = m_allInterfaces.iInteractionMode->getInteractionModes(joints, ret.modes);
1470 if (!ret.ret)
1471 {
1472 yCError(CB_RPC, "Unable to getInteractionModes");
1473 }
1474 return ret;
1475}
1476
1478{
1481 if (!m_allInterfaces.iInteractionMode)
1482 {
1483 yCError(CB_RPC, "Invalid interface");
1484 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
1485 return ret;
1486 }
1487
1488 ret.modes.resize(m_njoints);
1489 ret.ret = m_allInterfaces.iInteractionMode->getInteractionModes(ret.modes);
1490 if (!ret.ret)
1491 {
1492 yCError(CB_RPC, "Unable to getInteractionModes");
1493 }
1494 return ret;
1495}
1496
1498{
1500 ReturnValue ret;
1501 if (!m_allInterfaces.iInteractionMode) {
1502 yCError(CB_RPC, "Invalid interface");
1503 ret = ReturnValue::return_code::return_value_error_not_ready;
1504 return ret;
1505 }
1506
1507 ret = m_allInterfaces.iInteractionMode->setInteractionMode(axis, mode);
1508 if (!ret) {
1509 yCError(CB_RPC, "Unable to setInteractionModeOne");
1510 }
1511 return ret;
1512}
1513
1514yarp::dev::ReturnValue ControlBoardRPCd::setInteractionModesGroupRPC(const std::vector<std::int32_t>& joints, const std::vector<yarp::dev::InteractionModeEnum>& modes)
1515{
1517 ReturnValue ret;
1518 if (!m_allInterfaces.iInteractionMode) {
1519 yCError(CB_RPC, "Invalid interface");
1520 ret = ReturnValue::return_code::return_value_error_not_ready;
1521 return ret;
1522 }
1523
1524 ret = m_allInterfaces.iInteractionMode->setInteractionModes(joints, modes);
1525 if (!ret) {
1526 yCError(CB_RPC, "Unable to setInteractionModes");
1527 }
1528 return ret;
1529}
1530
1531yarp::dev::ReturnValue ControlBoardRPCd::setInteractionModesAllRPC(const std::vector<yarp::dev::InteractionModeEnum>& modes)
1532{
1534 ReturnValue ret;
1535 if (!m_allInterfaces.iInteractionMode) {
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.iInteractionMode->setInteractionModes(modes);
1542 if (!ret) {
1543 yCError(CB_RPC, "Unable to setInteractionModes");
1544 }
1545 return ret;
1546}
1547
1548//IAxis
1549
1551{
1554 if (!m_allInterfaces.iAxisInfo)
1555 {
1556 yCError(CB_RPC, "Invalid interface");
1557 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
1558 return ret;
1559 }
1560
1561 ret.ret = m_allInterfaces.iAxisInfo->getAxisName(j, ret.name);
1562 if (!ret.ret)
1563 {
1564 yCError(CB_RPC, "Unable to getAxisName");
1565 }
1566 return ret;
1567}
1568
1570{
1573 if (!m_allInterfaces.iAxisInfo)
1574 {
1575 yCError(CB_RPC, "Invalid interface");
1576 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
1577 return ret;
1578 }
1579
1580 ret.ret = m_allInterfaces.iAxisInfo->getJointType(j, ret.joint);
1581 if (!ret.ret)
1582 {
1583 yCError(CB_RPC, "Unable to getJointType");
1584 }
1585 return ret;
1586}
1587
1588// iControlCalibration
1589
1591{
1593 ReturnValue ret;
1594 if (!m_allInterfaces.iControlCalibration) {
1595 yCError(CB_RPC, "Invalid interface");
1596 ret = ReturnValue::return_code::return_value_error_not_ready;
1597 return ret;
1598 }
1599
1600 ret = m_allInterfaces.iControlCalibration->calibrateRobot();
1601 if (!ret) {
1602 yCError(CB_RPC, "Unable to calibrateRobot");
1603 }
1604 return ret;
1605}
1606
1608{
1610 ReturnValue ret;
1611 if (!m_allInterfaces.iControlCalibration) {
1612 yCError(CB_RPC, "Invalid interface");
1613 ret = ReturnValue::return_code::return_value_error_not_ready;
1614 return ret;
1615 }
1616
1617 ret = m_allInterfaces.iControlCalibration->abortCalibration();
1618 if (!ret) {
1619 yCError(CB_RPC, "Unable to abortCalibration");
1620 }
1621 return ret;
1622}
1623
1625{
1627 ReturnValue ret;
1628 if (!m_allInterfaces.iControlCalibration) {
1629 yCError(CB_RPC, "Invalid interface");
1630 ret = ReturnValue::return_code::return_value_error_not_ready;
1631 return ret;
1632 }
1633
1634 ret = m_allInterfaces.iControlCalibration->abortPark();
1635 if (!ret) {
1636 yCError(CB_RPC, "Unable to abortPark");
1637 }
1638 return ret;
1639}
1640
1642{
1644 ReturnValue ret;
1645 if (!m_allInterfaces.iControlCalibration) {
1646 yCError(CB_RPC, "Invalid interface");
1647 ret = ReturnValue::return_code::return_value_error_not_ready;
1648 return ret;
1649 }
1650
1651 ret = m_allInterfaces.iControlCalibration->park(wait);
1652 if (!ret) {
1653 yCError(CB_RPC, "Unable to park");
1654 }
1655 return ret;
1656}
1657
1658ReturnValue ControlBoardRPCd::calibrateAxisWithParamsRPC(const std::int32_t j, const std::int32_t ui, const double v1, const double v2, const double v3)
1659{
1661 ReturnValue ret;
1662 if (!m_allInterfaces.iControlCalibration) {
1663 yCError(CB_RPC, "Invalid interface");
1664 ret = ReturnValue::return_code::return_value_error_not_ready;
1665 return ret;
1666 }
1667
1668 ret = m_allInterfaces.iControlCalibration->calibrateAxisWithParams(j, ui, v1, v2, v3);
1669 if (!ret) {
1670 yCError(CB_RPC, "Unable to calibrateAxisWithParams");
1671 }
1672 return ret;
1673}
1674
1676{
1678 ReturnValue ret;
1679 if (!m_allInterfaces.iControlCalibration) {
1680 yCError(CB_RPC, "Invalid interface");
1681 ret = ReturnValue::return_code::return_value_error_not_ready;
1682 return ret;
1683 }
1684
1686 params.param1 = yparams.param1;
1687 params.param2 = yparams.param2;
1688 params.param3 = yparams.param3;
1689 params.param4 = yparams.param4;
1690 params.param5 = yparams.param5;
1691 params.paramZero = yparams.paramZero;
1692 ret = m_allInterfaces.iControlCalibration->setCalibrationParameters(j, params);
1693 if (!ret) {
1694 yCError(CB_RPC, "Unable to setCalibrationParameters");
1695 }
1696 return ret;
1697}
1698
1700{
1702 ReturnValue ret;
1703 if (!m_allInterfaces.iControlCalibration) {
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.iControlCalibration->calibrationDone(j);
1710 if (!ret) {
1711 yCError(CB_RPC, "Unable to calibrationDone");
1712 }
1713 return ret;
1714}
1715
1716//------- IJointFault
1717
1719{
1722 if (!m_allInterfaces.iJointFault)
1723 {
1724 yCError(CB_RPC, "Invalid interface");
1725 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
1726 return ret;
1727 }
1728
1729 ret.ret = m_allInterfaces.iJointFault->getLastJointFault(j, ret.fault, ret.message);
1730 if (!ret.ret)
1731 {
1732 yCError(CB_RPC, "Unable to getLastJointFault");
1733 }
1734 return ret;
1735}
1736
1737//------- IRemoteVariable
1738
1740{
1743 if (!m_allInterfaces.iRemoteVariables)
1744 {
1745 yCError(CB_RPC, "Invalid interface");
1746 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
1747 return ret;
1748 }
1749
1750 ret.ret = m_allInterfaces.iRemoteVariables->getRemoteVariable(key, ret.val);
1751 if (!ret.ret)
1752 {
1753 yCError(CB_RPC, "Unable to getRemoteVariable");
1754 }
1755 return ret;
1756}
1757
1759{
1761 ReturnValue ret;
1762 if (!m_allInterfaces.iRemoteVariables) {
1763 yCError(CB_RPC, "Invalid interface");
1764 ret = ReturnValue::return_code::return_value_error_not_ready;
1765 return ret;
1766 }
1767
1768 ret = m_allInterfaces.iRemoteVariables->setRemoteVariable(key, val);
1769 if (!ret) {
1770 yCError(CB_RPC, "Unable to setRemoteVariable");
1771 }
1772 return ret;
1773}
1774
1776{
1779 if (!m_allInterfaces.iRemoteVariables)
1780 {
1781 yCError(CB_RPC, "Invalid interface");
1782 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
1783 return ret;
1784 }
1785
1786 yarp::os::Bottle listOfKeys;
1787 ret.ret = m_allInterfaces.iRemoteVariables->getRemoteVariablesList(&listOfKeys);
1788 if (!ret.ret)
1789 {
1790 yCError(CB_RPC, "Unable to getRemoteVariablesList");
1791 return ret;
1792 }
1793 ret.listOfKeys.clear();
1794 ret.listOfKeys.push_back(listOfKeys);
1795 return ret;
1796}
1797
1798//------- ICurrentControl
1799
1801{
1804 if (!m_allInterfaces.iCurrentControl) {
1805 yCError(CB_RPC, "Invalid iCurrentControl interface");
1807 return ret;
1808 }
1809 ret.refs.resize(m_njoints);
1810 ret.ret = m_allInterfaces.iCurrentControl->getRefCurrents(ret.refs.data());
1811 if (!ret.ret) {
1812 yCError(CB_RPC, "getRefCurrents() failed");
1813 }
1814 return ret;
1815}
1816
1818{
1821 if (!m_allInterfaces.iCurrentControl) {
1822 yCError(CB_RPC, "Invalid interface");
1823 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
1824 return ret;
1825 }
1826
1827 ret.ret = m_allInterfaces.iCurrentControl->getRefCurrent(j, &ret.ref);
1828 if (!ret.ret) {
1829 yCError(CB_RPC, "Unable to getRefCurrent");
1830 }
1831 return ret;
1832}
1833
1835{
1837 ReturnValue ret;
1838 if (!m_allInterfaces.iCurrentControl) {
1839 yCError(CB_RPC, "Invalid interface");
1840 ret = ReturnValue::return_code::return_value_error_not_ready;
1841 return ret;
1842 }
1843
1844 ret = m_allInterfaces.iCurrentControl->setRefCurrents(refs.data());
1845 if (!ret) {
1846 yCError(CB_RPC, "Unable to setRefCurrents");
1847 return ReturnValue::return_code::return_value_error_generic;
1848 }
1849 return ret;
1850}
1851
1853{
1855 ReturnValue ret;
1856 if (!m_allInterfaces.iCurrentControl) {
1857 yCError(CB_RPC, "Invalid interface");
1858 ret = ReturnValue::return_code::return_value_error_not_ready;
1859 return ret;
1860 }
1861
1862 ret = m_allInterfaces.iCurrentControl->setRefCurrent(j, ref);
1863 if (!ret) {
1864 yCError(CB_RPC, "Unable to setRefCurrent");
1865 return ReturnValue::return_code::return_value_error_generic;
1866 }
1867 return ret;
1868}
1869
1870yarp::dev::ReturnValue ControlBoardRPCd::setRefCurrentGroupRPC(const std::vector<std::int32_t>& j, const std::vector<double>& refs)
1871{
1873 ReturnValue ret;
1874 if (!m_allInterfaces.iCurrentControl) {
1875 yCError(CB_RPC, "Invalid interface");
1876 ret = ReturnValue::return_code::return_value_error_not_ready;
1877 return ret;
1878 }
1879
1880 ret = m_allInterfaces.iCurrentControl->setRefCurrents(j.size(), j.data(), refs.data());
1881 if (!ret) {
1882 yCError(CB_RPC, "Unable to setRefCurrents");
1883 return ReturnValue::return_code::return_value_error_generic;
1884 }
1885 return ret;
1886}
1887
1889{
1892 if (!m_allInterfaces.iCurrentControl) {
1893 yCError(CB_RPC, "Invalid iCurrentControl interface");
1895 return ret;
1896 }
1897 ret.currs.resize(m_njoints);
1898 ret.ret = m_allInterfaces.iCurrentControl->getCurrents(ret.currs.data());
1899 if (!ret.ret) {
1900 yCError(CB_RPC, "getCurrents() failed");
1901 }
1902 return ret;
1903}
1904
1906{
1909 if (!m_allInterfaces.iCurrentControl) {
1910 yCError(CB_RPC, "Invalid interface");
1911 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
1912 return ret;
1913 }
1914
1915 ret.ret = m_allInterfaces.iCurrentControl->getCurrent(j, &ret.curr);
1916 if (!ret.ret) {
1917 yCError(CB_RPC, "Unable to getCurrent");
1918 }
1919 return ret;
1920}
1921
1923{
1926 if (!m_allInterfaces.iCurrentControl) {
1927 yCError(CB_RPC, "Invalid interface");
1928 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
1929 return ret;
1930 }
1931
1932 ret.ret = m_allInterfaces.iCurrentControl->getCurrentRange(j, &ret.min, &ret.max);
1933 if (!ret.ret) {
1934 yCError(CB_RPC, "Unable to getCurrentRange");
1935 }
1936 return ret;
1937}
1938
1940{
1943 if (!m_allInterfaces.iCurrentControl) {
1944 yCError(CB_RPC, "Invalid iCurrentControl interface");
1946 return ret;
1947 }
1948 ret.mins.resize(m_njoints);
1949 ret.maxs.resize(m_njoints);
1950 ret.ret = m_allInterfaces.iCurrentControl->getCurrentRanges(ret.mins.data(), ret.maxs.data());
1951 if (!ret.ret) {
1952 yCError(CB_RPC, "getCurrentRanges() failed");
1953 }
1954 return ret;
1955}
1956
1957//------- IPWMControl
1958
1960{
1962 ReturnValue ret;
1963 if (!m_allInterfaces.iPWMControl) {
1964 yCError(CB_RPC, "Invalid interface");
1965 ret = ReturnValue::return_code::return_value_error_not_ready;
1966 return ret;
1967 }
1968
1969 ret = m_allInterfaces.iPWMControl->setRefDutyCycle(j, v);
1970 if (!ret) {
1971 yCError(CB_RPC, "Unable to setRefDutyCycle");
1972 return ReturnValue::return_code::return_value_error_generic;
1973 }
1974 return ret;
1975}
1976
1978{
1980 ReturnValue ret;
1981 if (!m_allInterfaces.iPWMControl) {
1982 yCError(CB_RPC, "Invalid interface");
1983 ret = ReturnValue::return_code::return_value_error_not_ready;
1984 return ret;
1985 }
1986
1987 ret = m_allInterfaces.iPWMControl->setRefDutyCycles(v.data());
1988 if (!ret) {
1989 yCError(CB_RPC, "Unable to setRefDutyCycles");
1990 return ReturnValue::return_code::return_value_error_generic;
1991 }
1992 return ret;
1993}
1994
1996{
1999 if (!m_allInterfaces.iPWMControl) {
2000 yCError(CB_RPC, "Invalid interface");
2001 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2002 return ret;
2003 }
2004
2005 ret.ret = m_allInterfaces.iPWMControl->getRefDutyCycle(j, &ret.val);
2006 if (!ret.ret) {
2007 yCError(CB_RPC, "Unable to getRefDutyCycle");
2008 }
2009 return ret;
2010}
2011
2013{
2016 if (!m_allInterfaces.iPWMControl) {
2017 yCError(CB_RPC, "Invalid interface");
2018 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2019 return ret;
2020 }
2021
2022 ret.val.resize(m_njoints);
2023 ret.ret = m_allInterfaces.iPWMControl->getRefDutyCycles(ret.val.data());
2024 if (!ret.ret) {
2025 yCError(CB_RPC, "Unable to getRefDutyCycles");
2026 }
2027 return ret;
2028}
2029
2031{
2034 if (!m_allInterfaces.iPWMControl) {
2035 yCError(CB_RPC, "Invalid interface");
2036 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2037 return ret;
2038 }
2039
2040 ret.ret = m_allInterfaces.iPWMControl->getDutyCycle(j, &ret.val);
2041 if (!ret.ret) {
2042 yCError(CB_RPC, "Unable to getDutyCycle");
2043 }
2044 return ret;
2045}
2046
2048{
2051 if (!m_allInterfaces.iPWMControl) {
2052 yCError(CB_RPC, "Invalid interface");
2053 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2054 return ret;
2055 }
2056
2057 ret.val.resize(m_njoints);
2058 ret.ret = m_allInterfaces.iPWMControl->getDutyCycles(ret.val.data());
2059 if (!ret.ret) {
2060 yCError(CB_RPC, "Unable to getDutyCycles");
2061 }
2062 return ret;
2063}
2064
2065//------- IEncoders
2066
2068{
2070 ReturnValue ret;
2071 if (!m_allInterfaces.iEncodersTimed) {
2072 yCError(CB_RPC, "Invalid interface");
2073 ret = ReturnValue::return_code::return_value_error_not_ready;
2074 return ret;
2075 }
2076
2077 ret = m_allInterfaces.iEncodersTimed->resetEncoder(j);
2078 if (!ret) {
2079 yCError(CB_RPC, "Unable to resetEncoder");
2080 return ReturnValue::return_code::return_value_error_generic;
2081 }
2082 return ret;
2083}
2084
2086{
2088 ReturnValue ret;
2089 if (!m_allInterfaces.iEncodersTimed) {
2090 yCError(CB_RPC, "Invalid interface");
2091 ret = ReturnValue::return_code::return_value_error_not_ready;
2092 return ret;
2093 }
2094
2095 ret = m_allInterfaces.iEncodersTimed->resetEncoders();
2096 if (!ret) {
2097 yCError(CB_RPC, "Unable to resetEncoders");
2098 return ReturnValue::return_code::return_value_error_generic;
2099 }
2100 return ret;
2101}
2102
2103yarp::dev::ReturnValue ControlBoardRPCd::setEncoderOneRPC(const std::int32_t j, const double val)
2104{
2106 ReturnValue ret;
2107 if (!m_allInterfaces.iEncodersTimed) {
2108 yCError(CB_RPC, "Invalid interface");
2109 ret = ReturnValue::return_code::return_value_error_not_ready;
2110 return ret;
2111 }
2112
2113 ret = m_allInterfaces.iEncodersTimed->setEncoder(j,val);
2114 if (!ret) {
2115 yCError(CB_RPC, "Unable to setEncoder");
2116 return ReturnValue::return_code::return_value_error_generic;
2117 }
2118 return ret;
2119}
2120
2122{
2124 ReturnValue ret;
2125 if (!m_allInterfaces.iEncodersTimed) {
2126 yCError(CB_RPC, "Invalid interface");
2127 ret = ReturnValue::return_code::return_value_error_not_ready;
2128 return ret;
2129 }
2130
2131 ret = m_allInterfaces.iEncodersTimed->setEncoders(vals.data());
2132 if (!ret) {
2133 yCError(CB_RPC, "Unable to setEncoders");
2134 return ReturnValue::return_code::return_value_error_generic;
2135 }
2136 return ret;
2137}
2138
2140{
2143 if (!m_allInterfaces.iEncodersTimed) {
2144 yCError(CB_RPC, "Invalid interface");
2145 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2146 return ret;
2147 }
2148
2149 ret.ret = m_allInterfaces.iEncodersTimed->getEncoder(j, &ret.val);
2150 if (!ret.ret) {
2151 yCError(CB_RPC, "Unable to getEncoder");
2152 }
2153 return ret;
2154}
2155
2157{
2160 if (!m_allInterfaces.iEncodersTimed) {
2161 yCError(CB_RPC, "Invalid interface");
2162 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2163 return ret;
2164 }
2165
2166 ret.ret = m_allInterfaces.iEncodersTimed->getEncoderTimed(j, &ret.val, &ret.time);
2167 if (!ret.ret) {
2168 yCError(CB_RPC, "Unable to getEncoderTimed");
2169 }
2170 return ret;
2171}
2172
2174{
2177 if (!m_allInterfaces.iEncodersTimed) {
2178 yCError(CB_RPC, "Invalid interface");
2179 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2180 return ret;
2181 }
2182
2183 ret.val.resize(m_njoints);
2184 ret.ret = m_allInterfaces.iEncodersTimed->getEncoders(ret.val.data());
2185 if (!ret.ret) {
2186 yCError(CB_RPC, "Unable to getEncoders");
2187 }
2188 return ret;
2189}
2190
2192{
2195 if (!m_allInterfaces.iEncodersTimed) {
2196 yCError(CB_RPC, "Invalid interface");
2197 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2198 return ret;
2199 }
2200
2201 ret.val.resize(m_njoints);
2202 ret.time.resize(m_njoints);
2203 ret.ret = m_allInterfaces.iEncodersTimed->getEncodersTimed(ret.val.data(), ret.time.data());
2204 if (!ret.ret) {
2205 yCError(CB_RPC, "Unable to getEncodersTimed");
2206 }
2207 return ret;
2208}
2209
2211{
2214 if (!m_allInterfaces.iEncodersTimed) {
2215 yCError(CB_RPC, "Invalid interface");
2216 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2217 return ret;
2218 }
2219
2220 ret.ret = m_allInterfaces.iEncodersTimed->getEncoderSpeed(j, &ret.val);
2221 if (!ret.ret) {
2222 yCError(CB_RPC, "Unable to getEncoderSpeed");
2223 }
2224 return ret;
2225}
2226
2228{
2231 if (!m_allInterfaces.iEncodersTimed) {
2232 yCError(CB_RPC, "Invalid interface");
2233 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2234 return ret;
2235 }
2236
2237 ret.val.resize(m_njoints);
2238 ret.ret = m_allInterfaces.iEncodersTimed->getEncoderSpeeds(ret.val.data());
2239 if (!ret.ret) {
2240 yCError(CB_RPC, "Unable to getEncodersSpeed");
2241 }
2242 return ret;
2243}
2244
2246{
2249 if (!m_allInterfaces.iEncodersTimed) {
2250 yCError(CB_RPC, "Invalid interface");
2251 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2252 return ret;
2253 }
2254
2255 ret.ret = m_allInterfaces.iEncodersTimed->getEncoderAcceleration(j, &ret.val);
2256 if (!ret.ret) {
2257 yCError(CB_RPC, "Unable to getEncoderAcceleration");
2258 }
2259 return ret;
2260}
2261
2263{
2266 if (!m_allInterfaces.iEncodersTimed) {
2267 yCError(CB_RPC, "Invalid interface");
2268 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2269 return ret;
2270 }
2271
2272 ret.val.resize(m_njoints);
2273 ret.ret = m_allInterfaces.iEncodersTimed->getEncoderAccelerations(ret.val.data());
2274 if (!ret.ret) {
2275 yCError(CB_RPC, "Unable to getEncoderAccelerations");
2276 }
2277 return ret;
2278}
2279
2280
2281//------- IMotorEncoders
2282
2284{
2286 ReturnValue ret;
2287 if (!m_allInterfaces.iMotorEncoders) {
2288 yCError(CB_RPC, "Invalid interface");
2289 ret = ReturnValue::return_code::return_value_error_not_ready;
2290 return ret;
2291 }
2292
2293 ret = m_allInterfaces.iMotorEncoders->resetMotorEncoder(j);
2294 if (!ret) {
2295 yCError(CB_RPC, "Unable to resetMotorEncoder");
2296 }
2297 return ret;
2298}
2299
2301{
2303 ReturnValue ret;
2304 if (!m_allInterfaces.iMotorEncoders) {
2305 yCError(CB_RPC, "Invalid interface");
2306 ret = ReturnValue::return_code::return_value_error_not_ready;
2307 return ret;
2308 }
2309
2310 ret = m_allInterfaces.iMotorEncoders->resetMotorEncoders();
2311 if (!ret) {
2312 yCError(CB_RPC, "Unable to resetMotorEncoders");
2313 }
2314 return ret;
2315}
2316
2318{
2320 ReturnValue ret;
2321 if (!m_allInterfaces.iMotorEncoders) {
2322 yCError(CB_RPC, "Invalid interface");
2323 ret = ReturnValue::return_code::return_value_error_not_ready;
2324 return ret;
2325 }
2326
2327 ret = m_allInterfaces.iMotorEncoders->setMotorEncoder(j, val);
2328 if (!ret) {
2329 yCError(CB_RPC, "Unable to setMotorEncoder");
2330 }
2331 return ret;
2332}
2333
2335{
2337 ReturnValue ret;
2338 if (!m_allInterfaces.iMotorEncoders) {
2339 yCError(CB_RPC, "Invalid interface");
2340 ret = ReturnValue::return_code::return_value_error_not_ready;
2341 return ret;
2342 }
2343
2344 ret = m_allInterfaces.iMotorEncoders->setMotorEncoderCountsPerRevolution(j, val);
2345 if (!ret) {
2346 yCError(CB_RPC, "Unable to setMotorEncoderCountsPerRevolution");
2347 }
2348 return ret;
2349}
2350
2352{
2355 if (!m_allInterfaces.iMotorEncoders) {
2356 yCError(CB_RPC, "Invalid interface");
2357 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2358 return ret;
2359 }
2360
2361 ret.ret = m_allInterfaces.iMotorEncoders->getMotorEncoderCountsPerRevolution(m, &ret.cpr);
2362 if (!ret.ret) {
2363 yCError(CB_RPC, "Unable to getMotorEncoderCountsPerRevolution");
2364 }
2365 return ret;
2366}
2367
2369{
2371 ReturnValue ret;
2372 if (!m_allInterfaces.iMotorEncoders) {
2373 yCError(CB_RPC, "Invalid interface");
2374 ret = ReturnValue::return_code::return_value_error_not_ready;
2375 return ret;
2376 }
2377
2378 ret = m_allInterfaces.iMotorEncoders->setMotorEncoders(vals.data());
2379 if (!ret) {
2380 yCError(CB_RPC, "Unable to setMotorEncoders");
2381 return ReturnValue::return_code::return_value_error_generic;
2382 }
2383 return ret;
2384}
2385
2387{
2390 if (!m_allInterfaces.iMotorEncoders) {
2391 yCError(CB_RPC, "Invalid interface");
2392 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2393 return ret;
2394 }
2395
2396 ret.ret = m_allInterfaces.iMotorEncoders->getMotorEncoder(j, &ret.val);
2397 if (!ret.ret) {
2398 yCError(CB_RPC, "Unable to getMotorEncoder");
2399 }
2400 return ret;
2401}
2402
2404{
2407 if (!m_allInterfaces.iMotorEncoders) {
2408 yCError(CB_RPC, "Invalid interface");
2409 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2410 return ret;
2411 }
2412
2413 int nmotors = 0;
2414 ret.ret = m_allInterfaces.iMotorEncoders->getNumberOfMotorEncoders(&nmotors);
2415 if (!ret.ret) {
2416 yCError(CB_RPC, "Unable to getNumberOfMotorEncoders");
2417 return ret;
2418 }
2419 ret.val.resize(nmotors);
2420 ret.ret = m_allInterfaces.iMotorEncoders->getMotorEncoders(ret.val.data());
2421 if (!ret.ret) {
2422 yCError(CB_RPC, "Unable to getMotorEncoders");
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 ret.ret = m_allInterfaces.iMotorEncoders->getMotorEncoderTimed(j, &ret.val, &ret.time);
2438 if (!ret.ret) {
2439 yCError(CB_RPC, "Unable to getMotorEncoderTimed");
2440 }
2441 return ret;
2442}
2443
2445{
2448 if (!m_allInterfaces.iMotorEncoders) {
2449 yCError(CB_RPC, "Invalid interface");
2450 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2451 return ret;
2452 }
2453
2454 int nmotors = 0;
2455 ret.ret = m_allInterfaces.iMotorEncoders->getNumberOfMotorEncoders(&nmotors);
2456 if (!ret.ret) {
2457 yCError(CB_RPC, "Unable to getNumberOfMotorEncoders");
2458 return ret;
2459 }
2460 ret.val.resize(nmotors);
2461 ret.time.resize(nmotors);
2462 ret.ret = m_allInterfaces.iMotorEncoders->getMotorEncodersTimed(ret.val.data(), ret.time.data());
2463 if (!ret.ret) {
2464 yCError(CB_RPC, "Unable to getMotorEncodersTimed");
2465 }
2466 return ret;
2467}
2468
2470{
2473 if (!m_allInterfaces.iMotorEncoders) {
2474 yCError(CB_RPC, "Invalid interface");
2475 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2476 return ret;
2477 }
2478
2479 ret.ret = m_allInterfaces.iMotorEncoders->getMotorEncoderSpeed(j, &ret.val);
2480 if (!ret.ret) {
2481 yCError(CB_RPC, "Unable to getMotorEncoderSpeed");
2482 }
2483 return ret;
2484}
2485
2487{
2490 if (!m_allInterfaces.iMotorEncoders) {
2491 yCError(CB_RPC, "Invalid interface");
2492 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2493 return ret;
2494 }
2495
2496 int nmotors = 0;
2497 ret.ret = m_allInterfaces.iMotorEncoders->getNumberOfMotorEncoders(&nmotors);
2498 if (!ret.ret) {
2499 yCError(CB_RPC, "Unable to getNumberOfMotorEncoders");
2500 return ret;
2501 }
2502 ret.val.resize(nmotors);
2503 ret.ret = m_allInterfaces.iMotorEncoders->getMotorEncoderSpeeds(ret.val.data());
2504 if (!ret.ret) {
2505 yCError(CB_RPC, "Unable to getMotorEncoderSpeeds");
2506 }
2507 return ret;
2508}
2509
2511{
2514 if (!m_allInterfaces.iMotorEncoders) {
2515 yCError(CB_RPC, "Invalid interface");
2516 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2517 return ret;
2518 }
2519
2520 ret.ret = m_allInterfaces.iMotorEncoders->getMotorEncoderAcceleration(j, &ret.val);
2521 if (!ret.ret) {
2522 yCError(CB_RPC, "Unable to getMotorEncoderAcceleration");
2523 }
2524 return ret;
2525}
2526
2528{
2531 if (!m_allInterfaces.iMotorEncoders) {
2532 yCError(CB_RPC, "Invalid interface");
2533 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2534 return ret;
2535 }
2536
2537 int nmotors = 0;
2538 ret.ret = m_allInterfaces.iMotorEncoders->getNumberOfMotorEncoders(&nmotors);
2539 if (!ret.ret) {
2540 yCError(CB_RPC, "Unable to getNumberOfMotorEncoders");
2541 return ret;
2542 }
2543 ret.val.resize(nmotors);
2544 ret.ret = m_allInterfaces.iMotorEncoders->getMotorEncoderAccelerations(ret.val.data());
2545 if (!ret.ret) {
2546 yCError(CB_RPC, "Unable to getMotorEncoderAccelerations");
2547 }
2548 return ret;
2549}
2550
2552{
2555 if (!m_allInterfaces.iMotorEncoders) {
2556 yCError(CB_RPC, "Invalid interface");
2557 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2558 return ret;
2559 }
2560
2561 ret.ret = m_allInterfaces.iMotorEncoders->getNumberOfMotorEncoders(&ret.num);
2562 if (!ret.ret) {
2563 yCError(CB_RPC, "Unable to getNumberOfMotorEncoders");
2564 }
2565 return ret;
2566}
2567
2568
2569//------- ITorque
2570ReturnValue ControlBoardRPCd::setRefTorqueOneRPC(const std::int32_t j, const double vel)
2571{
2573 ReturnValue ret;
2574 if (!m_allInterfaces.iTorqueControl) {
2575 yCError(CB_RPC, "Invalid interface");
2576 ret = ReturnValue::return_code::return_value_error_not_ready;
2577 return ret;
2578 }
2579
2580 ret = m_allInterfaces.iTorqueControl->setRefTorque(j, vel);
2581 if (!ret) {
2582 yCError(CB_RPC, "setRefTorque() failed");
2583 }
2584 return ret;
2585}
2586
2588{
2590 ReturnValue ret;
2591 if (!m_allInterfaces.iTorqueControl) {
2592 yCError(CB_RPC, "Invalid interface");
2593 ret = ReturnValue::return_code::return_value_error_not_ready;
2594 return ret;
2595 }
2596
2597 ret = m_allInterfaces.iTorqueControl->setRefTorques(trq.data());
2598 if (!ret) {
2599 yCError(CB_RPC, "setRefTorques() failed");
2600 }
2601 return ret;
2602}
2603
2604ReturnValue ControlBoardRPCd::setRefTorqueGroupRPC(const std::vector<std::int32_t>& j, const std::vector<double>& trq)
2605{
2607 ReturnValue ret;
2608 if (!m_allInterfaces.iTorqueControl) {
2609 yCError(CB_RPC, "Invalid interface");
2610 ret = ReturnValue::return_code::return_value_error_not_ready;
2611 return ret;
2612 }
2613
2614 ret = m_allInterfaces.iTorqueControl->setRefTorques(j.size(), j.data(), trq.data());
2615 if (!ret) {
2616 yCError(CB_RPC, "setRefTorques() failed");
2617 }
2618 return ret;
2619}
2620
2622{
2625 if (!m_allInterfaces.iTorqueControl) {
2626 yCError(CB_RPC, "Invalid interface");
2627 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2628 return ret;
2629 }
2630
2631 ret.ret = m_allInterfaces.iTorqueControl->getRefTorque(j, &ret.val);
2632 if (!ret.ret) {
2633 yCError(CB_RPC, "Unable to getRefTorque");
2634 }
2635 return ret;
2636}
2637
2639{
2642 if (!m_allInterfaces.iTorqueControl) {
2643 yCError(CB_RPC, "Invalid interface");
2644 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2645 return ret;
2646 }
2647
2648 ret.val.resize(m_njoints);
2649 ret.ret = m_allInterfaces.iTorqueControl->getRefTorques(ret.val.data());
2650 if (!ret.ret) {
2651 yCError(CB_RPC, "Unable to getRefTorques");
2652 }
2653 return ret;
2654}
2655
2657{
2660 if (!m_allInterfaces.iTorqueControl) {
2661 yCError(CB_RPC, "Invalid interface");
2662 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2663 return ret;
2664 }
2665
2666 ret.val.resize(j.size());
2667 //iTorqueControl interface does not have a group method
2669 return ret;
2670}
2671
2673{
2676 if (!m_allInterfaces.iTorqueControl) {
2677 yCError(CB_RPC, "Invalid interface");
2678 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2679 return ret;
2680 }
2681
2682 ret.ret = m_allInterfaces.iTorqueControl->getTorqueRange(j, &ret.min, &ret.max);
2683 if (!ret.ret) {
2684 yCError(CB_RPC, "Unable to getTorqueRange");
2685 }
2686 return ret;
2687}
2688
2690{
2693 if (!m_allInterfaces.iTorqueControl) {
2694 yCError(CB_RPC, "Invalid interface");
2695 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2696 return ret;
2697 }
2698
2699 ret.mins.resize(m_njoints);
2700 ret.maxs.resize(m_njoints);
2701 ret.ret = m_allInterfaces.iTorqueControl->getTorqueRanges(ret.mins.data(),ret.maxs.data());
2702 if (!ret.ret) {
2703 yCError(CB_RPC, "Unable to getTorqueRanges");
2704 }
2705 return ret;
2706}
2707
2708//------- IPositionDirect
2709
2711{
2713 ReturnValue ret;
2714 if (!m_allInterfaces.iPositionDirect) {
2715 yCError(CB_RPC, "Invalid interface");
2716 ret = ReturnValue::return_code::return_value_error_not_ready;
2717 return ret;
2718 }
2719
2720 ret = m_allInterfaces.iPositionDirect->setPosition(j, ref);
2721 if (!ret) {
2722 yCError(CB_RPC, "Unable to setPosition");
2723 }
2724 return ret;
2725}
2726
2728{
2730 ReturnValue ret;
2731 if (!m_allInterfaces.iPositionDirect) {
2732 yCError(CB_RPC, "Invalid interface");
2733 ret = ReturnValue::return_code::return_value_error_not_ready;
2734 return ret;
2735 }
2736
2737 ret = m_allInterfaces.iPositionDirect->setPositions(refs.data());
2738 if (!ret) {
2739 yCError(CB_RPC, "Unable to setPositions");
2740 }
2741 return ret;
2742}
2743
2744yarp::dev::ReturnValue ControlBoardRPCd::setRefPositionGroupRPC(const std::vector<std::int32_t>& joints, const std::vector<double>& refs)
2745{
2747 ReturnValue ret;
2748 if (!m_allInterfaces.iPositionDirect) {
2749 yCError(CB_RPC, "Invalid interface");
2750 ret = ReturnValue::return_code::return_value_error_not_ready;
2751 return ret;
2752 }
2753
2754 ret = m_allInterfaces.iPositionDirect->setPositions(joints.size(), joints.data(), refs.data());
2755 if (!ret) {
2756 yCError(CB_RPC, "Unable to setPositions");
2757 }
2758 return ret;
2759}
2760
2761
2763{
2766 if (!m_allInterfaces.iPositionDirect) {
2767 yCError(CB_RPC, "Invalid interface");
2768 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2769 return ret;
2770 }
2771
2772 ret.ret = m_allInterfaces.iPositionDirect->getRefPosition(j, &ret.val);
2773 if (!ret.ret) {
2774 yCError(CB_RPC, "Unable to getRefPosition");
2775 }
2776 return ret;
2777}
2778
2780{
2783 if (!m_allInterfaces.iPositionDirect) {
2784 yCError(CB_RPC, "Invalid interface");
2785 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2786 return ret;
2787 }
2788
2789 ret.val.resize(m_njoints);
2790 ret.ret = m_allInterfaces.iPositionDirect->getRefPositions(ret.val.data());
2791 if (!ret.ret) {
2792 yCError(CB_RPC, "Unable to getRefPositions");
2793 }
2794 return ret;
2795}
2796
2798{
2801 if (!m_allInterfaces.iPositionDirect) {
2802 yCError(CB_RPC, "Invalid interface");
2803 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
2804 return ret;
2805 }
2806
2807 ret.val.resize(j.size());
2808 ret.ret = m_allInterfaces.iPositionDirect->getRefPositions(j.size(), j.data(), ret.val.data());
2809 if (!ret.ret) {
2810 yCError(CB_RPC, "Unable to getRefPositions");
2811 }
2812 return ret;
2813}
2814
2815//------- IPositionControl
2816
2818{
2820 ReturnValue ret;
2821 if (!m_allInterfaces.iPositionControl) {
2822 yCError(CB_RPC, "Invalid interface");
2823 ret = ReturnValue::return_code::return_value_error_not_ready;
2824 return ret;
2825 }
2826
2827 ret = m_allInterfaces.iPositionControl->positionMove(j, ref);
2828 if (!ret) {
2829 yCError(CB_RPC, "Unable to positionMove");
2830 }
2831 return ret;
2832}
2833
2834yarp::dev::ReturnValue ControlBoardRPCd::positionMoveGroupRPC(const std::vector<std::int32_t>& joints, const std::vector<double>& refs)
2835{
2837 ReturnValue ret;
2838 if (!m_allInterfaces.iPositionControl) {
2839 yCError(CB_RPC, "Invalid interface");
2840 ret = ReturnValue::return_code::return_value_error_not_ready;
2841 return ret;
2842 }
2843
2844 ret = m_allInterfaces.iPositionControl->positionMove(joints.size(), joints.data(), refs.data());
2845 if (!ret) {
2846 yCError(CB_RPC, "Unable to positionMove");
2847 return ReturnValue::return_code::return_value_error_generic;
2848 }
2849 return ret;
2850}
2851
2853{
2855 ReturnValue ret;
2856 if (!m_allInterfaces.iPositionControl) {
2857 yCError(CB_RPC, "Invalid interface");
2858 ret = ReturnValue::return_code::return_value_error_not_ready;
2859 return ret;
2860 }
2861
2862 ret = m_allInterfaces.iPositionControl->positionMove(refs.data());
2863 if (!ret) {
2864 yCError(CB_RPC, "Unable to positionMove");
2865 return ReturnValue::return_code::return_value_error_generic;
2866 }
2867 return ret;
2868}
2869
2870yarp::dev::ReturnValue ControlBoardRPCd::relativeMoveOneRPC(const std::int32_t j, const double delta)
2871{
2873 ReturnValue ret;
2874 if (!m_allInterfaces.iPositionControl) {
2875 yCError(CB_RPC, "Invalid interface");
2876 ret = ReturnValue::return_code::return_value_error_not_ready;
2877 return ret;
2878 }
2879
2880 ret = m_allInterfaces.iPositionControl->relativeMove(j, delta);
2881 if (!ret) {
2882 yCError(CB_RPC, "Unable to relativeMove");
2883 }
2884 return ret;
2885}
2886
2887yarp::dev::ReturnValue ControlBoardRPCd::relativeMoveGroupRPC(const std::vector<std::int32_t>& joints, const std::vector<double>& refs)
2888{
2890 ReturnValue ret;
2891 if (!m_allInterfaces.iPositionControl) {
2892 yCError(CB_RPC, "Invalid interface");
2893 ret = ReturnValue::return_code::return_value_error_not_ready;
2894 return ret;
2895 }
2896
2897 ret = m_allInterfaces.iPositionControl->relativeMove(joints.size(), joints.data(), refs.data());
2898 if (!ret) {
2899 yCError(CB_RPC, "Unable to relativeMove");
2900 return ReturnValue::return_code::return_value_error_generic;
2901 }
2902 return ret;
2903}
2904
2906{
2908 ReturnValue ret;
2909 if (!m_allInterfaces.iPositionControl) {
2910 yCError(CB_RPC, "Invalid interface");
2911 ret = ReturnValue::return_code::return_value_error_not_ready;
2912 return ret;
2913 }
2914
2915 ret = m_allInterfaces.iPositionControl->relativeMove(deltas.data());
2916 if (!ret) {
2917 yCError(CB_RPC, "Unable to relativeMove");
2918 return ReturnValue::return_code::return_value_error_generic;
2919 }
2920 return ret;
2921}
2922
2924{
2926 ReturnValue ret;
2927 if (!m_allInterfaces.iPositionControl) {
2928 yCError(CB_RPC, "Invalid interface");
2929 ret = ReturnValue::return_code::return_value_error_not_ready;
2930 return ret;
2931 }
2932
2933 ret = m_allInterfaces.iPositionControl->setTrajSpeed(j, sp);
2934 if (!ret) {
2935 yCError(CB_RPC, "Unable to setTrajSpeed");
2936 return ReturnValue::return_code::return_value_error_generic;
2937 }
2938 return ret;
2939}
2940
2941yarp::dev::ReturnValue ControlBoardRPCd::setTrajSpeedGroupRPC(const std::vector<std::int32_t>& joints, const std::vector<double>& spds)
2942{
2944 ReturnValue ret;
2945 if (!m_allInterfaces.iPositionControl) {
2946 yCError(CB_RPC, "Invalid interface");
2947 ret = ReturnValue::return_code::return_value_error_not_ready;
2948 return ret;
2949 }
2950
2951 ret = m_allInterfaces.iPositionControl->setTrajSpeeds(joints.size(), joints.data(), spds.data());
2952 if (!ret) {
2953 yCError(CB_RPC, "Unable to setTrajSpeeds");
2954 return ReturnValue::return_code::return_value_error_generic;
2955 }
2956 return ret;
2957}
2958
2960{
2962 ReturnValue ret;
2963 if (!m_allInterfaces.iPositionControl) {
2964 yCError(CB_RPC, "Invalid interface");
2965 ret = ReturnValue::return_code::return_value_error_not_ready;
2966 return ret;
2967 }
2968
2969 ret = m_allInterfaces.iPositionControl->setTrajSpeeds(spds.data());
2970 if (!ret) {
2971 yCError(CB_RPC, "Unable to setTrajSpeeds");
2972 return ReturnValue::return_code::return_value_error_generic;
2973 }
2974 return ret;
2975}
2976
2978{
2980 ReturnValue ret;
2981 if (!m_allInterfaces.iPositionControl) {
2982 yCError(CB_RPC, "Invalid interface");
2983 ret = ReturnValue::return_code::return_value_error_not_ready;
2984 return ret;
2985 }
2986
2987 ret = m_allInterfaces.iPositionControl->setTrajAcceleration(j, acc);
2988 if (!ret) {
2989 yCError(CB_RPC, "Unable to setTrajAcceleration");
2990 }
2991 return ret;
2992}
2993
2994yarp::dev::ReturnValue ControlBoardRPCd::setTrajAccelerationsGroupRPC(const std::vector<std::int32_t>& joints, const std::vector<double>& accs)
2995{
2997 ReturnValue ret;
2998 if (!m_allInterfaces.iPositionControl) {
2999 yCError(CB_RPC, "Invalid interface");
3000 ret = ReturnValue::return_code::return_value_error_not_ready;
3001 return ret;
3002 }
3003
3004 ret = m_allInterfaces.iPositionControl->setTrajAccelerations(joints.size(), joints.data(), accs.data());
3005 if (!ret) {
3006 yCError(CB_RPC, "Unable to setTrajAccelerations");
3007 return ReturnValue::return_code::return_value_error_generic;
3008 }
3009 return ret;
3010}
3011
3013{
3015 ReturnValue ret;
3016 if (!m_allInterfaces.iPositionControl) {
3017 yCError(CB_RPC, "Invalid interface");
3018 ret = ReturnValue::return_code::return_value_error_not_ready;
3019 return ret;
3020 }
3021
3022 ret = m_allInterfaces.iPositionControl->setTrajAccelerations(accs.data());
3023 if (!ret) {
3024 yCError(CB_RPC, "Unable to setTrajAccelerations");
3025 return ReturnValue::return_code::return_value_error_generic;
3026 }
3027 return ret;
3028}
3029
3031{
3033 ReturnValue ret;
3034 if (!m_allInterfaces.iPositionControl) {
3035 yCError(CB_RPC, "Invalid interface");
3036 ret = ReturnValue::return_code::return_value_error_not_ready;
3037 return ret;
3038 }
3039
3040 ret = m_allInterfaces.iPositionControl->stop(j);
3041 if (!ret) {
3042 yCError(CB_RPC, "Unable to stop");
3043 }
3044 return ret;
3045}
3046
3047yarp::dev::ReturnValue ControlBoardRPCd::stopGroupRPC(const std::vector<std::int32_t>& joints)
3048{
3050 ReturnValue ret;
3051 if (!m_allInterfaces.iPositionControl) {
3052 yCError(CB_RPC, "Invalid interface");
3053 ret = ReturnValue::return_code::return_value_error_not_ready;
3054 return ret;
3055 }
3056
3057 ret = m_allInterfaces.iPositionControl->stop(joints.size(),joints.data());
3058 if (!ret) {
3059 yCError(CB_RPC, "Unable to stop");
3060 }
3061 return ret;
3062}
3063
3065{
3067 ReturnValue ret;
3068 if (!m_allInterfaces.iPositionControl) {
3069 yCError(CB_RPC, "Invalid interface");
3070 ret = ReturnValue::return_code::return_value_error_not_ready;
3071 return ret;
3072 }
3073
3074 ret = m_allInterfaces.iPositionControl->stop();
3075 if (!ret) {
3076 yCError(CB_RPC, "Unable to stop");
3077 }
3078 return ret;
3079}
3080
3082{
3084 ReturnValue ret;
3085 if (!m_allInterfaces.iVelocityControl) {
3086 yCError(CB_RPC, "Invalid interface");
3087 ret = ReturnValue::return_code::return_value_error_not_ready;
3088 return ret;
3089 }
3090
3091 ret = m_allInterfaces.iVelocityControl->velocityMove(j, ref);
3092 if (!ret) {
3093 yCError(CB_RPC, "Unable to velocityMove");
3094 }
3095 return ret;
3096}
3097
3098yarp::dev::ReturnValue ControlBoardRPCd::velocityMoveGroupRPC(const std::vector<std::int32_t>& joints, const std::vector<double>& refs)
3099{
3101 ReturnValue ret;
3102 if (!m_allInterfaces.iVelocityControl) {
3103 yCError(CB_RPC, "Invalid interface");
3104 ret = ReturnValue::return_code::return_value_error_not_ready;
3105 return ret;
3106 }
3107
3108 ret = m_allInterfaces.iVelocityControl->velocityMove(joints.size(), joints.data(), refs.data());
3109 if (!ret) {
3110 yCError(CB_RPC, "Unable to velocityMove");
3111 }
3112 return ret;
3113}
3114
3116{
3118 ReturnValue ret;
3119 if (!m_allInterfaces.iVelocityControl) {
3120 yCError(CB_RPC, "Invalid interface");
3121 ret = ReturnValue::return_code::return_value_error_not_ready;
3122 return ret;
3123 }
3124
3125 ret = m_allInterfaces.iVelocityControl->velocityMove(refs.data());
3126 if (!ret) {
3127 yCError(CB_RPC, "Unable to velocityMove");
3128 }
3129 return ret;
3130}
3131
3132
3134{
3137 if (!m_allInterfaces.iPositionControl) {
3138 yCError(CB_RPC, "Invalid interface");
3139 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
3140 return ret;
3141 }
3142
3143 ret.ret = m_allInterfaces.iPositionControl->getTargetPosition(j, &ret.val);
3144 if (!ret.ret) {
3145 yCError(CB_RPC, "Unable to getTargetPosition");
3146 }
3147 return ret;
3148}
3149
3151{
3154 if (!m_allInterfaces.iPositionControl) {
3155 yCError(CB_RPC, "Invalid interface");
3156 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
3157 return ret;
3158 }
3159
3160 ret.val.resize(joints.size());
3161 ret.ret = m_allInterfaces.iPositionControl->getTargetPositions(joints.size(), joints.data(), ret.val.data());
3162 if (!ret.ret) {
3163 yCError(CB_RPC, "Unable to getTargetPositions");
3164 }
3165 return ret;
3166}
3167
3169{
3172 if (!m_allInterfaces.iPositionControl) {
3173 yCError(CB_RPC, "Invalid interface");
3174 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
3175 return ret;
3176 }
3177
3178 ret.val.resize(m_njoints);
3179 ret.ret = m_allInterfaces.iPositionControl->getTargetPositions(ret.val.data());
3180 if (!ret.ret) {
3181 yCError(CB_RPC, "Unable to getTargetPositions");
3182 }
3183 return ret;
3184}
3185
3187{
3190 if (!m_allInterfaces.iPositionControl) {
3191 yCError(CB_RPC, "Invalid interface");
3192 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
3193 return ret;
3194 }
3195
3196 ret.ret = m_allInterfaces.iPositionControl->getTrajSpeed(j, &ret.val);
3197 if (!ret.ret) {
3198 yCError(CB_RPC, "Unable to getTrajSpeed");
3199 }
3200 return ret;
3201}
3202
3203return_getTrajSpeedsGroup ControlBoardRPCd::getTrajSpeedsGroupRPC(const std::vector<std::int32_t>& joints) const
3204{
3207 if (!m_allInterfaces.iPositionControl) {
3208 yCError(CB_RPC, "Invalid iPositionControl interface");
3210 return ret;
3211 }
3212 ret.val.resize(joints.size());
3213 ret.ret = m_allInterfaces.iPositionControl->getTrajSpeeds(joints.size(), joints.data(), ret.val.data());
3214 if (!ret.ret) {
3215 yCError(CB_RPC, "getTrajSpeeds() failed");
3216 }
3217 return ret;
3218}
3219
3221{
3224 if (!m_allInterfaces.iPositionControl) {
3225 yCError(CB_RPC, "Invalid iPositionControl interface");
3227 return ret;
3228 }
3229 ret.val.resize(m_njoints);
3230 ret.ret = m_allInterfaces.iPositionControl->getTrajSpeeds(ret.val.data());
3231 if (!ret.ret) {
3232 yCError(CB_RPC, "getTrajSpeeds() failed");
3233 }
3234 return ret;
3235}
3236
3238{
3241 if (!m_allInterfaces.iPositionControl) {
3242 yCError(CB_RPC, "Invalid interface");
3243 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
3244 return ret;
3245 }
3246
3247 ret.ret = m_allInterfaces.iPositionControl->getTrajAcceleration(j, &ret.val);
3248 if (!ret.ret) {
3249 yCError(CB_RPC, "Unable to getTrajAcceleration");
3250 }
3251 return ret;
3252}
3253
3255{
3258 if (!m_allInterfaces.iPositionControl) {
3259 yCError(CB_RPC, "Invalid iPositionControl interface");
3261 return ret;
3262 }
3263 ret.val.resize(joints.size());
3264 ret.ret = m_allInterfaces.iPositionControl->getTrajAccelerations(joints.size(), joints.data(), ret.val.data());
3265 if (!ret.ret) {
3266 yCError(CB_RPC, "getTrajAccelerations() failed");
3267 }
3268 return ret;
3269}
3270
3272{
3275 if (!m_allInterfaces.iPositionControl) {
3276 yCError(CB_RPC, "Invalid iPositionControl interface");
3278 return ret;
3279 }
3280 ret.val.resize(m_njoints);
3281 ret.ret = m_allInterfaces.iPositionControl->getTrajAccelerations(ret.val.data());
3282 if (!ret.ret) {
3283 yCError(CB_RPC, "getTrajAccelerations() failed");
3284 }
3285 return ret;
3286}
3287
3289{
3292 if (!m_allInterfaces.iPositionControl) {
3293 yCError(CB_RPC, "Invalid interface");
3294 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
3295 return ret;
3296 }
3297
3298 ret.ret = m_allInterfaces.iPositionControl->checkMotionDone(j, ret.flag);
3299 if (!ret.ret) {
3300 yCError(CB_RPC, "Unable to checkMotionDone");
3301 }
3302 return ret;
3303}
3304
3306{
3309 if (!m_allInterfaces.iPositionControl) {
3310 yCError(CB_RPC, "Invalid iPositionControl interface");
3312 return ret;
3313 }
3314
3315 ret.ret = m_allInterfaces.iPositionControl->checkMotionDone(joints, ret.flag);
3316 if (!ret.ret) {
3317 yCError(CB_RPC, "checkMotionDone() failed");
3318 }
3319 return ret;
3320}
3321
3323{
3326 if (!m_allInterfaces.iPositionControl) {
3327 yCError(CB_RPC, "Invalid iPositionControl interface");
3329 return ret;
3330 }
3331
3332 ret.ret = m_allInterfaces.iPositionControl->checkMotionDone(ret.flag);
3333 if (!ret.ret) {
3334 yCError(CB_RPC, "checkMotionDone() failed");
3335 }
3336 return ret;
3337}
3338
3339//------- IMotorControl
3340
3342{
3345 if (!m_allInterfaces.iMotor) {
3346 yCError(CB_RPC, "Invalid interface");
3347 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
3348 return ret;
3349 }
3350
3351 ret.ret = m_allInterfaces.iMotor->getNumberOfMotors(&ret.val);
3352 if (!ret.ret) {
3353 yCError(CB_RPC, "Unable to getNumberOfMotors");
3354 }
3355 return ret;
3356}
3357
3359{
3362 if (!m_allInterfaces.iMotor) {
3363 yCError(CB_RPC, "Invalid interface");
3364 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
3365 return ret;
3366 }
3367
3368 ret.ret = m_allInterfaces.iMotor->getTemperature(m,&ret.val);
3369 if (!ret.ret) {
3370 yCError(CB_RPC, "Unable to getTemperature");
3371 }
3372 return ret;
3373}
3374
3376{
3379 if (!m_allInterfaces.iMotor) {
3380 yCError(CB_RPC, "Invalid iMotor interface");
3382 return ret;
3383 }
3384 int nmotors = 0;
3385 ret.ret = m_allInterfaces.iMotor->getNumberOfMotors(&nmotors);
3386 if (!ret.ret) {
3387 yCError(CB_RPC, "Unable to getNumberOfMotors");
3388 return ret;
3389 }
3390 ret.val.resize(nmotors);
3391 ret.ret = m_allInterfaces.iMotor->getTemperatures(ret.val.data());
3392 if (!ret.ret) {
3393 yCError(CB_RPC, "getTemperatures() failed");
3394 }
3395 return ret;
3396}
3397
3399{
3402 if (!m_allInterfaces.iMotor) {
3403 yCError(CB_RPC, "Invalid interface");
3404 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
3405 return ret;
3406 }
3407
3408 ret.ret = m_allInterfaces.iMotor->getTemperatureLimit(m,&ret.val);
3409 if (!ret.ret) {
3410 yCError(CB_RPC, "Unable to getTemperatureLimit");
3411 }
3412 return ret;
3413}
3414
3416{
3418 ReturnValue ret;
3419 if (!m_allInterfaces.iMotor) {
3420 yCError(CB_RPC, "Invalid interface");
3421 ret = ReturnValue::return_code::return_value_error_not_ready;
3422 return ret;
3423 }
3424
3425 ret = m_allInterfaces.iMotor->setTemperatureLimit(m, val);
3426 if (!ret) {
3427 yCError(CB_RPC, "Unable to setTemperatureLimit");
3428 }
3429 return ret;
3430}
3431
3433{
3436 if (!m_allInterfaces.iMotor) {
3437 yCError(CB_RPC, "Invalid interface");
3438 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
3439 return ret;
3440 }
3441
3442 ret.ret = m_allInterfaces.iMotor->getGearboxRatio(m,&ret.val);
3443 if (!ret.ret) {
3444 yCError(CB_RPC, "Unable to getGearboxRatio");
3445 }
3446 return ret;
3447}
3448
3450{
3452 ReturnValue ret;
3453 if (!m_allInterfaces.iMotor) {
3454 yCError(CB_RPC, "Invalid interface");
3455 ret = ReturnValue::return_code::return_value_error_not_ready;
3456 return ret;
3457 }
3458
3459 ret = m_allInterfaces.iMotor->setGearboxRatio(m, val);
3460 if (!ret) {
3461 yCError(CB_RPC, "Unable to setGearboxRatio");
3462 }
3463 return ret;
3464}
3465
3466//------- IMotorControl
3468{
3470 ReturnValue ret;
3471 if (!m_allInterfaces.iTorqueControl) {
3472 yCError(CB_RPC, "Invalid interface");
3473 ret = ReturnValue::return_code::return_value_error_not_ready;
3474 return ret;
3475 }
3476
3478 params.bemf = yparams.bemf;
3479 params.bemf_scale = yparams.bemf_scale;
3480 params.coulombNeg = yparams.coulombNeg;
3481 params.coulombPos = yparams.coulombPos;
3482 params.ktau = yparams.ktau;
3483 params.ktau_scale = yparams.ktau_scale;
3484 params.velocityThres = yparams.velocityThres;
3485 params.viscousNeg = yparams.viscousNeg;
3486 params.viscousPos = yparams.viscousPos;
3487 ret = m_allInterfaces.iTorqueControl->setMotorTorqueParams(j, params);
3488 if (!ret) {
3489 yCError(CB_RPC, "Unable to setMotorTorqueParams");
3490 }
3491 return ret;
3492}
3493
3495{
3498 if (!m_allInterfaces.iTorqueControl) {
3499 yCError(CB_RPC, "Invalid interface");
3500 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
3501 return ret;
3502 }
3503
3505 ret.ret = m_allInterfaces.iTorqueControl->getMotorTorqueParams(j,&params);
3506 if (!ret.ret) {
3507 yCError(CB_RPC, "Unable to getMotorTorqueParams");
3508 return ret;
3509 }
3510 ret.params.bemf = params.bemf;
3511 ret.params.bemf_scale = params.bemf_scale;
3512 ret.params.coulombNeg = params.coulombNeg;
3513 ret.params.coulombPos = params.coulombPos;
3514 ret.params.ktau = params.ktau;
3515 ret.params.ktau_scale = params.ktau_scale;
3516 ret.params.velocityThres = params.velocityThres;
3517 ret.params.viscousNeg = params.viscousNeg;
3518 ret.params.viscousPos = params.viscousPos;
3519 return ret;
3520}
3521
3522//------- IVelocityControl
3524{
3527 if (!m_allInterfaces.iVelocityControl) {
3528 yCError(CB_RPC, "Invalid interface");
3529 ret.ret = ReturnValue::return_code::return_value_error_not_ready;
3530 return ret;
3531 }
3532
3533 ret.ret = m_allInterfaces.iVelocityControl->getTargetVelocity(j,&ret.val);
3534 if (!ret.ret) {
3535 yCError(CB_RPC, "Unable to getTargetVelocity");
3536 }
3537 return ret;
3538}
3539
3541{
3544 if (!m_allInterfaces.iVelocityControl) {
3545 yCError(CB_RPC, "Invalid iVelocityControl interface");
3547 return ret;
3548 }
3549 ret.val.resize(joints.size());
3550 ret.ret = m_allInterfaces.iVelocityControl->getTargetVelocities(joints.size(), joints.data(), ret.val.data());
3551 if (!ret.ret) {
3552 yCError(CB_RPC, "getTargetVelocity() failed");
3553 }
3554 return ret;
3555}
3556
3558{
3561 if (!m_allInterfaces.iVelocityControl) {
3562 yCError(CB_RPC, "Invalid iVelocityControl interface");
3564 return ret;
3565 }
3566 ret.val.resize(m_njoints);
3567 ret.ret = m_allInterfaces.iVelocityControl->getTargetVelocities(ret.val.data());
3568 if (!ret.ret) {
3569 yCError(CB_RPC, "getTargetVelocity() failed");
3570 }
3571 return ret;
3572}
3573
3575{
3577 ret.ret = ReturnValue_ok;
3578 ret.interfaces["iAmplifierControl"] = m_allInterfaces.iAmplifierControl!=nullptr;
3579 ret.interfaces["iAxisInfo"] = m_allInterfaces.iAxisInfo!=nullptr;
3580 ret.interfaces["iControlCalibration"] = m_allInterfaces.iControlCalibration!=nullptr;
3581 ret.interfaces["iControlLimits"] = m_allInterfaces.iControlLimits!=nullptr;
3582 ret.interfaces["iControlMode"] = m_allInterfaces.iControlMode!=nullptr;
3583 ret.interfaces["iCurrentControl"] = m_allInterfaces.iCurrentControl!=nullptr;
3584 ret.interfaces["iEncodersTimed"] = m_allInterfaces.iEncodersTimed!=nullptr;
3585 ret.interfaces["iImpedanceControl"] = m_allInterfaces.iImpedanceControl!=nullptr;
3586 ret.interfaces["iInteractionMode"] = m_allInterfaces.iInteractionMode!=nullptr;
3587 ret.interfaces["iJointBrake"] = m_allInterfaces.iJointBrake!=nullptr;
3588 ret.interfaces["iJointFault"] = m_allInterfaces.iJointFault!=nullptr;
3589 ret.interfaces["iMotor"] = m_allInterfaces.iMotor!=nullptr;
3590 ret.interfaces["iMotorEncoders"] = m_allInterfaces.iMotorEncoders!=nullptr;
3591 ret.interfaces["iPidControl"] = m_allInterfaces.iPidControl!=nullptr;
3592 ret.interfaces["iPositionControl"] = m_allInterfaces.iPositionControl!=nullptr;
3593 ret.interfaces["iPositionDirect"] = m_allInterfaces.iPositionDirect!=nullptr;
3594 ret.interfaces["iPreciselyTimed"] = m_allInterfaces.iPreciselyTimed!=nullptr;
3595 ret.interfaces["iPWMControl"] = m_allInterfaces.iPWMControl!=nullptr;
3596 ret.interfaces["iRemoteCalibrator"] = m_allInterfaces.iRemoteCalibrator!=nullptr;
3597 ret.interfaces["iRemoteVariables"] = m_allInterfaces.iRemoteVariables!=nullptr;
3598 ret.interfaces["iTorqueControl"] = m_allInterfaces.iTorqueControl!=nullptr;
3599 ret.interfaces["iVelocityControl"] = m_allInterfaces.iVelocityControl!=nullptr;
3600 ret.interfaces["iVelocityDirect"] = m_allInterfaces.iVelocityDirect!=nullptr;
3601 return ret;
3602}
#define LOCKMUTEXSERVER
FeatureMode mode
#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
return_getControlModeGroup getControlModeGroupRPC(const std::vector< 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_getControlModeOne getControlModeOneRPC(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_getControlModeAll getControlModeAllRPC() const 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 getControlMode(int j, yarp::dev::ControlModeEnum &mode)=0
Get the current control mode.
virtual yarp::dev::ReturnValue getControlModes(std::vector< yarp::dev::ControlModeEnum > &mode)=0
Get the current control mode (multiple joints).
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:64
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.
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