Skip to content

Commit

Permalink
Automated autoyapf fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Sep 24, 2023
1 parent ebf9edc commit 7d9f22b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
8 changes: 4 additions & 4 deletions mission/joystick_interface/scripts/joystick_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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)
Expand All @@ -67,4 +67,4 @@ def main(args=None):
rclpy.spin(joystick_interface)
joystick_interface.destroy_node()
rclpy.shutdown()
return
return
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
from sensor_msgs.msg import Joy




class TestJoystickInterface:

def start(self):
rclpy.init()
j = JoystickInterface()
Expand All @@ -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
#
Expand All @@ -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


0 comments on commit 7d9f22b

Please sign in to comment.