In working on the trajectory planner and kinematics, I've noticed that there is a lot of translation between the EmcPose struct and array-like data. Examples include (in master):
- emc/kinematics/gantrykins.c:32 - emc/kinematics/5axiskins.c:39 - emc/kinematics/tp.c (multiple) Could EmcPose be replaced with a flatter structure like this? typdef struct { double axis[9]; unsigned int size; } EmcPose There are a few reasons to use this "flat" structure: 1. *Conceptual*: If we want to generalize LinuxCNC to other kinematics, then it makes less sense to treat XYZ as a special subset of the axes. A simple array of axes is easier to work with for complex kinematics. 2. *Implementation:* It's easier to do operations on the whole pose (just iterate over the array) 3. *Efficiency:* We can set the "size" to the actual number of axes, and only iterate up to that size during operations. This way we can "skip" axes that are always zero anyway. 4. *Cruft:* Eliminate much of the translation between datatypes in TP, motion, and others. Obviously, the task wouldn't be easy or quick, as there are at least 190 references to EmcPose in the current master. If the effort / inertia wasn't a factor, though, are there other reasons that EmcPose needs to be defined the way it is? I'm planning on using a data structure similar to this to implement blending arcs, so the groundwork will be there to do such a conversion. I see this as a long-term goal rather than an immediate necessity, but if there's popular support, I'd be happy to take in on eventually. Thanks, -Rob ------------------------------------------------------------------------------ October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk _______________________________________________ Emc-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers