Robot Operating System/ROS2
[ROS2 Dashing and Foxy] AttributeError: 'Argument' object has no attribute 'add_on_set_parameters_callback'
jstar0525
2022. 2. 5. 16:07
반응형
Test Env. Ubuntu 18.04, ROS2 Dashing, Jetson AGX Xaiver with Jetpack 4.5.1
ROS2 프로그래밍을 하다가 아래와 같은 오류를 만났다.
Traceback (most recent call last):
File "/home/robotv/colcon_ws/install/topic_service_action_rclpy_example/lib/topic_service_action_rclpy_example/argument", line 33, in <module>
sys.exit(load_entry_point('topic-service-action-rclpy-example', 'console_scripts', 'argument')())
File "/home/robotv/colcon_ws/build/topic_service_action_rclpy_example/topic_service_action_rclpy_example/arithmetic/argument.py", line 74, in main
argument = Argument()
File "/home/robotv/colcon_ws/build/topic_service_action_rclpy_example/topic_service_action_rclpy_example/arithmetic/argument.py", line 38, in __init__
self.add_on_set_parameters_callback(self.update_parameter)
AttributeError: 'Argument' object has no attribute 'add_on_set_parameters_callback'
기존 ROS2 Foxy의 튜토리얼을 따라하다 나온 것으로,
ROS2 Dashing에서는 'set_parameters_callback' attribute가
ROS2 Foxy에서 'add_on_set_parameters_callback'과 'remove_on_set_parameters_callback'으로 변경되었다.
따라서 사용 버전에 따라 적절한 attribute를 사용하면 된다.
Ref.
https://docs.ros.org/en/foxy/Releases/Release-Foxy-Fitzroy.html
반응형