Hi,
Just a little update. Last day's i coded the sc_planner into a state-machine.
A state machine is a code strategy that also opengl uses.
Code:
switch (sc_enum_program_state) {
case program_run:
sc_run_state();
break;
case program_pause:
sc_pause_state();
break;
}
That is now finished, result seems ok.
This picture show 3 motions, the first motion has a end velocity transition to next motion.
In the second red curve, a "vm" interupt from 10 to 9 is done.
If you perform a pause in a end velocity motion, the motion will stop. Then the planner calculates
how to restart. This are tricky things.
I will try to focus on a look ahead function now. This function should be valuable for getting the perfect
end velocity's when passing sharp corners in a traject. I think this will be a head scratcher somehow.
Code:
vo=0, ve=5;
planner->sc_add_line_motion(vo,ve,acs,ace,{0,0,0},{100,0,0});
vo=ve; ve=0;
planner->sc_add_line_motion(vo,ve,acs,ace,{100,0,0},{200,0,0});
vo=ve; ve=0;
planner->sc_add_line_motion(vo,ve,acs,ace,{200,0,0},{250,250,250});
image_link