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

 

ROS 2 Foxy Fitzroy (codename ‘foxy’; June 5th, 2020) — ROS 2 Documentation: Foxy documentation

During the development of Foxy, a bug was introduced into the tf2_ros static_transform_publisher program. The implementation of the order of the Euler angles passed to static_transform_publisher disagrees with the documentation. Foxy patch release 2 fixes

docs.ros.org

https://cafe.naver.com/openrt?iframe_url_utf8=%2FArticleRead.nhn%253Fclubid%3D25572101%2526articleid%3D24637%2526commentFocus%3Dtrue 

 

오픈소스 소프트웨어 & 하드웨어: 로... : 네이버 카페

오픈소스 소프트웨어/하드웨어로 만드는 로봇 기술 공유 카페 (ROS,ARM,AVR,mbed,라즈베리파이,아두이노)

cafe.naver.com

 

반응형