์ƒˆ์†Œ์‹

python/ROS

ROS ๊ธฐ๋ณธ์šฉ์–ด: ๊ทธ๋ž˜ํ”„ ๋ ˆ๋ฒจ

  • -
๐Ÿ“˜

Node


๐Ÿ‘‰๐Ÿผ Processes that perform computation

  • ๋ญ”๊ฐ€ ๋™์ž‘์„ ํ•˜๊ธฐ ์œ„ํ•œ ํ”„๋กœ์„ธ์Šค
  • ์‹คํ–‰ํŒŒ์ผ์„ ์‹คํ–‰ํ•˜๋ฉด ์ƒ์„ฑ๋˜๋Š” ์ธ์Šคํ„ด์Šค๋ผ๊ณ  ์ƒ๊ฐํ•˜๋Š” ๊ฒƒ์ด ํŽธํ•จ
  • ๋‹ค๋ฅธ ๋…ธ๋“œ์™€ topic, service, action ๋“ฑ์„ ํ†ตํ•ด ํ†ต์‹ ํ•  ์ˆ˜ ์žˆ๊ณ , Parameter Server์— ๋ฐ์ดํ„ฐ๋ฅผ ์ €์žฅํ•˜๊ฑฐ๋‚˜ ์ฝ์–ด์˜ฌ ์ˆ˜ ์žˆ์Œ
  • ๋‹ค์–‘ํ•œ ํ”„๋กœ๊ทธ๋žจ ์–ธ์–ด๋ฅผ ์ด์šฉํ•ด ๊ฐœ๋ฐœ ๊ฐ€๋Šฅ:
    • ์ง€์›์–ธ์–ด: C++, Python
    • 3rd Party ์ง€์›์–ธ์–ด: Lisp, Java, Lua ๋“ฑ๋“ฑ
  • ๋ชจ๋“ˆํ˜• ์„ค๊ณ„
    • ๊ฐ๊ฐ ์ปดํŒŒ์ผ ๊ฐ€๋Šฅ
    • ๊ฐ๊ฐ ์‹คํ–‰๊ฐ€๋Šฅ
    • ๊ฐœ๋ณ„ ๊ด€๋ฆฌ ๊ฐ€๋Šฅ

์ถ”๊ฐ€์„ค๋ช…

์š”์•ฝ

Master


๐Ÿ‘‰๐Ÿผ Provides name registration and lookup to the rest of the Computation Graph

  • ๋…ธ๋“œ ๊ด€๋ฆฌ
  • ๋…ธ๋“œ๊ฐ„์˜ ์ค‘์žฌ ๊ธฐ๋Šฅ (Naming and registration services)
  • ๋งˆ์Šคํ„ฐ๊ฐ€ ์—†๋‹ค๋ฉด ๋…ธ๋“œ๋Š” ๋ฌด์šฉ์ง€๋ฌผ (์–ด๋–ค ๋…ธ๋“œ๊ฐ€ ์žˆ๋Š”์ง€, ๋ฐ์ดํ„ฐ ๊ตํ™˜, ์„œ๋น„์Šค ์ฝœ ๋“ฑ ์ „ํ˜€ ์•ˆ๋จ)
  • ์‹คํ–‰์ค‘์—” ๋ฐ˜๋“œ์‹œ ํ•˜๋‚˜์˜ ๋งˆ์Šคํ„ฐ๊ฐ€ ์‹คํ–‰๋˜์–ด ์žˆ์–ด์•ผ์•ผ ํ•จ (๋ฉ€ํ‹ฐ๋งˆ์Šคํ„ฐ ๊ธฐ๋Šฅ๋„ ์žˆ์ง€๋งŒ, ์ง€๊ธˆ์€ ์ƒ๊ฐํ•˜์ง€ ์•Š๋Š”๊ฑธ๋กœ)
  • ๋งˆ์Šคํ„ฐ์˜ ์œ„์น˜๋Š” ROS_MASTER_URI ํ™˜๊ฒฝ๋ณ€์ˆ˜ ์‚ฌ์šฉ
  • roscore๋Š” ๋งˆ์Šคํ„ฐ, ํŒŒ๋ผ๋ฏธํ„ฐ ์„œ๋ฒ„, ๋กœ๊ทธ ๊ธฐ๋Šฅ์„ ํ†ตํ•ฉํ•ด ๋†“์€ command tool

Messages


