Skip to content

Commit fe85166

Browse files
committedJul 19, 2021
release v2.5.4
1 parent 694822f commit fe85166

File tree

7 files changed

+107
-49
lines changed

7 files changed

+107
-49
lines changed
 

‎.vscode/settings.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55
"datas",
66
"datefmt",
77
"fomatter",
8+
"gpio",
89
"mesg",
910
"mycobot",
1011
"pymycobot",
1112
"struct",
1213
"zhang"
13-
]
14-
}
14+
],
15+
"restructuredtext.confPath": ""
16+
}

‎CHANGELOG.md

+67-32
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,47 @@
1-
# 2021
1+
# ChangeLog for pymycobot.
22

3-
## 6.24
3+
## v2.5.4 (2021-07-19)
4+
5+
- release v2.5.4
6+
- add methods for raspberry pi version basic control.
7+
- `def gpio_init(self)`
8+
- `def gpio_output(self, pin, v)`
9+
10+
---
11+
12+
## v2.5.3 (2021-06-24)
413

514
- release v2.5.3
615
- sync with Atom3.1
716

8-
## 6.10
17+
---
18+
19+
## v2.5.1 (2021-06-10)
920

10-
- release v2.5.1
1121
- improved parameter checking.
1222
- new class `MycobotCommandGenerator` that generate binary real command.
1323
- can import needed class from `pymycobot`, like:
1424
```python
1525
from pymycobot import Mycobot, Angle, Coord, MycobotCommandGenerator
1626
```
1727

18-
## 5.27
28+
---
29+
30+
## v2.4.2 (2021-05-27)
1931

2032
- release v2.4.2
2133
- fixed `set_pwm_output()`
2234

23-
## 5.24
35+
---
36+
37+
## 2021-05-24
2438

2539
- update demo.
2640

27-
## 4.27
41+
---
42+
43+
## v2.4.0 (2021-04-27)
2844

29-
- release v2.4.0
3045
- set_free_mode -> release_all_servos
3146
- Add new port:
3247
- is_controller_connected
@@ -36,88 +51,108 @@
3651
- set_basic_output
3752
- Update API document.
3853

39-
## 4.25
54+
---
55+
56+
## v2.3.6 (2021-04-25)
4057

41-
- release v2.3.6
4258
- fix focus_servo error
4359

44-
## 4.20
60+
---
61+
62+
## v2.3.5 (2021-04-20)
4563

46-
- release v2.3.5
4764
- fix v2.3.4 install error
4865

49-
## 4.19
66+
---
67+
68+
## v2.3.4 (2021-04-19)
5069

51-
- release **v2.3.4**
5270
- update debug mode
5371

54-
## 4.2
72+
---
73+
74+
## v2.3.3 (2021-04-02)
5575

56-
- relase **v2.3.3**
5776
- fix bug.
5877

59-
## 3.29
78+
---
79+
80+
## v2.3.1 (2021-03-29)
6081

61-
- release **v2.3.1**
6282
- fix error bug
6383
- add new method `set_encoder`, `get_encoder`, `set_encoders`
6484

65-
## 3.26
85+
---
86+
87+
## v2.3.0 (2021-03-26)
6688

67-
- release **v2.3**
6889
- fix `is_in_position()`
6990
- refactor process method
7091
- some methods can be chained
7192
- add new methods to control pump
7293
- change `set_led_color(rgb:str)` -> `set_color(r:int, g:int, b:in)`
7394

74-
## 3.12
95+
---
96+
97+
## 2021-03-12
7598

7699
added more test file.
77100

78-
## 2.5
101+
---
79102

80-
relase **v2.2.0**
103+
## v2.2.0 (2021-02-05)
81104

82105
- add new method for girpper and IO.
83106

84-
## 1.25
107+
---
85108

86-
release **v2.1.2**
109+
## v2.1.2 (2021-01-25)
87110

88111
- refactor pymycobot
89112
- add Error class
90113

91-
## 1.20
114+
---
115+
116+
## 2021-01-20
92117

93118
`v1.0.6` fix get_coords() error.
94119

95120
relase v2.0.0
96121

97-
## 1.16
122+
---
123+
124+
## 2021-01-16
98125

99126
Upload to server, can use `pip` to installation now.
100127

101-
## 1.9
128+
---
129+
130+
## 2021-01-09
102131

103132
Fix the API problem that `is_moving()` and other methods of mycobot cannot be used.
104133

105-
## 1.8
134+
---
135+
136+
## 2021-01-08
106137

107138
Python API add new methods:
108139

109140
- `jog_angle()`
110141
- `jog_coord()`
111142
- `jog_stop()`
112143

113-
# 2020
144+
---
114145

115-
## 12.30
146+
## 202-12-30
116147

117148
Adding usage documents to Python API.
118149

119-
## 12.29
150+
---
151+
152+
## 2020-12-29
120153

