해당 실습 자료는 한양대학교 Road Balance - ROS 2 for G Camp와 ROS 2 Documentation: Foxy, 표윤석, 임태훈 <ROS 2로 시작하는 로봇 프로그래밍> 루피페이퍼(2022) 를 참고하여 작성하였습니다.
이번 장에서는
Server Node
와Client Node
간의 메세지 통신Action
을 구현해볼 예정입니다.
Creating custom msg and srv files — ROS 2 Documentation: Foxy documentation
~/ros2_ws
$ source /opt/ros/foxy/setup.bash
$ cd ~/ros2_ws/
$ colcon build --symlink-install --packages-select custom_action_interface
$ source ./install/setup.bash
$ ros2 interface show custom_action_interface/action/Fibonacci
##================== 출력 결과 ==================
**# Goal
int32 order
---
# Result
int32[] sequence
---
# Feedback
int32[] partial_sequence
##**===============================================
ros2_ws/src
디렉토리에 이동하신 다음 새로운 패키지를 생성합니다.$ cd ~/ros2_ws/src/
$ ros2 pkg create fibonacci_action --build-type ament_python --dependencies rclpy custom_action_interface