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-15 23:11:55 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e2fc19a5c44e03a1b4005d512883734d485647e6
e2fc19a5
1 parent
40e72a1b
드론 좌표 이동
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
yujin_test/setPosition.py
yujin_test/setPosition.py
0 → 100644
View file @
e2fc19a
import
CoDrone
from
CoDrone.system
import
Direction
def
getPosition
(
drone
):
position
=
drone
.
get_opt_flow_position
()
# 상대좌표 (시작 0,0)
height
=
drone
.
get_height
()
# 고
print
(
"x={} y={} z={}"
.
format
(
position
.
X
,
position
.
Y
,
height
))
# 단위(mm)
def
main
():
drone
=
CoDrone
.
CoDrone
()
drone
.
connect
()
drone
.
takeoff
()
getPosition
(
drone
)
drone
.
move
(
-
5
,
4
,
0
,
0
)
# move(roll 좌우, pitch 전후, yaw, throttle)
# drone.go(Direction.FORWARD, 0.5)
# print('forward')
# getPosition(drone)
# drone.go(Direction.LEFT, 1)
# print('left')
getPosition
(
drone
)
drone
.
hover
(
3
)
getPosition
(
drone
)
print
(
'land'
)
getPosition
(
drone
)
drone
.
land
()
if
__name__
==
'__main__'
:
main
()
Please
register
or
login
to post a comment