@@ -87,47 +87,15 @@ class BraccioClass
8787 inline bool begin () { return begin (nullptr ); }
8888 bool begin (voidFuncPtr customMenu);
8989
90- // setters
91- MotorsWrapper move (int joint_index) {
92- MotorsWrapper wrapper (servos, joint_index);
93- return wrapper;
94- }
95- MotorsWrapper get (int joint_index) {
96- return move (joint_index);
97- }
98- void moveTo (int joint_index, int position) {
99- // servos.setPosition(joint_index, position, 100);
100- }
101- void moveTo (int joint_index, float angle) {
102- servos.setPosition (joint_index, angle, 100 );
103- }
104- void moveTo (float a1, float a2, float a3, float a4, float a5, float a6) {
105- servos.setPositionMode (PositionMode::SYNC);
106- servos.setPosition (1 , a1, runTime);
107- servos.setPosition (2 , a2, runTime);
108- servos.setPosition (3 , a3, runTime);
109- servos.setPosition (4 , a4, runTime);
110- servos.setPosition (5 , a5, runTime);
111- servos.setPosition (6 , a6, runTime);
112- servos.synchronize ();
113- servos.setPositionMode (PositionMode::IMMEDIATE);
114- }
115- // getters
116- void positions (float * buffer) {
117- for (int i = 1 ; i < 7 ; i++) {
118- *buffer++ = servos.getPosition (i);
119- }
120- }
121- void positions (float & a1, float & a2, float & a3, float & a4, float & a5, float & a6) {
122- // TODO: add check if motors are actually connected
123- a1 = servos.getPosition (1 );
124- a2 = servos.getPosition (2 );
125- a3 = servos.getPosition (3 );
126- a4 = servos.getPosition (4 );
127- a5 = servos.getPosition (5 );
128- a6 = servos.getPosition (6 );
129- }
130- float position (int joint_index);
90+
91+ MotorsWrapper move (int const id);
92+ inline MotorsWrapper get (int const id) { return move (id); }
93+
94+ void moveTo (float const a1, float const a2, float const a3, float const a4, float const a5, float const a6);
95+ void positions (float * buffer);
96+ void positions (float & a1, float & a2, float & a3, float & a4, float & a5, float & a6);
97+
98+
13199 bool connected (int joint_index) {
132100 return _connected[joint_index];
133101 }
0 commit comments