๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

์นดํ…Œ๊ณ ๋ฆฌ ์—†์Œ

[Spot Dynamixel - 2] Dynamixel SDK manual

 

๐Ÿ“ฐ

Dynamixel SDK manual

 

๋กœ๋ณดํ‹ฐ์ฆˆ์˜ Dynamixel์„ ์ œ์–ดํ•˜๊ธฐ ์œ„ํ•ด ํ•„์š”ํ•œ ์ž‘์—…๋“ค์„ ์†Œ๊ฐœํ•˜๊ณ  ์˜ˆ์‹œ ์ฝ”๋“œ๋ฅผ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค.

 

 

Reprository download

$ git clone https://github.com/ROBOTIS-GIT/DynamixelSDK.git

 

File Structure

repo clone์„ ํ•˜๊ฒŒ ๋˜๋ฉด ๋‹ค์Œ์˜ ํด๋”๋“ค์ด ์กด์žฌํ•˜๋ฉฐ ๋ณธ์ธ์ด ์‚ฌ์šฉํ•  ์–ธ์–ด์— ํ•ด๋‹นํ•˜๋Š” ํด๋”๋ฅผ ์„ ํƒํ•˜์—ฌ ์‚ฌ์šฉํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค.

⇒ ex ) c++ ํด๋” ์•ˆ์—๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์ด ๊ตฌ์„ฑ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.

Device Setup


Dynamixel ์„ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•ด์„œ๋Š” ์ค‘๊ฐ„ controller๊ฐ€ ํ•„์š”ํ•˜๋ฉฐ, ์ด์™€ Dynamixel์„ setup ํ•  ํ•„์š”๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.

 

Controller Setup


  • U2D2๊ฐ€ ๋” ์ตœ์‹ ์— ๋‚˜์˜จ ๊ฒƒ์œผ๋กœ ๋‹ค์ด๋‚˜๋ฏน์…€ ๋ชจํ„ฐ์— ๋”ฐ๋ผ ๋‹ค๋ฅธ ํ†ต์‹ ๋ฐฉ์‹์ธ TTL๊ณผ RS485 ๋ฐฉ์‹์ด ์ž๋™์œผ๋กœ ์ „ํ™˜๋˜์–ด ์‚ฌ์šฉ์ด ํ›จ์”ฌ ํŽธ๋ฆฌํ•ฉ๋‹ˆ๋‹ค.
  • ์ž์„ธํ•œ ์„ค๋ช…์€ ์œ„ ๋งํฌ์— ์žˆ์œผ๋ฉฐ, ๋ชจํ„ฐ์— ๋”ฐ๋ผ ์‚ฌ์šฉํ•˜๋Š” ํ†ต์‹ ๋ฐฉ์‹์€ ํ•˜๋‹จ ์‚ฌ์ง„๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

 

Installation on Windows

๐Ÿ’ก
FTDI Driver ์„ค์น˜๊ฐ€ ํ•„์š”ํ•˜๋ฉฐ, ROBOTICS RoboPlus software ๋ฅผ ์„ค์น˜ํ•˜์‹œ๋ฉด FTDI Driver๊ฐ€ ์ž๋™์œผ๋กœ ์„ค์น˜๋ฉ๋‹ˆ๋‹ค.
ROBOTIS
The study of human experiences, experiences, Scroll Down ์ œ22๊ธฐ ์‚ฌ์—…๋ณด๊ณ ์„œ ๋ฐ ๊ฐ์‚ฌ๋ณด๊ณ ์„œ ์•ˆ๋…•ํ•˜์„ธ์š”. ๋กœ๋ณดํ‹ฐ์ฆˆ ์ œ22๊ธฐ ์‚ฌ์—…๋ณด๊ณ ์„œ ๋ฐ ๊ฐ์‚ฌ๋ณด๊ณ ์„œ ๊ณต์ง€๋“œ๋ฆฌ์˜ค๋‹ˆ, ์ž์„ธํ•œ ์‚ฌํ•ญ์€ ์ฒจ๋ถ€ํŒŒ์ผ์„ ์ฐธ๊ณ ํ•ด์ฃผ์‹œ๊ธฐ ๋ฐ”๋ž๋‹ˆ๋‹ค.&nbs... ์ œ22๊ธฐ ์ •๊ธฐ ์ฃผ์ฃผ์ดํšŒ ์†Œ์ง‘๊ณต๊ณ  ์•ˆ๋‚ด์˜ ๊ฑด ์ฃผ์ฃผ๋‹˜์˜ ๊ฑด์Šน๊ณผ ๋Œ๋‚ด์˜ ํ‰์•ˆ์„ ๊ธฐ์›ํ•ฉ๋‹ˆ๋‹ค. ์šฐ๋ฆฌ ํšŒ์‚ฌ๋Š” ์ •๊ด€ ์ œ24์กฐ์— ์˜ํ•˜์—ฌ ์ œ22๊ธฐ ์ •๊ธฐ์ฃผ์ฃผ์ดํšŒ๋ฅผ ์•„๋ž˜์™€ ๊ฐ™์ด ๊ฐœ์ตœํ•˜์˜ค๋‹ˆ ์ฐธ์„ํ•˜์—ฌ ... 2021๋…„ ์ƒˆํ•ด ๋ณต ๋งŽ์ด ๋ฐ›์œผ์„ธ์š”!
https://www.robotis.com/service/downloadpage.php?ca_id=10

 

