embeded/robot

elephant robotics cobot python api

구차니 2023. 12. 21. 18:02

좌표계를 이해할 시간에

차라리 get_coords() 함수로 x,y,z,rx,ry,rz를 읽어서 저장하고

send_coords()를 이용하여 저장된 위치로 이동시키면 간단하게 만들수 있다.

 

get_coords
Prototype: get_coords()

Description: Get the Coords from robot arm, coordinate system based on base.

Returns: list: A float list of coord - [x, y, z, rx, ry, rz]

send_coords
Prototype: send_coords(coords, speed, mode)

Description: Send all coords to robot arm.

Parameters

coords: a list of coords value(List[float]), length 6.
speed: (int) 0 ~ 100
mode: (int): 0 - angular, 1 - linear
Example

from pymycobot.mycobot import MyCobot
from pymycobot.genre import Coord

mycobot = MyCobot('/dev/ttyUSB0')
mycobot.send_coords([160, 160, 160, 0, 0, 0], 70, 0)

[링크 : https://docs.elephantrobotics.com/docs/gitbook-en/7-ApplicationBasePython/7.8_API.html#getcoords]

 

atom 버튼을 눌러서 자동으로 좌표 나오게 한다거나

서보의 힘을 빼는게 아니라 약하게 해서 위치를 살짝 트는건 안되려나?

release_all_servo()는 전원 끈마냥 훅 쓰러지니 주의

[링크 : https://docs.elephantrobotics.com/docs/gitbook-en/7-ApplicationBasePython/7.8_API.html#releaseallservos]