joystick_ros2 icon indicating copy to clipboard operation
joystick_ros2 copied to clipboard

the parameter of 'create_publisher()' has been changed, it need to add an new value.

Open bitBladeMaster opened this issue 2 years ago • 0 comments

when I run the the code directly, It show the error as below:

Traceback (most recent call last): File "\ros2_workspace\src\joystick_ros2\joystick_ros2.py", line 284, in main() File "\ros2_workspace\src\joystick_ros2\joystick_ros2.py", line 273, in main joystick_ros2 = JoystickRos2() File "\ros2_workspace\src\joystick_ros2\joystick_ros2.py", line 189, in init self.publisher_ = self.create_publisher(Joy, 'joy')
TypeError: create_publisher() missing 1 required positional argument: 'qos_profile'

I have updated the code in 'joystick_ros2.py' as below, and run successfully.

line 189: self.publisher_ = self.create_publisher(Joy, 'joy', 10) # add a new param, 10

bitBladeMaster avatar Jan 14 '23 12:01 bitBladeMaster