laptophead
Well-known member
Pardon my inexperience...
I got this robot consisting of 8 motors and I am able to send commands to each of them by this function:
I would like to simplify the 8 arguments by defining waypoints such as :
struct Way_Pt {
float M1;
float M2;
float M3;
float M11;
float M12;
float M13;
float M5;
float M6;
};
Way_Pt Squat = { -47.4, -103.7, 40.6, 75.2, 100.2, 17.2, 2.0, 0 };
Way_Pt Stand = { -57.9, -84.1, 32.2, 78.8, 80.6, 8.8, -3.9, 2.1};
then I would go
Ev_GoTo_Pos (Stand);
But it does not work, I get:
cannot convert 'Way_Pt' to 'float' for argument '1' to 'void Ev_GoTo_Pos(float, float, float, float, float, float, float, float)'
Ev_GoTo_Pos (Stand); // too fast
Is there smarter way to do this?
Thanks
I got this robot consisting of 8 motors and I am able to send commands to each of them by this function:
HTML:
void Ev_GoTo_Pos (float M1, float M2, float M3, float M11, float M12, float M13, float M5, float M6)
{ //Show_Encs();
if (SendOnce == 0)
{
GoTo_Pos (M1, 1);
GoTo_Pos (M5 * 5, 5);//Neck Tilt
GoTo_Pos (M11, 11);
delay (4); // MUST STAY AT 4 MS for long reply
GoTo_Pos (M2 * 5, 2);
GoTo_Pos (M6 * 6, 6); //neck pan
GoTo_Pos (M12 * 5, 12);
delay (4);
GoTo_Pos (M3 * 4, 3);
//GoTo_Pos (M7 , 7);
GoTo_Pos (-M13 * 4, 13);
delay (4);
SendOnce = 1;
}
ReadENC_Master = 1;
}
I would like to simplify the 8 arguments by defining waypoints such as :
struct Way_Pt {
float M1;
float M2;
float M3;
float M11;
float M12;
float M13;
float M5;
float M6;
};
Way_Pt Squat = { -47.4, -103.7, 40.6, 75.2, 100.2, 17.2, 2.0, 0 };
Way_Pt Stand = { -57.9, -84.1, 32.2, 78.8, 80.6, 8.8, -3.9, 2.1};
then I would go
Ev_GoTo_Pos (Stand);
But it does not work, I get:
cannot convert 'Way_Pt' to 'float' for argument '1' to 'void Ev_GoTo_Pos(float, float, float, float, float, float, float, float)'
Ev_GoTo_Pos (Stand); // too fast
Is there smarter way to do this?
Thanks