๐Ÿ‘‰๐Ÿผ Simply a data structure, comprising typed fields

  • Topic, Service, Action ๋“ฑ์—์„œ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•œ ๋ฐ์ดํ„ฐ ํƒ€์ž…
  • ์—ฌ๋Ÿฌ๊ฐ€์ง€ Primitive types์„ ํฌํ•จํ•  ์ˆ˜ ์žˆ๊ณ , Arrays of primitives๋„ ๊ฐ€๋Šฅ. ๋ฌผ๋ก  ์ƒ์ˆ˜(Constants)๋„ ๊ฐ€๋Šฅ
  • ๋กœ๋ด‡ ๊ด€๋ จ ๋ฉ”์‹œ์ง€๋“ค์ด ์ด๋ฏธ ๋งŽ์ด ๋งŒ๋“ค์–ด์ ธ ์‚ฌ์šฉ ๊ฐ€๋Šฅ (ํ‘œ์ค€์ฒ˜๋Ÿผ)
  • ๊ตณ์ด ์ƒˆ๋กœ์šด ๋ฉ”์‹œ์ง€๋ฅผ ๋งŒ๋“ค๊ธฐ๋ณด๋‹จ, ๋งŒ๋“ค์–ด์ ธ ์žˆ๋Š” ๋ฉ”์‹œ์ง€๋ฅผ ํ™œ์šฉํ•˜์ž. ์–ด์ฉ”์ˆ˜ ์—†๋Š” ๊ฒฝ์šฐ์—๋งŒ ๋งŒ๋“ค์–ด์„œ ์‚ฌ์šฉ
  • ํ†ต์ƒ์ ์œผ๋กœ ํŒจํ‚ค์ง€์˜ ์ด๋ฆ„์ด _msgs๋กœ ๋๋‚˜๋Š” ๊ฒƒ๋“ค์€ ๋ฉ”์‹œ์ง€๋ฅผ ๋ชจ์•„๋†“์€ ๊ฒƒ

std_msgs์— ์žˆ๋Š” ๋ฉ”์‹œ์ง€์˜ ๋ฆฌ์ŠคํŠธ

Parameter Server


๐Ÿ‘‰๐Ÿผ It allows data to be stored by key in a central location

  • ๋งˆ์Šคํ„ฐ๋ฅผ ํ†ตํ•ด ๊ฐ์ข… ๋ฐ์ดํ„ฐ๋ฅผ ์ฝ๊ฑฐ๋‚˜ ์“ธ ์ˆ˜ ์žˆ๋Š” ์ค‘์•™ ์ง‘์ค‘ํ˜• ์ €์žฅ ๊ณต๊ฐ„
  • ๋…ธ๋“œ๋“ค์ด ํ•ด๋‹น API๋ฅผ ์ด์šฉํ•ด ์ฝ๊ฑฐ๋‚˜ ์“ธ ์ˆ˜ ์žˆ์Œ
  • ๋ฐ์ดํ„ฐ ํƒ€์ž…: integers, floats, boolean, dictionaries, and lists
  • ํŒŒ์ผ ํ˜•ํƒœ๋กœ ์“ฐ๋Š” ๊ฒฝ์šฐ YAML markup language for syntax๋ฅผ ์‚ฌ์šฉ

background_b: 255
background_g: 86
background_r: 150
roslaunch:
uris: {'aqy:51932': 'http://aqy:51932/'}
run_id: e07ea71e-98df-11de-8875-001b21201aa8

Topics


๐Ÿ‘‰๐Ÿผ A name that is used to identify the content of the message, publisher and subscriber

  • ๋…ธ๋“œ์™€ ๋…ธ๋“œ๊ฐ„์˜ ๋‹จ๋ฐฉํ–ฅ ํ†ต์‹ ์„ ํ•  ๋•Œ, ๋ฉ”์‹œ์ง€๋ฅผ ๋‹ด๊ณ  ์žˆ๋Š” ์ œ๋ชฉ์œผ๋กœ ์ƒ๊ฐํ•˜๋ฉด ํŽธํ•จ (A name that is used to identify the content of the message)
  • ๋…ธ๋“œ๋Š” ํ† ํ”ฝ์„ publish(๋ฐœํ–‰)ํ•˜๊ฑฐ๋‚˜ subscribe(๊ตฌ๋…) ํ•  ์ˆ˜ ์žˆ์Œ
  • ๋น„๋™๊ธฐ ํ†ต์‹  (Asynchronous transfer), ๋‹จ๋ฐฉํ–ฅ
  • ๊ตฌ์„ฑ์— ๋”ฐ๋ผ N:N ํ†ต์‹  ๊ฐ€๋Šฅ

์š”์•ฝ

Services


