Matlab dynamixel SDK 포트 관련 질문드립니다

안녕하세요, PC(Matlab) - 라즈베리파이-U2D2-AX-18A 구성으로 사용 중입니다.

각종 퀵 가이드를 확인하여, 라즈베리파이 내 dynamixelSDK, Matlab dynamixelSDK를 설치하였습니다.

protocol 1.0의 matlab 예제를 사용하여 Read_Write 예제를 실행하였습니다.
DXL_ID = 1;
BAUDRATE = 115200;
DEVICENAME = ‘/dev/ttyUSB0’;

위와 같이 통신포트를 설정하였고,
mypi = raspi(‘IPADRESS’,‘pi’,‘PASSWOARD’);
를 사용하여 라즈베리파이를 연결하였습니다.

예제를 실행하니,

read_write
Failed to open the port!
Press any key to terminate…
오류가 발생하였습니다.

위와 관련하여, 같은 코드에 U2D2를 PC에 연결하여 DEVICENAME만 'COM3’로 변경하니 예제 동작이 잘되었습니다.

PC(Matlab) - 라즈베리파이-U2D2-AX-18A 구성일때,
mypi = raspi(‘IPADRESS’,‘pi’,‘PASSWOARD’);로 mypi를 불러온 후 port_num = portHandler(DEVICENAME);에 ttyUSB0를 사용하게 하려면 어떻게 해야할까요??

참고사항으로 rspi/dev/ttyUSB0 , /rapi/dev/ttyUSB0 등은 시도를 하였습니다.

DEVICENAME에 어떤 변수를 넣으면 될까요??

There are two possible explanations for this error:

  1. The port has a different name on your system. In this case, you can get a list of all your ports by running the command ‘dmesg | grep tty’ and find the correct port name.
  2. You don’t have permissions to write to the serial port. Using sudo or adding your user to the dialout group will resolve permissions related issues.

우선 답변에 감사드립니다.

1번 port name은 RPI SSH에서 확인하였습니다.

2번 항목의 dialout group은 제 RPI4의 이름이 pi입니다. 아래 스크린샷이 맞을까요?

추가적으로 matlab에서 PC와 원격으로 연결된 mypi의 USB0 데이터를 받기 위해서 'DEVICENAME’에 적절한 변수 값을 넣어주어 한다고 생각합니다.

Dynamixel SDK MATLAB Example protocol 1.0 Read_Write 예제의 port_num = portHandler(DEVICENAME);이 0을 반환하여 진행이 되지 않는 것을 확인하였습니다.

Window matlab 상에서 RPI4의 USB0 port를 사용하기 위한 추가적인 방법을 제시해주시면 감사드리겠습니다.

Are you able to connect with the DYNAMIXELs over this port when using a different program like DYNAMIXEL Wizard? That way we can confirm that the port is working correctly.

Aside from this, looking at the documentation for MATLAB it seems like you need to use the specific RPi interface functions to send remote serial data. The DYNAMIXEL SDK examples weren’t written with this in mind, so it looks to me like you will need to make some code changes to get things to work the way you want them to.