Skip to content

Commit f543697

Browse files
committed
update
1 parent d345174 commit f543697

6 files changed

Lines changed: 447 additions & 329 deletions

File tree

.github/workflows/python.yaml

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,52 @@
1-
name: CheckPackage
2-
on: [push]
1+
# name: CheckPackage
2+
# on: [push]
33

4-
jobs:
5-
build:
6-
runs-on: ubuntu-latest
7-
strategy:
8-
max-parallel: 5
9-
matrix:
10-
python-version: [3.6, 3.7, 3.8]
11-
steps:
12-
- uses: actions/checkout@master
13-
- name: Setup Python ${{ matrix.python-version }}
14-
uses: actions/setup-python@v1
15-
with:
16-
python-version: ${{ matrix.python-version }} # Version range or exact version of a Python version to use, using semvers version range syntax.
17-
# architecture: 'x64' # (x64 or x86)
18-
# - name: Set up Python ${{ matrix.python-version }}
19-
# uses: actions/setup-python@v1
20-
# with:
21-
# python-version: ${{ matrix.python-version }}
22-
# - name: Install dependencies
23-
# run: |
24-
# python -m pip install --upgrade pip setuptools wheel build_utils
25-
# - name: Lint with flake8
26-
# run: |
27-
# pip install flake8
28-
# # stop the build if there are Python syntax errors or undefined names
29-
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
30-
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
31-
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
32-
- name: Install Poetry
33-
uses: dschep/install-poetry-action@v1.3
34-
# with:
35-
# version: 1.0.0b3
36-
- name: Turn off Virtualenvs
37-
run: poetry config virtualenvs.create false
38-
- name: Install packages
39-
run: poetry install
40-
- name: Run PyTest
41-
run: poetry run pytest
42-
# - name: Run mypy
43-
# run: poetry run mypy mdh
44-
# - name: nosetests
45-
# run: |
46-
# pip install nose
47-
# cd python
48-
# python -m pip install -e .
49-
# cd tests
50-
# nosetests -vs test.py
51-
# - name: Python Style Checker
52-
# uses: andymckay/pycodestyle-action@0.1.3
4+
# jobs:
5+
# build:
6+
# runs-on: ubuntu-latest
7+
# strategy:
8+
# max-parallel: 5
9+
# matrix:
10+
# python-version: [3.6, 3.7, 3.8]
11+
# steps:
12+
# - uses: actions/checkout@master
13+
# - name: Setup Python ${{ matrix.python-version }}
14+
# uses: actions/setup-python@v1
15+
# with:
16+
# python-version: ${{ matrix.python-version }} # Version range or exact version of a Python version to use, using semvers version range syntax.
17+
# # architecture: 'x64' # (x64 or x86)
18+
# # - name: Set up Python ${{ matrix.python-version }}
19+
# # uses: actions/setup-python@v1
20+
# # with:
21+
# # python-version: ${{ matrix.python-version }}
22+
# # - name: Install dependencies
23+
# # run: |
24+
# # python -m pip install --upgrade pip setuptools wheel build_utils
25+
# # - name: Lint with flake8
26+
# # run: |
27+
# # pip install flake8
28+
# # # stop the build if there are Python syntax errors or undefined names
29+
# # flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
30+
# # # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
31+
# # flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
32+
# # - name: Install Poetry
33+
# # uses: dschep/install-poetry-action@v1.3
34+
# # # with:
35+
# # # version: 1.0.0b3
36+
# # - name: Turn off Virtualenvs
37+
# # run: poetry config virtualenvs.create false
38+
# # - name: Install packages
39+
# # run: poetry install
40+
# # - name: Run PyTest
41+
# # run: poetry run pytest
42+
# # - name: Run mypy
43+
# # run: poetry run mypy mdh
44+
# # - name: nosetests
45+
# # run: |
46+
# # pip install nose
47+
# # cd python
48+
# # python -m pip install -e .
49+
# # cd tests
50+
# # nosetests -vs test.py
51+
# # - name: Python Style Checker
52+
# # uses: andymckay/pycodestyle-action@0.1.3

