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
'python > ROS' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
Workspace ๊ฐ๋ ๊ณผ ๋ง๋ค๊ธฐ (0) | 2023.04.13 |
---|---|
ROS ๊ฐ์ (0) | 2023.04.06 |
ROS ๊ธฐ๋ณธ์ค์ต (0) | 2023.04.06 |
ROS ๊ธฐ๋ณธ์ฉ์ด: ํ์ผ์์คํ ๋ ๋ฒจ (0) | 2023.04.06 |
๋์คํฌ ๊ณต๊ฐ ํ๋ณดํ ์ฐ๋ถํฌ ์ค์น (0) | 2023.04.04 |
Contents
๋น์ ์ด ์ข์ํ ๋งํ ์ฝํ ์ธ
์์คํ ๊ณต๊ฐ ๊ฐ์ฌํฉ๋๋ค