Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow up to 16 external axes from the hardcoded limit of 6 #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mimic3/scripts/mimic_external_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ def add_external_axis(*args):
keyable=False,
attributeType='long',
minValue=1,
maxValue=6,
maxValue=16,
defaultValue=1,
parent=parent_attribute)
pm.addAttr(target_CTRL,
Expand Down
2 changes: 1 addition & 1 deletion mimic3/scripts/mimic_program.py
Original file line number Diff line number Diff line change
Expand Up @@ -1163,7 +1163,7 @@ def _sample_frame_get_external_axes(robot_name, frame):
key_axis_number = 'Axis Number'
key_position = 'Position'
# Create an list of Nones for initial external axes
external_axes = [None for _ in range(6)]
external_axes = [None for _ in range(16)]
# Get all external axes for this robot
external_axis_names = mimic_external_axes.get_external_axis_names(robot_name)
# Get info dict for each of those external axes
Expand Down
2 changes: 1 addition & 1 deletion mimic3/scripts/mimic_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,7 @@ def __set_limit_display_units(*args):
label='Axis Number:',
height=18)

axis_number_list = [i + 1 for i in range(6)]
axis_number_list = [i + 1 for i in range(16)]
for axis_number in axis_number_list:
cmds.menuItem(label=axis_number)

Expand Down
3 changes: 3 additions & 0 deletions mimic3/scripts/postproc/ABB/RAPID/rapid.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ def _process_motion_command(command, opts): # Implement in base class!
if command.external_axes is not None:
external_axes = [axis if axis is not None else '9E9'
for axis in command.external_axes]
external_axes = external_axes[:6]
params = [general_utils.num_to_str(p, include_sign=False, precision=3)
for p in external_axes]
target_data.extend(params)
Expand All @@ -355,6 +356,7 @@ def _process_motion_command(command, opts): # Implement in base class!
if command.external_axes is not None:
external_axes = [axis if axis is not None else '9E9'
for axis in command.external_axes]
external_axes = external_axes[:6]
params = [general_utils.num_to_str(p, include_sign=False, precision=3)
for p in external_axes]
target_data.extend(params)
Expand All @@ -379,6 +381,7 @@ def _process_motion_command(command, opts): # Implement in base class!
if command.external_axes is not None:
external_axes = [axis if axis is not None else '9E9'
for axis in command.external_axes]
external_axes = external_axes[:6]
params = [general_utils.num_to_str(p, include_sign=False, precision=3)
for p in external_axes]
target_data.extend(params)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ def _process_records_command(command, opts):

if command.external_axes is not None:
external_axes = [axis for axis in command.external_axes if axis is not None]
external_axes = external_axes[:6]
formatted_params = [general_utils.num_to_str(axis, include_sign=True, padding=padding)
for axis in external_axes]
params.extend(formatted_params)
Expand Down
2 changes: 2 additions & 0 deletions mimic3/scripts/postproc/KUKA/KRL/krl.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ def _process_motion_command(command, opts):
if command.external_axes is not None:
motion_data_type = E6POS
external_axes = [axis if axis is not None else 0 for axis in command.external_axes]
external_axes = external_axes[:6]
motion_data.extend(external_axes)
else:
motion_data_type = POS
Expand All @@ -389,6 +390,7 @@ def _process_motion_command(command, opts):
if command.external_axes is not None:
motion_data_type = E6AXIS
external_axes = [axis if axis is not None else 0 for axis in command.external_axes]
external_axes = external_axes[:6]
motion_data.extend(external_axes)
else:
motion_data_type = AXIS
Expand Down
2 changes: 2 additions & 0 deletions mimic3/scripts/postproc/Staubli/VAL3/val3.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ def _process_motion_command(command, opts):
if command.external_axes is not None:
motion_data_type = E6POS
external_axes = [axis if axis is not None else 0 for axis in command.external_axes]
external_axes = external_axes[:6]
motion_data.extend(external_axes)
else:
motion_data_type = POS
Expand All @@ -387,6 +388,7 @@ def _process_motion_command(command, opts):
if command.external_axes is not None:
motion_data_type = E6AXIS
external_axes = [axis if axis is not None else 0 for axis in command.external_axes]
external_axes = external_axes[:6]
motion_data.extend(external_axes)
else:
motion_data_type = AXIS
Expand Down
20 changes: 20 additions & 0 deletions mimic3/scripts/postproc/postproc.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@
__external_axis_4 = 'external_axis_4'
__external_axis_5 = 'external_axis_5'
__external_axis_6 = 'external_axis_6'
__external_axis_7 = 'external_axis_7'
__external_axis_8 = 'external_axis_8'
__external_axis_9 = 'external_axis_9'
__external_axis_10 = 'external_axis_10'
__external_axis_11 = 'external_axis_11'
__external_axis_12 = 'external_axis_12'
__external_axis_13 = 'external_axis_13'
__external_axis_14 = 'external_axis_14'
__external_axis_15 = 'external_axis_15'
__external_axis_16 = 'external_axis_16'
__configuration_1 = 'configuration_1'
__configuration_2 = 'configuration_2'
__configuration_3 = 'configuration_3'
Expand Down Expand Up @@ -88,6 +98,16 @@
__external_axis_4, # float
__external_axis_5, # float
__external_axis_6, # float
__external_axis_7, # float
__external_axis_8, # float
__external_axis_9, # float
__external_axis_10, # float
__external_axis_11, # float
__external_axis_12, # float
__external_axis_13, # float
__external_axis_14, # float
__external_axis_15, # float
__external_axis_16 # float
]
)

Expand Down