121154
Python API supports python2.7
122155

123156
Modify the serial port to manual setting, support the use of window.
157+
158+
---

‎Makefile

+10-5
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,21 @@ lint:
66
@if [ ! -f flake8 ]; then $(PY) -m pip install flake8; fi
77
flake8
88

9+
.PHONY: format
10+
format:
11+
@if [ ! `$(PY) -m pip freeze | grep black` ]; then $(PY) -m pip install black; fi
12+
$(PY) -m black ./pymycobot ./setup.py
13+
914
.PHONY: test
1015
test:
1116
@if [ ! -f pytest ]; then $(PY) -m pip install pytest; fi
1217
pytest -s ./tests/test_api.py
1318

19+
.PHONY: clean
20+
clean:
21+
find . -type f -name *.pyc -delete
22+
find . -type d -name __pycache__ -delete
23+
1424
.PHONY: del
1525
del: clean
1626
@if [ -d ./dist ]; then rm -r ./dist/; fi
@@ -25,8 +35,3 @@ install: del
2535
release: del
2636
$(PY) setup.py sdist bdist_wheel
2737
twine upload dist/*
28-
29-
.PHONY: clean
30-
clean:
31-
find . -type f -name *.pyc -delete
32-
find . -type d -name __pycache__ -delete

‎pymycobot/__init__.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
from __future__ import absolute_import
22
import os
3+
34
if os.environ.get("_MYCOBOT_VERSION_ONLY") != "1":
45
from pymycobot.mycobot import MyCobot
56
from pymycobot.generate import MycobotCommandGenerater
67
from pymycobot.genre import Angle, Coord
78

89
__all__ = ["MyCobot", "MycobotCommandGenerater", "Angle", "Coord"]
910

10-
__version__ = "2.5.3"
11+
__version__ = "2.5.4"
1112
__author__ = "Zachary zhang"
1213
__email__ = "lijun.zhang@elephantrobotics.com"
1314
__git_url__ = "https://github.com/elephantrobotics/pymycobot"

‎pymycobot/generate.py

+3-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import math
21
import logging
32
import sys
43

@@ -179,9 +178,7 @@ def send_angle(self, id, degree, speed):
179178
speed (int): 0 ~100
180179
"""
181180
check_datas(joint_id=id, degree=degree, speed=speed)
182-
return self._mesg(
183-
Command.SEND_ANGLE, id, [self._angle_to_int(degree)], speed
184-
)
181+
return self._mesg(Command.SEND_ANGLE, id, [self._angle_to_int(degree)], speed)
185182

186183
# @check_parameters(Command.SEND_ANGLES)
187184
def send_angles(self, degrees, speed):
@@ -213,9 +210,7 @@ def send_coord(self, id, coord, speed):
213210
speed(int):
214211
"""
215212
check_datas(speed=speed)
216-
return self._mesg(
217-
Command.SEND_COORD, id, [self._coord_to_int(coord)], speed
218-
)
213+
return self._mesg(Command.SEND_COORD, id, [self._coord_to_int(coord)], speed)
219214

220215
def send_coords(self, coords, speed, mode):
221216
"""Send all coords
@@ -468,7 +463,7 @@ def is_gripper_moving(self):
468463

469464
# Basic
470465
def set_basic_output(self, pin_no, pin_signal):
471-
"""
466+
"""Set basic output for M5 version.
472467
473468
Args:
474469
pin_signal: 0 / 1

‎pymycobot/mycobot.py

+19
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,25 @@ def sync_send_coords(self, coords, speed, mode, timeout=7):
163163
time.sleep(0.1)
164164
return self
165165

166+
# Basic for raspberry pi.
167+
def gpio_init(self):
168+
"""Init GPIO module.
169+
Raspberry Pi version need this.
170+
"""
171+
import RPi.GPIO as GPIO
172+
173+
GPIO.setmode(GPIO.BMC)
174+
self.gpio = GPIO
175+
176+
def gpio_output(self, pin, v):
177+
"""Set GPIO output value.
178+
Args:
179+
pin: port number(int).
180+
v: Output value(int), 1 - GPIO.HEIGH, 2 - GPIO.LOW
181+
"""
182+
self.gpio.setup(pin, self.gpio.OUT)
183+
self.gpio.setup(pin, v)
184+
166185
# Other
167186
def wait(self, t):
168187
time.sleep(t)

‎setup.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@
77
sys.exit(1)
88

99
import setuptools
10+
1011
os.environ["_MYCOBOT_VERSION_ONLY"] = "1"
1112
import pymycobot
1213

1314
if PYTHON_VERSION == (2, 7):
1415
long_description = ""
1516
else:
16-
long_description = open("pymycobot/README.md").read()
17+
long_description = open("README.md").read() + open("docs/README.md").read()
1718

1819
setuptools.setup(
1920
name="pymycobot",

0 commit comments

Comments
 (0)
Failed to load comments.