[ros2run]: Process exited with failure 1
I try to write a simple programm with ros2.
when i run ros2 run test_ur_controller first_moveit_node
i get following output.
Traceback (most recent call last):
File "/home/.../workspace/moveit_test/install/test_ur_controller/lib/test_ur_controller/first_moveit_node", line 33, in <module>
sys.exit(load_entry_point('test-ur-controller==0.0.0', 'console_scripts', 'first_moveit_node')())
File "/home/.../workspace/moveit_test/install/test_ur_controller/lib/python3.10/site-packages/test_ur_controller/first_moveit_node.py", line 13, in main
node = test_moveit_node()
File "/home/.../workspace/moveit_test/install/test_ur_controller/lib/python3.10/site-packages/test_ur_controller/first_moveit_node.py", line 8, in __init__
super().__init__("first_moveit_node")
TypeError: object.__init__() takes exactly one argument (the instance to initialize)
[ros2run]: Process exited with failure 1
My file first_moveit_node.py
looks like this
#!/usr/bin/env python3
import rclpy
from rclpy.node import Node
class test_moveit_node():
def __init__(self):
super().__init__("first_moveit_node")
self.get_logger().info("Hello moveit")
def main(args=None):
rclpy.init(args=args)
node = test_moveit_node()
rclpy.spin(node)
rclpy.shutdown()
In my setup.py
file i added:
entry_points={
'console_scripts': [
"first_moveit_node = test_ur_controller.first_moveit_node:main"
],
},
I already build my workspace colcon build
which was successful.
Furthermore i source ~/workspace/moveit_test/install/setup.bash
afterwards.
Where is my mistake?