From 7d9f22b0eb52ba478162180d25d248b7f9ed4ef9 Mon Sep 17 00:00:00 2001 From: github-actions Date: Sun, 24 Sep 2023 12:15:03 +0000 Subject: [PATCH] Automated autoyapf fixes --- .../scripts/joystick_interface.py | 8 ++++---- .../scripts/test/test_joystick_interface.py | 15 ++++++--------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/mission/joystick_interface/scripts/joystick_interface.py b/mission/joystick_interface/scripts/joystick_interface.py index 688519e3..6cd4066b 100644 --- a/mission/joystick_interface/scripts/joystick_interface.py +++ b/mission/joystick_interface/scripts/joystick_interface.py @@ -39,7 +39,8 @@ def __init__(self): #self.wrench_publisher = self.create_publisher(Wrench, 'wrench_topic', 1) #self.node = rclpy.create_node('joystick_interface') - self.subscriber = self.create_subscription(Joy, 'joy',self.joystick_cb, 1) + self.subscriber = self.create_subscription(Joy, 'joy', + self.joystick_cb, 1) #rclpy.shutdown() def create_2d_wrench_message(self, x, y, yaw): @@ -48,8 +49,7 @@ def create_2d_wrench_message(self, x, y, yaw): wrench_msg.force.y = y wrench_msg.torque.z = yaw return wrench_msg - - + """" def publish_wrench_message(self, wrench): self.wrench.pub.publish(wrench) @@ -67,4 +67,4 @@ def main(args=None): rclpy.spin(joystick_interface) joystick_interface.destroy_node() rclpy.shutdown() - return \ No newline at end of file + return diff --git a/mission/joystick_interface/scripts/test/test_joystick_interface.py b/mission/joystick_interface/scripts/test/test_joystick_interface.py index 505d565f..a154c49d 100644 --- a/mission/joystick_interface/scripts/test/test_joystick_interface.py +++ b/mission/joystick_interface/scripts/test/test_joystick_interface.py @@ -6,9 +6,8 @@ from sensor_msgs.msg import Joy - - class TestJoystickInterface: + def start(self): rclpy.init() j = JoystickInterface() @@ -22,10 +21,10 @@ def test_2d_wrench_msg(self): assert msg.torque.z == 4.0 #def test_publish_wrench_msg(self): - #msg = JoystickInterface().create_2d_wrench_message(2.0, 3.0, 4.0) - #publisher = JoystickInterface().publish_wrench_message(msg) - #assert self.get_logger() == msg - + #msg = JoystickInterface().create_2d_wrench_message(2.0, 3.0, 4.0) + #publisher = JoystickInterface().publish_wrench_message(msg) + #assert self.get_logger() == msg + #def test_joystick_input_output(self): # return # @@ -36,9 +35,7 @@ def test_suscriber(self): #joystick = JoystickInterface() joy_msg = Joy() joy_msg.axes = [0.1, 0.2, 0.3] # Customize axes values as needed - joy_msg.buttons = [1, 0, 1] + joy_msg.buttons = [1, 0, 1] #JoystickInterface().joystick_cb(joy_msg, subscriber) #assert JoystickInterface().node.joy_msg assert JoystickInterface().joystick_cb(joy_msg) == joy_msg.buttons - -