optional arguments: -h, --help show this help message and exit --include-hidden-topics Consider hidden topics as well
Commands: bw Display bandwidth used by topic delay Display delay of topic from timestamp in header echo Output messages from a topic find Output a list of available topics of a given type hz Print the average publishing rate to screen info Print information about a topic list Output a list of available topics pub Publish a message to a topic type Print a topic's type
Call `ros2 topic <command> -h` for more detailed usage.
[INFO] [launch]: All log files can be found below /home/er/.ros/log/2026-07-03-11-17-17-203959-er-9929 [INFO] [launch]: Default logging verbosity is set to INFO [INFO] [robot_state_publisher-1]: process started with pid [9959] [INFO] [joint_state_publisher_gui-2]: process started with pid [9961] [INFO] [rviz2-3]: process started with pid [9963] [INFO] [slider_control-4]: process started with pid [9965] [robot_state_publisher-1] Link joint2 had 1 children [robot_state_publisher-1] Link joint3 had 1 children [robot_state_publisher-1] Link joint4 had 1 children [robot_state_publisher-1] Link joint5 had 1 children [robot_state_publisher-1] Link joint6 had 1 children [robot_state_publisher-1] Link joint6_flange had 0 children [robot_state_publisher-1] [INFO] [1783048639.394243790] [robot_state_publisher]: got segment joint1 [robot_state_publisher-1] [INFO] [1783048639.394549934] [robot_state_publisher]: got segment joint2 [robot_state_publisher-1] [INFO] [1783048639.394636748] [robot_state_publisher]: got segment joint3 [robot_state_publisher-1] [INFO] [1783048639.394680932] [robot_state_publisher]: got segment joint4 [robot_state_publisher-1] [INFO] [1783048639.394718784] [robot_state_publisher]: got segment joint5 [robot_state_publisher-1] [INFO] [1783048639.394756061] [robot_state_publisher]: got segment joint6 [robot_state_publisher-1] [INFO] [1783048639.394793246] [robot_state_publisher]: got segment joint6_flange [joint_state_publisher_gui-2] [INFO] [1783048643.531952578] [joint_state_publisher]: Waiting for robot_description to be published on the robot_description topic... [joint_state_publisher_gui-2] [INFO] [1783048643.610075662] [joint_state_publisher]: Centering [joint_state_publisher_gui-2] [INFO] [1783048644.027434405] [joint_state_publisher]: Centering [rviz2-3] [INFO] [1783048644.403594556] [rviz2]: Stereo is NOT SUPPORTED [rviz2-3] [INFO] [1783048644.404085494] [rviz2]: OpenGl version: 3.1 (GLSL 1.4) [rviz2-3] [INFO] [1783048647.151156049] [rviz2]: Stereo is NOT SUPPORTED [slider_control-4] array('d', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]) [slider_control-4] array('d', [-0.0004613180000001549, -0.0004613180000001549, -0.0004613180000001549, -0.0004613180000001549, -0.0004613180000001549, -0.0004613180000001549])
실제 장비가 움직이는진 모르겠지만 뜨긴한다.
$ ros2 launch mycobot_280 test.launch.py [INFO] [launch]: All log files can be found below /home/er/.ros/log/2026-07-03-11-23-38-154196-er-10335 [INFO] [launch]: Default logging verbosity is set to INFO [INFO] [robot_state_publisher-1]: process started with pid [10367] [INFO] [joint_state_publisher_gui-2]: process started with pid [10369] [INFO] [rviz2-3]: process started with pid [10371] [robot_state_publisher-1] Link joint2 had 1 children [robot_state_publisher-1] Link joint3 had 1 children [robot_state_publisher-1] Link joint4 had 1 children [robot_state_publisher-1] Link joint5 had 1 children [robot_state_publisher-1] Link joint6 had 1 children [robot_state_publisher-1] Link joint6_flange had 0 children [robot_state_publisher-1] Link env had 0 children [robot_state_publisher-1] [INFO] [1783049020.099496084] [robot_state_publisher]: got segment env [robot_state_publisher-1] [INFO] [1783049020.099850118] [robot_state_publisher]: got segment joint1 [robot_state_publisher-1] [INFO] [1783049020.099978210] [robot_state_publisher]: got segment joint2 [robot_state_publisher-1] [INFO] [1783049020.100036728] [robot_state_publisher]: got segment joint3 [robot_state_publisher-1] [INFO] [1783049020.100077783] [robot_state_publisher]: got segment joint4 [robot_state_publisher-1] [INFO] [1783049020.100116357] [robot_state_publisher]: got segment joint5 [robot_state_publisher-1] [INFO] [1783049020.100152116] [robot_state_publisher]: got segment joint6 [robot_state_publisher-1] [INFO] [1783049020.100192041] [robot_state_publisher]: got segment joint6_flange [rviz2-3] [INFO] [1783049023.998647585] [rviz2]: Stereo is NOT SUPPORTED [rviz2-3] [INFO] [1783049023.999256988] [rviz2]: OpenGl version: 3.1 (GLSL 1.4) [joint_state_publisher_gui-2] [INFO] [1783049024.105868138] [joint_state_publisher]: Waiting for robot_description to be published on the robot_description topic... [joint_state_publisher_gui-2] [INFO] [1783049024.137961673] [joint_state_publisher]: Centering [joint_state_publisher_gui-2] [INFO] [1783049024.490631764] [joint_state_publisher]: Centering [rviz2-3] [INFO] [1783049026.693983324] [rviz2]: Stereo is NOT SUPPORTED
# The default serial port name of mycobot 280-PI version is "/dev/ttyAMA0", and the baud rate is 1000000. ros2 launch mycobot_280pi slider_control.launch.py
# The default serial port name of mycobot 280-PI version is "/dev/ttyAMA0", and the baud rate is 1000000. ros2 launch mycobot_280pi teleop_keyboard.launch.py
G90 // 절대좌표 모드(원점 기준 좌표 사용) G4 S1 // 1초 대기 G01 X170 Y0 Z60 F15 // X170 Y0 Z60 위치로 직선 이동, 이송속도 F15 G4 S1 // 1초 대기 G0 X195.54 Y-32.03 // 빠른 이동으로 별의 시작점으로 이동 G0 Z49.00 // 작업 높이(Z=49)까지 하강 G1 X195.54 Y-9.66 // 직선 가공 G1 X215.61 Y-2.75 // 오른쪽 위 꼭짓점으로 이동 G1 X195.54 Y4.16 // 왼쪽으로 이동 G1 X195.54 Y26.52 // 위쪽 꼭짓점으로 이동 G1 X183.14 Y8.43 // 왼쪽 위 대각선 이동 G1 X163.08 Y15.34 // 왼쪽 꼭짓점으로 이동 G1 X175.48 Y-2.75 // 중앙 방향으로 이동 G1 X163.08 Y-20.84 // 왼쪽 아래 꼭짓점으로 이동 G1 X183.14 Y-13.93 // 오른쪽 아래 대각선 이동 G1 X195.54 Y-32.03 // 시작점으로 복귀하여 도형 완성 G0 Z70.00 // 공구를 안전 높이(Z=70)로 상승 G0 X189.34 Y-2.75 // 다음 작업 또는 대기 위치로 빠른 이동 M21 P0 // 제조사 전용 M코드(예: 펜, 그리퍼, 디지털 출력 등 장비별 기능)
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
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)
If you want the whole port (all 16 pins) get the value, then you simply write it to the ODR register: GPIOB->ODR = 0xFFFF; //writing 1/0 in a bit position, sets/resets that bit. ALL BITS ARE AFFECTED no matter the value your write in.
If you want to set some pins, but not altering the other pins, with one instruction: GPIOB->BSRR = 0x00F; //writing 1 in a bit position, sets that bit leaves the others as they are
If you want to reset some pins, but not altering the other pins, with one instruction: GPIOB->BRR = 0x00F; //writing 1 in a bit position, clears that bit and leaves the others as they are
If you want a "portion" of a GPIO port to get an specific value, this method is 2 instructions instead of "read-change-write": GPIOB->BRR = 0x00F; //clear the first 4 bits GPIOB->BSRR = 0x00A; //set the desired bits in that 4-bit field