Skip to content

Commit 4cef773

Browse files
committed
Remove invidual motor moveTo APIs, since they are not redundant with the APIs available in the MotorsWrapper class.
1 parent 61674d1 commit 4cef773

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

src/Braccio++.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,12 @@ bool BraccioClass::begin(voidFuncPtr customMenu) {
164164
return true;
165165
}
166166

167+
inline MotorsWrapper BraccioClass::move(int const id)
168+
{
169+
MotorsWrapper wrapper(servos, id);
170+
return wrapper;
171+
}
172+
167173
void BraccioClass::connectJoystickTo(lv_obj_t* obj) {
168174
lv_group_add_obj(p_objGroup, obj);
169175
lv_indev_set_group(kb_indev, p_objGroup);

src/Braccio++.h

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -87,20 +87,10 @@ 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-
}
90+
91+
MotorsWrapper move(int const id);
92+
inline MotorsWrapper get(int const id) { return move(id); }
93+
10494
void moveTo(float a1, float a2, float a3, float a4, float a5, float a6) {
10595
servos.setPositionMode(PositionMode::SYNC);
10696
servos.setPosition(1, a1, runTime);

0 commit comments

Comments
 (0)