Thanks again coder777!!!
Yes, I know that documentation, in fact I have used it in some parts of my code. But right now my doubts were more in knowing where I could put the torque control part.
I want to control the torque because I need to make a collaborative robot, that is, in an industry for example, the idea is that the workers can move the robot, in order to do some work, for example to take some boxes.
Torque control goes with the idea of if there is any complication in the repetition of the sequence, the worker is able to grab the robot, and when the robot notice that has to do more torque of the limit (because it has the resistance of the worker), it stop.
So what I need is to know the torque at all times, and if any once the limit is exceeded, I have to stop the execution of the sequence. (sorry because of my english)
REGARDING the minimization of the code (which interests me a lot), I have to admit that I am not a good programmer at all, in fact it is the first time I program in c ++.
I have done the test with the code that you have sent me and it works correctly (I have changed the SERVO_ID [0] for SERVO_ID [i], that I imagine that it would have passed to you),and i also have change all the codes like:
1 2 3 4
|
Relax(SERVO_ID[0]);
Relax(SERVO_ID[1]);
Relax(SERVO_ID[2]);
Relax(SERVO_ID[3]);
|
NOW I am focusing on reducing the rest of the code.
I do not know if I can do what I sent you before, or something like that:
1 2 3 4 5 6 7
|
int positionn[4]
int next_pos_[4]
int initial[4]
int before_position_[4]
int turns[4]
int position[4]
for (int index = 0; index < 4; ++index && int p = 0; p < servo_count; ++p ) {initial[i], turns[i], positionn[i], next_pos_[i], before_position_[i], position[i], SERVO_ID[p] }
|
???
Or i have to do a function for each int?
Thank you!!
Urko.