ok, so the questions forwarded to @matt:
to reset the motor encoders I found e.g.,
why is this such a long command with offset and get encoder and all that?
wouldn't it be possible to have a simple command just like
or what am I perhaps missing about the offset and/or a reset command?
for polling the encoders there are 2 different functions,
1 to pass the port and an 1 int32_t value, returning int (not int32_t which has been passed)
and 1 to pass just the port and returning int32_t:
int get_motor_encoder(uint8_t port, int32_t &value);
int32_t get_motor_encoder(uint8_t port);
I see that on the 32-bit ARM7 Pi2 int and int32_t have identical sizes
(not sure about the 64bit ARM53 Pi3 + new Pi2 though),
so why not always use either int or the stdint declaration int32_t ?
(added to TO post:)
I need the following commands:
1.) set enc to 0
2.) set enc to either value
3.) read the current enc value (relative to the most recent 0 reset point)
4.) rotate relative degrees (e.g., +95 or -20 from the current position state)
5.) rotate to an absolute position regardless of the current value (i.e., a fixed setpoint, e.g., to the absolute encoder value 0 or -180°) even when the motor is currently rotating (quickly changing relative enc values)
how can this be done?
just found out that for C++ it's not quite as easy as for C to just wrap some
#defines around the class methods, especially when an instance of a class method has to be passed additionally. So probably the public class methods will have to be enhanced by a few more methods, i.e.
reset (to 0)
set (to either value)
and perhaps even some more new ones