From 21d327c74f783b994642d5a98a5686a3a2b39e29 Mon Sep 17 00:00:00 2001 From: Jakub Delicat Date: Wed, 16 Aug 2023 16:33:44 +0200 Subject: [PATCH] lint Signed-off-by: Jakub Delicat --- safety_master_plugin/robot_info.py | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/safety_master_plugin/robot_info.py b/safety_master_plugin/robot_info.py index e170ea4..1d5bfcf 100644 --- a/safety_master_plugin/robot_info.py +++ b/safety_master_plugin/robot_info.py @@ -3,9 +3,9 @@ from safety_master_plugin.clutch_state import ClutchState as CS from safety_master_plugin.stop_state import StopState as SS -class RobotInfo: - def __init__(self,robot_id): +class RobotInfo: + def __init__(self, robot_id): self.robot_id = robot_id self.battery_voltage = None self.linear_velocity = None @@ -13,18 +13,26 @@ class RobotInfo: self.state = None self.clutch = None - def update_robot_info(self,robot_info_msg): + def update_robot_info(self, robot_info_msg): self.robot_id = robot_info_msg.robot_id.data self.battery_voltage = robot_info_msg.battery_voltage.data - self.linear_velocity = [robot_info_msg.twist.linear.x,robot_info_msg.twist.linear.y,robot_info_msg.twist.linear.z] - self.angular_velocity = [robot_info_msg.twist.angular.x,robot_info_msg.twist.angular.y,robot_info_msg.twist.angular.z] + self.linear_velocity = [ + robot_info_msg.twist.linear.x, + robot_info_msg.twist.linear.y, + robot_info_msg.twist.linear.z, + ] + self.angular_velocity = [ + robot_info_msg.twist.angular.x, + robot_info_msg.twist.angular.y, + robot_info_msg.twist.angular.z, + ] - if robot_info_msg.state.data == True: + if robot_info_msg.state.data is True: self.state = SS.RUNNING else: self.state = SS.STOPPED - if robot_info_msg.clutch.data == True: + if robot_info_msg.clutch.data is True: self.clutch = CS.ENGAGED else: - self.clutch = CS.DISENGAGED \ No newline at end of file + self.clutch = CS.DISENGAGED