They use I,J,K for vector. But for G2, G3 that is not a valid gcode input.
Yes, that is because the 5axis CAM output only consists of straight line segments (ie no G02 or G03 commands) the CAM user defines the length of the line segments.
I'm not suggesting to limit the interpreter to this format but it would make a lot of sense to allow vector format as an option since it makes the calculation of the tool vector unnecessary. It seems kind of silly to have the CAM calculate the tool vector and then to invest in a postprocessor to calculate the rotary angles from the tool vector just to have your algorithm reconstruct the tool vector that we already had in the CAM output.
So basically:
1. Check if the first G01 command has I,J,K words
2a. if no then read the machine kinematics from the ini file and recalculate the tool vector from the ABC values
2b. if yes, use the IJK values to create the tool vector directly.
Basicly when using external rotary table, we could use this as axis u,v,w.
Where u=rotation around x, v=rotation around y, and w=rotary table clamp symetric axis.
Then we have a xyz, abc, uvw machine, 6 axis for tool, 3 axis for extern rotary table.
Not sure I can follow you there. I don't see the need for U,V,W for work side rotations. Come to think of it I may have been confused myself by thinking we need to handle work side rotation differently from tool side rotation as I thought we would need to reverse the rotation direction. However the positive rotation is defined in respect to the tool rotation around the machine XYZ in either case.
I have created kinematic models with mixed work side and tool side rotations but my 'tilted work plane work' only dealt with machines with tool side rotation (primary C, secondary B or A). Maybe I'll find some time to expand on that.
So all other configurations, like xyzab, xyzac, xyza, etc need a different software approach.
And i think not all of these variants can use tooldirection optimalisation. Like xyza, where a is secondaire z axis.
For Gcode that was postprocessed to fit a specific kinematic you need to account for the kinematic settings in the postprocessor (PP) to basically undo what the PP did AND you need to know the machine kinematics for the calculation of the rotary axis position to achieve the requested tool orientation.
If you decide to allow vector format Gcode then you only need to worry about kinematics for the calculation of the rotary axis position to achieve the requested tool orientation. This is why I suggested looking at vector (ie IJK) format as it's really the easier task.
However, the usual 4axis case will still likely still involve XYZA gcode. I think this would still work with the orientation path smoothing as it still creates a valid 3d curve that can be smoothed out to a G2 continuous path. What happens if you feed your 5axis test a XYZA gcode (ie B and C angle values all zero)?
Note: I would interpret XYZA as a machine with linear cartesian XYZ axes and a rotary A (ie rotates the tool around the X axis). And again I _think_ that it is irrelevant whether A rotates the work or the tool.
Then it should use correspondenting c++ function to translate gcode into the proper tcp, and other axis.
Like choosing kinematics.
Overall the current use of kinematic modules works quite well, except for the inability of the trajectory planner to catch axis limit violations in the look ahead and decelerate in a controlled manner before raising a sudden joint limit abort. This would be nice to have but would mean that the planner passes every motion segment through the custom kinematic module to check for limit violations before actually adding it to the queue.