Compare commits
2 Commits
319c2eebbd
...
c6ccdb7b59
Author | SHA1 | Date |
---|---|---|
|
c6ccdb7b59 | |
|
c468833a0b |
|
@ -194,4 +194,5 @@ pyrightconfig.json
|
||||||
|
|
||||||
data/
|
data/
|
||||||
|
|
||||||
|
test.py
|
||||||
# End of https://www.toptal.com/developers/gitignore/api/python,visualstudiocode
|
# End of https://www.toptal.com/developers/gitignore/api/python,visualstudiocode
|
|
@ -28,6 +28,8 @@ python agent.py
|
||||||
|
|
||||||
在无人机底部摄像头检测到无人船上的 Apriltag 后,无人机将开始降落。在降落过程中,无人机将尝试保持在无人船正上方,并在降落过程中调整自身位置,以确保安全降落。
|
在无人机底部摄像头检测到无人船上的 Apriltag 后,无人机将开始降落。在降落过程中,无人机将尝试保持在无人船正上方,并在降落过程中调整自身位置,以确保安全降落。
|
||||||
|
|
||||||
|
###
|
||||||
|
|
||||||
## License
|
## License
|
||||||
USVLander 根据 MIT 许可证发布。这意味着您可以自由地使用、修改和分发该软件,但您必须包含原始作者的版权声明和许可声明。
|
USVLander 根据 MIT 许可证发布。这意味着您可以自由地使用、修改和分发该软件,但您必须包含原始作者的版权声明和许可声明。
|
||||||
|
|
||||||
|
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 45 KiB |
21
main.py
21
main.py
|
@ -1,21 +0,0 @@
|
||||||
from djitellopy import Tello
|
|
||||||
import cv2
|
|
||||||
|
|
||||||
my_drone = Tello()
|
|
||||||
my_drone.connect()
|
|
||||||
print(my_drone.get_battery())
|
|
||||||
my_drone.streamon()
|
|
||||||
my_drone.set_video_direction(Tello.CAMERA_FORWARD)
|
|
||||||
while True:
|
|
||||||
# Read a frame from the video stream
|
|
||||||
img = my_drone.get_frame_read().frame
|
|
||||||
img = cv2.resize(img, (360, 240))
|
|
||||||
# Display the frame
|
|
||||||
cv2.imshow("Image", img)
|
|
||||||
# Check for key press to exit
|
|
||||||
if cv2.waitKey(1) & 0xFF == ord('q'):
|
|
||||||
break
|
|
||||||
|
|
||||||
cv2.destroyAllWindows()
|
|
||||||
my_drone.streamoff()
|
|
||||||
# my_drone.land()
|
|
14
test.py
14
test.py
|
@ -1,14 +0,0 @@
|
||||||
import pupil_apriltags as apriltag
|
|
||||||
import cv2
|
|
||||||
|
|
||||||
tag_detector = apriltag.Detector(families='tag36h11')
|
|
||||||
|
|
||||||
img = cv2.imread('Snipaste_2024-06-22_21-30-43.png')
|
|
||||||
# cv2.imshow('aaa', img)
|
|
||||||
# print(img.shape)
|
|
||||||
tag = tag_detector.detect(img[:,:,0], estimate_tag_pose=True, camera_params=([353.836278849487, 353.077028029136, 163.745870517989, 115.130883974855]), tag_size=0.018)
|
|
||||||
|
|
||||||
for t in tag:
|
|
||||||
if t.tag_id == 0:
|
|
||||||
print(t.pose_t)
|
|
||||||
print(t.tag_id)
|
|
Loading…
Reference in New Issue