Skip to content

Commit b958c0a

Browse files
committed
changing nesting
1 parent e510f32 commit b958c0a

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/compas_fab/robots/robot.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ def get_end_effector_frame(self, group=None, full_configuration=None):
184184
-------
185185
:class: `compas.geometry.Frame`
186186
"""
187-
if full_configuration is None:
187+
if not full_configuration:
188188
full_configuration = self.zero_configuration()
189189
full_joint_state = dict(zip(full_configuration.joint_names, full_configuration.values))
190190
return self.model.forward_kinematics(full_joint_state, link_name=self.get_end_effector_link_name(group))
@@ -247,7 +247,7 @@ def get_base_frame(self, group=None, full_configuration=None):
247247
-------
248248
:class: `compas.geometry.Frame`
249249
"""
250-
if full_configuration is None:
250+
if not full_configuration:
251251
full_configuration = self.zero_configuration()
252252
full_joint_state = dict(zip(full_configuration.joint_names, full_configuration.values))
253253
return self.model.forward_kinematics(full_joint_state, link_name=self.get_base_link_name(group))
@@ -495,17 +495,16 @@ def _check_full_configuration(self, full_configuration=None):
495495
The full configuration
496496
"""
497497
joint_names = self.get_configurable_joint_names() # full configuration
498-
if full_configuration:
498+
if not full_configuration:
499+
return self.zero_configuration() # with joint_names
500+
else:
499501
# full_configuration might have passive joints specified as well, we allow this.
500502
if len(joint_names) > len(full_configuration.values):
501503
raise ValueError("Please pass a configuration with {} values, for all configurable joints of the robot.".format(len(joint_names)))
502504
configuration = full_configuration.copy()
503505
if not len(configuration.joint_names):
504506
configuration.joint_names = joint_names
505-
else:
506-
configuration = self.zero_configuration() # with joint_names
507-
508-
return configuration
507+
return configuration
509508

510509
# ==========================================================================
511510
# transformations, coordinate frames

0 commit comments

Comments
 (0)