Jetson nano ๋ณด๋“œ๋ฅผ ์‚ฌ์šฉํ•˜๊ธฐ ๋•Œ๋ฌธ์— Windows ์„ค์น˜๊ณผ์ •์€ ๋งํฌ๋กœ ๋Œ€์ฒดํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

ROBOTIS e-Manual
Edit on GitHub To use the DYNAMIXEL SDK, you need to set up the Controller and DYNAMIXEL. DYNAMIXEL's communicate at one of the following signal levels: Please check to see whether your DYNAMIXEL is a TTL-based DYNAMIXEL or an RS485-based DYNAMIXEL. TTL-based DYNAMIXEL's have 3P connectors while RS485-based DYNAMIXEL's have 4P connectors.
https://emanual.robotis.com/docs/en/software/dynamixel/dynamixel_sdk/device_setup/#controller

 

Installation in Linux


⇒ ๋Œ€๋ถ€๋ถ„์˜ Linux ์—์„œ๋Š” FTDI Driver์— ๊ด€ํ•œ FT232RL driver ๊ฐ€ ํฌํ•จ๋˜์–ด ์žˆ์œผ๋ฏ€๋กœ, ๋”ฐ๋กœ driver๋ฅผ ์„ค์น˜ํ•  ํ•„์š”๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค.

Library Setup

์–ธ์–ด์™€ OS์—๋”ฐ๋ผ setup ์ด ๋‹ค๋ฅด๊ธฐ ๋•Œ๋ฌธ์— ๋‹ค์Œ ๋งํฌ๋ฅผ ์ฐธ์กฐํ•˜์„ธ์š”.

⇒ Spotmicro Dynamixel์€ Linux๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  python์„ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.

ROBOTIS e-Manual
Edit on GitHub The DYNAMIXEL SDK example code for Python uses the library files built in previous step. Run Example Open python folder with Atom. Modify the settings that is needed for the DYNAMIXEL control. Run read_write.py by double click Or run it manually through command prompt, using cd.
https://emanual.robotis.com/docs/en/software/dynamixel/dynamixel_sdk/library_setup/python_linux/#python-linux

 

Editor install

  • vscode ์„ค์น˜
$ git clone https://github.com/JetsonHacksNano/installVSCode.git
$ cd installVSCode
$ ./installVSCode.sh

$ code .

 

Download Python for Linux

$ python3 --version                # python ๋ฒ„์ „ํ™•์ธ

$ sudo apt-get install python3     # python3 ์„ค์น˜
๐Ÿ’ก
python ๋ฒ„์ „ 2.x ๋„ ์ƒ๊ด€์—†๋‹ค๊ณ  ๋‚˜์™€์žˆ์ง€๋งŒ ์›ฌ๋งŒํ•˜๋ฉด 3.x ์ด์ƒ์„ ์จ๋ด…์‹œ๋‹ค!

 

Library Install

cloneํ•œ ํด๋” python ๋‚ด์— setup.py ํŒŒ์ผ์„ ์‹คํ–‰์‹œ์ผœ ์ค๋‹ˆ๋‹ค.

$ cd DynamixelSDK/python
$ python3 setup.py install

 

Sample Code ์‹คํ–‰

/DynamixelSDK/python/tests ๋‚ด์— ์‚ฌ์šฉ์ค‘์ธ Dynamixel ํ†ต์‹  protocol type ์— ๋งž๋Š” ์˜ˆ์ œ๋ฅผ ์‹คํ–‰์‹œํ‚ต๋‹ˆ๋‹ค.

⇒ ์‹คํ–‰๋ฐฉ๋ฒ•๊ณผ ์ž์„ธํ•œ ์ฝ”๋“œ ์„ค๋ช…์€ ๋‹ค์Œ ๋…ธ์…˜์— ๋”ฐ๋กœ ์ค€๋น„๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.
protocol 2.0๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๋ชจํ„ฐ ์‹œ๋ฆฌ์ฆˆ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.
⇒ ๋‚˜๋จธ์ง€๋Š” protocol 1.0์„ ์‚ฌ์šฉํ•˜์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค
๐Ÿ’ก
์ฐธ๊ณ ๋งํฌ https://emanual.robotis.com/docs/en/dxl

 

 

Reference

  • Dynamixel SDK Python PortHandler
ROBOTIS e-Manual
Edit on GitHub Base class for serial communication. DEFAULT_BAUDRATE_ :=1000000 Default Baudrate is_using_ Shows whether the port is in-use Method References PortHandler openPort None Detailed Description This function opens the port by setBaudRate function using default baudrate(1M). If the baudrate is needed to be changed to another baudrate value, setBaudRate function should be called again after calling openPort function.
https://emanual.robotis.com/docs/en/software/dynamixel/dynamixel_sdk/api_reference/python/python_porthandler/#python
  • Dynamixel SDK Overview
Overview
Edit on GitHub DYNAMIXEL SDK is a software development kit that provides DYNAMIXEL control functions using packet communication. The API of DYNAMIXEL SDK is designed for DYNAMIXEL actuators and DYNAMIXEL-based platforms. You need to be familiar with C/C++ programming language for right use of the software.
https://emanual.robotis.com/docs/en/software/dynamixel/dynamixel_sdk/overview/