Skip to content

Commit c87a0f7

Browse files
committed
Rename '*idx' to 'id' for better compatibility within the whole codebase.
1 parent 5b8aa22 commit c87a0f7

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/Braccio++.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -168,27 +168,27 @@ class Servo
168168
{
169169
public:
170170

171-
Servo(SmartServoClass & servos, int const idx) : _servos(servos), _idx(idx) { }
171+
Servo(SmartServoClass & servos, int const id) : _servos(servos), _id(id) { }
172172

173-
inline void disengage() { _servos.disengage(_idx); }
174-
inline void engage() { _servos.engage(_idx); }
175-
inline bool engaged() { return _servos.isEngaged(_idx); }
173+
inline void disengage() { _servos.disengage(_id); }
174+
inline void engage() { _servos.engage(_id); }
175+
inline bool engaged() { return _servos.isEngaged(_id); }
176176

177177
inline Servo & move() { return *this; }
178-
inline Servo & to (float const angle) { _servos.setPosition(_idx, angle, _speed); return *this; }
179-
inline Servo & in (std::chrono::milliseconds const len) { _servos.setTime(_idx, len.count()); return *this; }
178+
inline Servo & to (float const angle) { _servos.setPosition(_id, angle, _speed); return *this; }
179+
inline Servo & in (std::chrono::milliseconds const len) { _servos.setTime(_id, len.count()); return *this; }
180180

181-
inline float position() { return _servos.getPosition(_idx); }
182-
inline bool connected() { return Braccio.connected(_idx); }
183-
inline void info(Stream & stream) { _servos.getInfo(stream, _idx); }
181+
inline float position() { return _servos.getPosition(_id); }
182+
inline bool connected() { return Braccio.connected(_id); }
183+
inline void info(Stream & stream) { _servos.getInfo(stream, _id); }
184184

185185
operator bool() { return connected(); }
186186

187187

188188
private:
189189

190190
SmartServoClass & _servos;
191-
int const _idx;
191+
int const _id;
192192
int const _speed = 100;
193193

194194
};

0 commit comments

Comments
 (0)