T in the figure is the set tool coordinate system. The posture of this coordinate system is consistent with O’, and the relative displacement of the origin has occurred. Use the python function to set the tool coordinate system:
set_tool_reference([x, y, z, rx, ry, rz]) //Set tool coordinate system set_end_type(1) //Set the end coordinate system type as tool Assume that the tool coordinate system T is not rotated relative to O' (rx = ry = rz = 0) Assume that the origin of the tool coordinate system T is in the coordinate system O’ at (x = 0, y = 0, z = 100mm) The final tool coordinate system parameter is set_tool_reference(0, 0, 100, 0, 0, 0)
Function: Set Tool coordinate system。 Parameters: coords: The coordinate value of [x, y, z, rx, ry, rz] has a length of 6, x, y, z ranging from - 280 to 280, and rx, ry, yz ranging from - 314 to 314 Return Value: None
2.4 get_tool_reference()
Function: Get Tool coordinate system。 Return Value: Returns a coordinate list with a length of 6
2.9 set_end_type(end)
Function: Set end coordinate system。 Parameters: end: 0 - flange(default),1 - tool Return Value: None
3.0 get_end_type()
Function: Get end coordinate system Return Value: 0 - flange(default),1 - tool, -1 - error
// ── QML 엔진 설정 ───────────────────────────────────── QQmlApplicationEngine engine;
// QML에서 'socketClient', 'uiController' 이름으로 접근 가능 engine.rootContext()->setContextProperty("socketClient", &socketClient); engine.rootContext()->setContextProperty("uiController", &uiController);
from pymycobot.mycobot import MyCobot from pymycobot import PI_PORT, PI_BAUD mc = MyCobot(PI_PORT, PI_BAUD) mc.set_color(0,0,255) mc.get_digital_input(39) # atom 누르지 않고 1 mc.get_digital_input(39) # atom 누르고 0 mc.power_off() # atom off mc.get_digital_input(39) # atom 안 읽힘 mc.get_digital_input(39) mc.power_on() # atom on mc.get_digital_input(39) # atom 누르지 않고 1 mc.get_digital_input(39) # atom 누르고 0 mc.is_power_on() 1 mc.power_off() mc.is_power_on() 0 mc.power_on()
1.1 power_on() Function: Atom open communication (default open) 1.2 power_off() Function: Atom turn off communication 1.3 is_power_on() Function: judge whether robot arms is powered on or not
서보(관절별) 잠그고, 푸는 명령
2.11 release_servo(servo_id) Function: release a servo 5.4 focus_servo(servo_id) Function: power on designated servo
gpt 보고 짜달라니 잘 짜준다
#!/usr/bin/env python3
import curses import time
from pymycobot.mycobot import MyCobot from pymycobot import PI_PORT, PI_BAUD
# ------------------------------------------------- # myCobot # ------------------------------------------------- mc = MyCobot(PI_PORT, PI_BAUD)