55We support Python2, Python3.5 or later.
66
77<details >
8- <summary >Class :</summary >
8+ <summary >Catalogue :</summary >
99
1010<!-- vim-markdown-toc GFM -->
1111
1212* [ MyCobot] ( #mycobot )
13- * [ Overall status] ( #overall-status )
14- * [ power_on] ( #power_on )
15- * [ power_off] ( #power_off )
16- * [ is_power_on] ( #is_power_on )
17- * [ release_all_servos] ( #release_all_servos )
18- * [ is_controller_connected] ( #is_controller_connected )
19- * [ MDI mode and operation] ( #mdi-mode-and-operation )
20- * [ get_angles] ( #get_angles )
21- * [ send_angle] ( #send_angle )
22- * [ send_angles()] ( #send_angles )
23- * [ get_radians] ( #get_radians )
24- * [ send_radians] ( #send_radians )
25- * [ get_coords] ( #get_coords )
26- * [ send_coord] ( #send_coord )
27- * [ send_coords] ( #send_coords )
28- * [ sync_send_angles] ( #sync_send_angles )
29- * [ sync_send_coords] ( #sync_send_coords )
30- * [ pause] ( #pause )
31- * [ resume] ( #resume )
32- * [ stop] ( #stop )
33- * [ is_paused] ( #is_paused )
34- * [ is_in_position] ( #is_in_position )
35- * [ JOG mode and operation] ( #jog-mode-and-operation )
36- * [ jog_angle] ( #jog_angle )
37- * [ jog_coord] ( #jog_coord )
38- * [ jog_stop] ( #jog_stop )
39- * [ set_encoder] ( #set_encoder )
40- * [ get_encoder] ( #get_encoder )
41- * [ set_encoders] ( #set_encoders )
42- * [ Running status and Settings] ( #running-status-and-settings )
43- * [ get_speed] ( #get_speed )
44- * [ set_speed] ( #set_speed )
45- * [ get_joint_min_angle] ( #get_joint_min_angle )
46- * [ get_joint_max_angle] ( #get_joint_max_angle )
47- * [ Servo control] ( #servo-control )
48- * [ is_servo_enable] ( #is_servo_enable )
49- * [ is_all_servo_enable] ( #is_all_servo_enable )
50- * [ set_servo_data] ( #set_servo_data )
51- * [ get_servo_data] ( #get_servo_data )
52- * [ set_servo_calibration] ( #set_servo_calibration )
53- * [ release_servo] ( #release_servo )
54- * [ focus_servo] ( #focus_servo )
55- * [ Atom IO] ( #atom-io )
56- * [ set_color] ( #set_color )
57- * [ set_pin_mode] ( #set_pin_mode )
58- * [ set_digital_output()] ( #set_digital_output )
59- * [ get_digital_input()] ( #get_digital_input )
60- * [ set_pwm_output()] ( #set_pwm_output )
61- * [ get_gripper_value] ( #get_gripper_value )
62- * [ set_gripper_state] ( #set_gripper_state )
63- * [ set_gripper_value] ( #set_gripper_value )
64- * [ set_gripper_ini] ( #set_gripper_ini )
65- * [ is_gripper_moving] ( #is_gripper_moving )
66- * [ Basic] ( #basic )
67- * [ set_basic_output] ( #set_basic_output )
13+ * [Overall status](#overall-status)
14+ * [power_on](#power_on)
15+ * [power_off](#power_off)
16+ * [is_power_on](#is_power_on)
17+ * [release_all_servos](#release_all_servos)
18+ * [is_controller_connected](#is_controller_connected)
19+ * [MDI mode and operation](#mdi-mode-and-operation)
20+ * [get_angles](#get_angles)
21+ * [send_angle](#send_angle)
22+ * [send_angles()](#send_angles)
23+ * [get_radians](#get_radians)
24+ * [send_radians](#send_radians)
25+ * [get_coords](#get_coords)
26+ * [send_coord](#send_coord)
27+ * [send_coords](#send_coords)
28+ * [sync_send_angles](#sync_send_angles)
29+ * [sync_send_coords](#sync_send_coords)
30+ * [is_in_position](#is_in_position)
31+ * [JOG mode and operation](#jog-mode-and-operation)
32+ * [jog_angle](#jog_angle)
33+ * [jog_coord](#jog_coord)
34+ * [jog_stop](#jog_stop)
35+ * [pause](#pause)
36+ * [resume](#resume)
37+ * [stop](#stop)
38+ * [is_paused](#is_paused)
39+ * [set_encoder](#set_encoder)
40+ * [get_encoder](#get_encoder)
41+ * [set_encoders](#set_encoders)
42+ * [get_encoders](#get_encoders)
43+ * [Running status and Settings](#running-status-and-settings)
44+ * [get_speed](#get_speed)
45+ * [set_speed](#set_speed)
46+ * [get_joint_min_angle](#get_joint_min_angle)
47+ * [get_joint_max_angle](#get_joint_max_angle)
48+ * [Servo control](#servo-control)
49+ * [is_servo_enable](#is_servo_enable)
50+ * [is_all_servo_enable](#is_all_servo_enable)
51+ * [set_servo_data](#set_servo_data)
52+ * [get_servo_data](#get_servo_data)
53+ * [set_servo_calibration](#set_servo_calibration)
54+ * [release_servo](#release_servo)
55+ * [focus_servo](#focus_servo)
56+ * [Atom IO](#atom-io)
57+ * [set_color](#set_color)
58+ * [set_pin_mode](#set_pin_mode)
59+ * [set_digital_output()](#set_digital_output)
60+ * [get_digital_input()](#get_digital_input)
61+ * [set_pwm_output()](#set_pwm_output)
62+ * [get_gripper_value](#get_gripper_value)
63+ * [set_gripper_state](#set_gripper_state)
64+ * [set_gripper_value](#set_gripper_value)
65+ * [set_gripper_ini](#set_gripper_ini)
66+ * [is_gripper_moving](#is_gripper_moving)
67+ * [Basic](#basic)
68+ * [get_basic_output](#get_basic_output)
69+ * [set_basic_output](#set_basic_output)
6870* [ Angle] ( #angle )
6971* [ Coord] ( #coord )
72+ * [ utils (Module)] ( #utils-module )
73+ * [get_port_list](#get_port_list)
74+ * [detect_port_of_basic](#detect_port_of_basic)
7075
7176<!-- vim-markdown-toc -->
7277</details >
7378
7479# MyCobot
7580
81+ ** Import to your project** :
82+
7683``` python
77- from pymycobot.mycobot import MyCobot
84+ from pymycobot import MyCobot
7885```
7986
8087> Note: If no parameter is given, there is no parameter; if no return value is given, there is no return value
@@ -288,36 +295,6 @@ from pymycobot.mycobot import MyCobot
288295 - ` mode ` : (` int ` ): ` 0 ` - angular, ` 1 ` - linear
289296 - ` timeout ` : default 7s.
290297
291- ### pause
292-
293- - ** Prototype** : ` pause() `
294-
295- - ** Description** : Pause movement.
296-
297- ### resume
298-
299- - ** Prototype** : ` resume() `
300-
301- - ** Description** : Recovery movement.
302-
303- ### stop
304-
305- - ** Prototype** : ` stop() `
306-
307- - ** Description** : Stop moving.
308-
309- ### is_paused
310-
311- - ** Prototype** : ` is_paused() `
312-
313- - ** Description** : Judge whether the manipulator pauses or not.
314-
315- - ** Returns** :
316-
317- - ` 1 ` - paused
318- - ` 0 ` - not paused
319- - ` -1 ` - error
320-
321298### is_in_position
322299
323300- ** Prototype** : ` is_in_position(data, flag) `
@@ -367,6 +344,36 @@ from pymycobot.mycobot import MyCobot
367344
368345- ** Description** : Stop jog moving.
369346
347+ ### pause
348+
349+ - ** Prototype** : ` pause() `
350+
351+ - ** Description** : Pause movement.
352+
353+ ### resume
354+
355+ - ** Prototype** : ` resume() `
356+
357+ - ** Description** : Recovery movement.
358+
359+ ### stop
360+
361+ - ** Prototype** : ` stop() `
362+
363+ - ** Description** : Stop moving.
364+
365+ ### is_paused
366+
367+ - ** Prototype** : ` is_paused() `
368+
369+ - ** Description** : Judge whether the manipulator pauses or not.
370+
371+ - ** Returns** :
372+
373+ - ` 1 ` - paused
374+ - ` 0 ` - not paused
375+ - ` -1 ` - error
376+
370377### set_encoder
371378
372379- ** Prototype** : ` set_encoder(joint_id, encoder) `
@@ -398,6 +405,14 @@ from pymycobot.mycobot import MyCobot
398405 - ` encoders ` : A encoder list, length 6.
399406 - ` sp ` : speed 0 - 100
400407
408+ ### get_encoders
409+
410+ - ** Prototype** : ` get_encoders() `
411+
412+ - ** Description** : Get the six joints of the manipulator.
413+
414+ - ** Returns** : the list of encoder (` list ` )
415+
401416## Running status and Settings
402417
403418### get_speed
@@ -489,7 +504,7 @@ from pymycobot.mycobot import MyCobot
489504 - ` 1 ` : enable
490505 - ` -1 ` : error
491506
492- ## set_servo_calibration
507+ ### set_servo_calibration
493508
494509- ** Prototype** : ` set_servo_calibration(servo_no) `
495510- ** Description** : The current position of the calibration joint actuator is the angle zero point, and the corresponding potential value is 2048.
@@ -616,6 +631,18 @@ from pymycobot.mycobot import MyCobot
616631
617632## Basic
618633
634+ ### get_basic_output
635+
636+ - ** Prototype** : ` get_basic_output(pin_no) `
637+
638+ - ** Description** : Get bottom pin.
639+
640+ - ** Parameters**
641+
642+ - ` pin_no ` (` int ` ) Pin number.
643+
644+ - ** Return** : ` pin_signal ` (` int ` ) 0 / 1
645+
619646### set_basic_output
620647
621648- ** Prototype** : ` set_basic_output(pin_no, pin_signal) `
@@ -630,7 +657,7 @@ from pymycobot.mycobot import MyCobot
630657# Angle
631658
632659``` python
633- from pymycobot.genre import Angle
660+ from pymycobot import Angle
634661```
635662
636663** Description**
@@ -640,11 +667,50 @@ Instance class of joint. It's recommended to use this class to select joint.
640667# Coord
641668
642669``` python
643- from pymycobot.genre import Coord
670+ from pymycobot import Coord
644671```
645672
646673** Description**
647674
648675Instance class of coord. It's recommended to use this class to select coord.
649676
677+ # utils (Module)
678+
679+ This module support some help method.
680+
681+ ** Usage:**
682+
683+ ``` python
684+ from pymycobot import utils
685+ ```
686+
687+ ## get_port_list
688+
689+ - ** Prototype** : ` get_port_list() `
690+
691+ - ** Description** : Get the all serial port list.
692+
693+ - ** Return** : serial port list (` list ` )
694+
695+ ## detect_port_of_basic
696+
697+ - ** Prototype** : ` detect_port_of_basic() `
698+
699+ - ** Description** : Returns the serial port string of the first detected M5 Basic. If it is not found, it returns ` None ` .
700+
701+ - ** Return** : detected port (` str ` ) or ` None `
702+
703+ - ** Example** :
704+
705+ ``` python
706+ from pymycobot import MyCobot, utils
707+
708+ port = utils.detect_port_of_basic()
709+ if port is None :
710+ raise Exception (' Detection failed.' )
711+ mycobot = MyCobot(port, 115200 )
712+ ```
713+
650714---
715+
716+ More demo can go to [ here] ( ../demo ) .
0 commit comments