From c7443447e97e821b74f9ccde76f945cc2abf7680 Mon Sep 17 00:00:00 2001 From: Aldokan Date: Sun, 12 Nov 2023 13:15:35 +0100 Subject: [PATCH] Fixed bugs in tests --- .../test/test_joystick_interface.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mission/joystick_interface/test/test_joystick_interface.py b/mission/joystick_interface/test/test_joystick_interface.py index 92f88915..1b492d6a 100644 --- a/mission/joystick_interface/test/test_joystick_interface.py +++ b/mission/joystick_interface/test/test_joystick_interface.py @@ -1,5 +1,5 @@ from joystick_interface.joystick_interface import JoystickInterface -from joystick_interface.joystick_interface import states +from joystick_interface.joystick_interface import States import rclpy from sensor_msgs.msg import Joy from sensor_msgs.msg import Joy @@ -41,8 +41,8 @@ def test_input_from_controller_into_wrench_msg(self): joy_msg.axes = [-1.0, -1.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0] joy_msg.buttons = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] wrench_msg = JoystickInterface().joystick_cb(joy_msg) - assert wrench_msg.force.x == -100.0 - assert wrench_msg.force.y == -100.0 + assert wrench_msg.force.x == -50.0 + assert wrench_msg.force.y == -50.0 assert wrench_msg.torque.z == 0.0 rclpy.shutdown() @@ -50,7 +50,7 @@ def test_input_from_controller_into_wrench_msg(self): def test_killswitch_button(self): rclpy.init() joystick = JoystickInterface() - joystick.state = states.XBOX_MODE + joystick.state_ = States.XBOX_MODE joy_msg = Joy() joy_msg.axes = [-1.0, -1.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0] joy_msg.buttons = [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0] @@ -64,12 +64,12 @@ def test_killswitch_button(self): def test_moving_in_of_xbox_mode(self): rclpy.init() joystick = JoystickInterface() - joystick.state = states.XBOX_MODE + joystick.state_ = States.XBOX_MODE joy_msg = Joy() joy_msg.axes = [-1.0, -1.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0] joy_msg.buttons = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] wrench_msg = joystick.joystick_cb(joy_msg) - assert wrench_msg.force.x == -100.0 - assert wrench_msg.force.y == -100.0 + assert wrench_msg.force.x == -50.0 + assert wrench_msg.force.y == -50.0 assert wrench_msg.torque.z == 0.0 rclpy.shutdown()