Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-1-capstone-design1
/
JSH_Project7
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
이유진
2020-06-21 00:12:06 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
5ad21f4b8ad8d57b4353e508d8afe114d6b37a03
5ad21f4b
1 parent
2481ecf8
Update step3.py
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
test_code/step3/step3.py
test_code/step3/step3.py
View file @
5ad21f4
...
...
@@ -9,7 +9,7 @@ errorRange = 50 # 오차범위
heightRange
=
30
# 움직였다고 판단할 거리 height
posiRange
=
10
# position (x, y) 변화 인지 거리
def
setHeight
(
_sHeight
,
_master
):
def
heightFeedback
(
_sHeight
,
_master
):
while
True
:
_mHeight
=
_master
.
get_height
()
if
_sHeight
-
errorRange
<=
_mHeight
<=
_sHeight
+
errorRange
:
...
...
@@ -63,7 +63,7 @@ def main():
# slave의 전 높이 대비 heightRange 만큼의 차이가 있으면 master가 움직이도록
if
abs
(
sHeight
-
bHeight
)
>
heightRange
:
print
(
'[height change!]'
)
setHeight
(
sHeight
,
master
)
# master의 높이 이동
heightFeedback
(
sHeight
,
master
)
# master의 높이 이동
# slave의 이전 좌표값 저장
bHeight
=
sHeight
...
...
Please
register
or
login
to post a comment