Skip to content

Commit

Permalink
reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
KazuyaOguma18 committed Feb 24, 2025
1 parent 1b90a0d commit 2d72cb0
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions mofpy/mofpy/action/moveit_servo_joint.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def execute(self, named_joy=None):
)

jog_joints, is_quiet = self.__get_jog_joints__(named_joy["buttons"], named_joy["axes"])

if self.__quiet_on_zero:
if is_quiet:
# Publish the all-zero message just once
Expand Down Expand Up @@ -107,18 +107,18 @@ def __get_jog_joints__(self, named_buttons, named_axes):
vel = self.__scale * self.__get_enable_joint__(joint, named_buttons) * v
msg.joint_names.append(joint)
msg.velocities.append(vel)

is_quiet = all(val == 0 for val in msg.velocities)
return msg, is_quiet

def __mapping__(self, key=None):
mapping_key = "mapping" + f"/{key}" if key else key
params = self.get(mapping_key, {})
mapping = {}

if type(params) is not dict:
return params

for key in params.keys():
val = params[key]
if type(val) is tuple or type(val) is list:
Expand All @@ -143,7 +143,6 @@ def __get_value__(self, named_axes):
:param named_axes: the processed joy values to get the value from
:return: the value
"""

# List of button names to be added in order to get the value.
# A name could start with '-', indicating to invert the value
names = self.__value_mapping
Expand Down

0 comments on commit 2d72cb0

Please sign in to comment.