๐Ÿ‘‰๐Ÿผ request / reply interactions

  • ๋…ธ๋“œ์™€ ๋…ธ๋“œ๊ฐ„์˜ ํ†ต์‹  ๋ฐฉ๋ฒ• ์ค‘ ํ•˜๋‚˜๋กœ Request/Response ํ˜•ํƒœ๋กœ ์ž‘์šฉ
  • ๋™๊ธฐ ํ†ต์‹  (Synchronous), ์–‘๋ฐฉํ–ฅ,
  • ๋ธ”๋กœํ‚น ํ•จ์ˆ˜์ฒ˜๋Ÿผ ๋™์ž‘
  • ์š”์ฒญ (request)๋ฅผ ๋ณด๋‚ด๊ณ  ์‘๋‹ต (response)๋ฅผ ๋ฐ›๋Š”๋‹ค.
  • 1:1

Actionlib


๐Ÿ‘‰๐Ÿผ Send goal / feedback / result interactions

  • ์˜ค๋žœ ์‹œ๊ฐ„์ด ๊ฑธ๋ฆฌ๋Š” ์ž‘์—…์„ ํ•ด์•ผ ํ•  ๊ฒฝ์šฐ ์‚ฌ์šฉ
    • ํ† ํ”ฝ์„ ์ด์šฉํ•˜๋ ค๋ฉด ์—ฌ๋Ÿฌ ๊ฐœ๋ฅผ ์‚ฌ์šฉํ•ด์•ผ ํ•˜๊ณ , ๊ฐ๊ฐ ์ด๋ฅผ ๊ด€๋ฆฌํ•˜๊ธฐ ์œ„ํ•œ ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•ด์•ผ ํ•จ
    • ์„œ๋น„์Šค๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด, ์ž‘์—…์ด ๋๋‚  ๋•Œ๊นŒ์ง€ ๋ธ”๋กœํ‚น ์ƒํƒœ
  • ์ด๋Ÿด๋•Œ ์‚ฌ์šฉํ•˜์ž
  • ์„œ๋ฒ„/ํด๋ผ์ด์–ธํŠธ ๊ตฌ์กฐ
  • ํ•ด๋‹น ์ž‘์—…์˜ Goal์„ ๋ณด๋‚ด๋†“๊ณ , ์š”์ฒญํ•œ ํด๋ผ์ด์–ธํŠธ๋Š” ๋‹ค๋ฅธ ์ผ ํ•  ์ˆ˜ ์žˆ์Œ. ์ค‘๊ฐ„ ์ค‘๊ฐ„ Feedback ๋ฐ›์„ ์ˆ˜ ์žˆ๊ณ , ์ž‘์—…์ด ์™„๋ฃŒ๋˜๋ฉด Result๊ฐ€ ๋„์ฐฉ
  • ์„œ๋ฒ„์™€ ํด๋ผ์ด์–ธํŠธ๊ฐ„ ํ†ต์‹ ์€ โ€œROS Action Protocolโ€์„ ์ด์šฉํ•ด์„œ, "ROS Action Protocolโ€์€ ๋ฉ”์‹œ์ง€๋ฅผ ๊ธฐ๋ฐ˜์œผ๋กœ ๋™์ž‘.

Actionlib High Level Client/Server Interaction

  • Intermediate States
    • Pending - The goal has yet to be processed by the action server
    • Active - The goal is currently being processed by the action server
    • Recalling - The goal has not been processed and a cancel request has been received from the action client, but the action server has not confirmed the goal is canceled
    • Preempting - The goal is being processed, and a cancel request has been received from the action client, but the action server has not confirmed the goal is canceled
  • Terminal States
    • Rejected - The goal was rejected by the action server without being processed and without a request from the action client to cancel
    • Succeeded - The goal was achieved successfully by the action server
    • Aborted - The goal was terminated by the action server without an external request from the action client to cancel
    • Recalled - The goal was canceled by either another goal, or a cancel request, before the action server began processing the goal
    • Preempted - Processing of the goal was canceled by either another goal, or a cancel request sent to the action server

Bag


๐Ÿ‘‰๐Ÿผ A format for saving and playing back ROS message data

  • ROS ๋ฉ”์‹œ์ง€๋ฅผ ์ €์žฅ, ์ฒ˜๋ฆฌ, ๋ถ„์„, ์‹œ๊ฐํ™”ํ•  ์ˆ˜ ์žˆ์Œ.
  • ๋‹ค์–‘ํ•œ ํ˜•ํƒœ๋กœ ํ™œ์šฉ ๊ฐ€๋Šฅ
  • ํ™•์žฅ์ž๋Š” .bag
  • rosbag, rqt_bag ๋“ฑ์˜ ๋„๊ตฌ์„ ์ด์šฉ

Uploaded by N2T

Contents

ํฌ์ŠคํŒ… ์ฃผ์†Œ๋ฅผ ๋ณต์‚ฌํ–ˆ์Šต๋‹ˆ๋‹ค

์ด ๊ธ€์ด ๋„์›€์ด ๋˜์—ˆ๋‹ค๋ฉด ๊ณต๊ฐ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค.