Gmoccapy won't load on fresh config

More
6 years 9 months ago #154894 by AgentWD40
Using a fresh compiled install of linuxcnc 2.9, and created a new config using pncconf for a xyyzz gantry type machine. That's dual y and dual z.

When I make a config with pncconf and select axis, linuxcnc loads just fine. When I select gmoccapy instead of axis then I get the following error.


I've attached my hal, ini, and error report. I'm guessing this has something to do with the tandem z axis?

Please Log in to join the conversation.

More
6 years 9 months ago #154925 by AgentWD40
I'm kind of grasping at straws here but I think I can see part of the problem.

Looking at gmoccapy.py:
Code:
def _get_joint_from_joint_axis_dic(self, value): # if the selected axis is a double axis we will get the joint from the # master axis, witch should end with 0 if value in self.double_axis_letter: value = value + "0" return self.joint_axis_dic.keys()[self.joint_axis_dic.values().index(value)]

VS looking at the error report I posted:
Code:
**** GMOCCAPY GETINIINFO **** Number of joints = 5 5 COORDINATES found = xyyzz ('Fount double letter ', ['y']) ('Fount double letter ', ['y', 'z']) joint 0 = axis x joint 1 = axis y0 joint 2 = axis y1 joint 3 = axis z2 joint 4 = axis z3 {0: 'x', 1: 'y0', 2: 'y1', 3: 'z2', 4: 'z3'}


I'm assuming that this is the axis_dic: {0: 'x', 1: 'y0', 2: 'y1', 3: 'z2', 4: 'z3'} ??

If so then the _get_joint_from_joint_axis_dic function was expecting x, y0, y1, z0, z1 but got z2, z3 instead so that caused the error?

So where to fix from here? Seems either the dictionary names need to be fixed or the _get_joint_from_joint_axis_dic function needs to be modified.

[EDIT]
Maybe the most logical solution is to change the dic names by reseting the counter here when this loop hits a new double axis letter

Change this ( getiniinfo.py line 148)
Code:
if self.get_joints() == len(coordinates): count = 0 for joint, axisletter in enumerate(coordinates): if axisletter in double_axis_letter: axisletter = axisletter + str(count) count += 1 joint_axis_dic[joint] = axisletter print("joint {0} = axis {1}".format(joint, joint_axis_dic[joint]))

To something like this
Code:
if self.get_joints() == len(coordinates): count = 0 prev_double_axis_letter = "" for joint, axisletter in enumerate(coordinates): if axisletter in double_axis_letter: if axisletter != prev_double_axis_letter: count = 0 prev_double_axis_letter = axisletter axisletter = axisletter + str(count) count += 1 joint_axis_dic[joint] = axisletter print("joint {0} = axis {1}".format(joint, joint_axis_dic[joint]))

I wont be able to test this until this evening.

Please Log in to join the conversation.

More
6 years 9 months ago #154971 by AgentWD40
Initial testing shows that the proposed code changes above seems to have fixed the problem. Who do I need to inform about this?

Please Log in to join the conversation.

More
6 years 9 months ago #155084 by andypugh

AgentWD40 wrote: Initial testing shows that the proposed code changes above seems to have fixed the problem. Who do I need to inform about this?


Norbert, who I think reads this forum.

Please Log in to join the conversation.

Time to create page: 0.140 seconds
Powered by Kunena Forum