이태홍
홍'story
이태홍
전체 방문자
오늘
어제
  • 분류 전체보기 (171)
    • TW (39)
    • AI (47)
      • 자연어 처리 (10)
      • Kaggle (2)
      • Machine Learning (26)
      • Computer Vision (0)
      • Deep Learning (0)
      • ROS2 (7)
    • Computer Science (29)
      • Data Structure (0)
      • Algorithm (18)
      • Computer Architecture (5)
      • SOLID (0)
      • System Programing (6)
    • LOLPAGO (10)
      • 프론트엔드 (10)
      • 백엔드 (0)
    • BAEKJOON (2)
    • React (5)
    • 언어 (8)
      • C++ (8)
    • GIT (0)
    • MOGAKCO (19)
    • 미국 여행기 (3)
    • etc. (7)
      • Blog (2)
      • 콜라톤 (2)

블로그 메뉴

  • 홈
  • 태그
  • 방명록

공지사항

인기 글

태그

  • baekjoon
  • NLP
  • 백준
  • tw
  • pytorch
  • react
  • ROS2
  • algorithm
  • computer architecture
  • 알고리즘
  • 기계학습
  • 경사하강법
  • kaggle
  • 머신러닝
  • computerscience
  • Ai
  • C++
  • ML
  • 딥러닝
  • LOLPAGO

최근 댓글

최근 글

티스토리

hELLO · Designed By 정상우.
이태홍

홍'story

[ROS2] Turtlesim을 이용한 Service 이해
AI/ROS2

[ROS2] Turtlesim을 이용한 Service 이해

2024. 4. 18. 02:57

🤖 Service의 이해

아래의 docs를 따라가며 turtlesim을 이용하여 service를 이해해보겠습니다.

 

https://docs.ros.org/en/foxy/Tutorials/Beginner-CLI-Tools/Understanding-ROS2-Services/Understanding-ROS2-Services.html

 

Understanding services — ROS 2 Documentation: Foxy documentation

You're reading the documentation for a version of ROS 2 that has reached its EOL (end-of-life), and is no longer officially supported. If you want up-to-date information, please have a look at Iron. Understanding services Goal: Learn about services in ROS

docs.ros.org

 

 

우선 아래와 같이 turtlesim_node와 turtle_teleop_key Node를 실행합니다.

 

 

 

이 상태에서 service의 list를 조회하면 아래와 같습니다.

 

 

 

 

타입을 확인하기 위해 아래와 같이 작성합니다.

 

 

 

set_pen service의 타입은 다음과 같다는 것을 알 수 있습니다.

 

해당 service의 request형식이 어떻게 되는지 확인하기 위해 ros2 interface show를 합니다.

 

 

이를 확인했으므로 service call을 통해서 request를 합니다.

 

이때 형식은 아래와 같습니다.

 

ros2 service call <service_name> <service_type> <value>

 

 

 

value 의 경우 위와같이 "{'key' : value}"와 같이 작성하면 됩니다.

 

'AI > ROS2' 카테고리의 다른 글

[ROS2] Service 실습(Call-And-Response)  (0) 2024.04.18
[ROS2] Service  (1) 2024.04.18
[ROS2] Turtlesim  (1) 2024.04.18
[ROS2] Topic 실습(Pub-Sub)  (0) 2024.04.17
[ROS2] Topic  (0) 2024.04.17
    'AI/ROS2' 카테고리의 다른 글
    • [ROS2] Service 실습(Call-And-Response)
    • [ROS2] Service
    • [ROS2] Turtlesim
    • [ROS2] Topic 실습(Pub-Sub)
    이태홍
    이태홍
    공부하자 태홍아

    티스토리툴바