dev/test2.py

Lines changed: 42 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -14,52 +14,58 @@
1414
np.set_printoptions(suppress=True)
1515

1616
def kevin():
17-
mm = pi
18-
"""alpha a theta d"""
19-
dh = [
20-
{'alpha': 0, 'a': 0, 'theta': 0, 'd': 0, 'type': 1},
21-
{'alpha': pi/2, 'a': 50, 'theta': 0, 'd': 0, 'type': 1},
22-
{'alpha': 0, 'a': 65, 'theta': 0, 'd': 0, 'type': 1},
23-
{'alpha': 0, 'a': 68, 'theta': 0, 'd': 0, 'type': 1, 'fixed': True}
24-
]
17+
mm = pi
18+
"""alpha a theta d"""
19+
dh = [
20+
{'alpha': 0, 'a': 0, 'theta': 0, 'd': 0, 'type': 1, "degrees": False},
21+
{'alpha': pi/2, 'a': 50, 'theta': 0, 'd': 0, 'type': 1, "degrees": False},
22+
{'alpha': 0, 'a': 65, 'theta': 0, 'd': 0, 'type': 1, "degrees": False},
23+
{'alpha': 0, 'a': 68, 'theta': 0, 'd': 0, 'type': 1, 'fixed': True, "degrees": False}
24+
]
2525

26-
return dh
26+
return dh
2727

2828
def main():
29-
# l = RevoluteLink(1,2,3,4)
29+
# l = RevoluteLink(1,2,3,4)
3030

31-
t = kevin()
32-
kc = KinematicChain.from_parameters(t)
33-
print(f">> size: {kc.size}")
31+
t = kevin()
32+
kc = KinematicChain.from_parameters(t)
33+
print(f">> size: {kc.size}")
3434

35-
for l in kc:
36-
print(f">> {l}")
35+
for l in kc:
36+
print(f">> {l}")
3737

38-
t = kc.forward(np.deg2rad([0,0,0,0]))
39-
print(t)
38+
t = kc.forward([0,0,0,0])
39+
print(">> forward [0,0,0,0]:", t)
4040

41-
t = kc.forward(np.deg2rad([0,82.62,-154.1,0]))
42-
print(t)
41+
t = kc.forward_d([0,82.62,-154.1,0])
42+
print(">> forward [other]:", t)
4343

44-
jnts = kc.inverse(t)
45-
print(">> ", np.rad2deg(jnts))
4644

47-
p = np.array([
48-
[0,1,0, 80],
49-
[0,0,-1,0],
50-
[-1,0,0,0],
51-
[0,0,0,1]
52-
])
45+
t = kc.get_transform(np.deg2rad([0,82.62,-154.1,0]))
46+
jnts = kc.inverse_d(t)
47+
print(">> inverse:", jnts)
5348

54-
# p = np.array([
55-
# [1,0,0, 80],
56-
# [0,1,0,0],
57-
# [0,0,1,0],
58-
# [0,0,0,1]
59-
# ])
49+
p = np.array([
50+
[0,1,0, 80],
51+
[0,0,-1,0],
52+
[-1,0,0,0],
53+
[0,0,0,1]
54+
])
6055

61-
jnts = kc.inverse(p)
62-
print(">> ", np.rad2deg(jnts))
56+
# p = np.array([
57+
# [1,0,0, 80],
58+
# [0,1,0,0],
59+
# [0,0,1,0],
60+
# [0,0,0,1]
61+
# ])
62+
63+
jnts = kc.inverse(p)
64+
print(">> inverse array:", np.rad2deg(jnts))
65+
66+
print(">> current link params [deg]:")
67+
for l in kc.get_links_d():
68+
print(l)
6369

6470
if __name__ == "__main__":
65-
main()
71+
main()

0 commit comments

Comments
 (0)