我有一个问题,我无法连接到AR无人机2相机时,无人机是通过ROS连接使用阿德罗龙自主阿德罗。发射. 在
我认为问题是因为我试图通过OpenCV和Python的IP地址访问无人机摄像头,同时通过ardrone永autonomy连接。下面是我如何实现这一点的代码片段。在
video_capture = cv2.VideoCapture()
video_capture.open('tcp://192.168.1.1:5555')
vidWidth = video_capture.get(cv2.CAP_PROP_FRAME_WIDTH)
vidHeight = video_capture.get(cv2.CAP_PROP_FRAME_HEIGHT)
如你所见,我使用的是摄像机的IP地址。当无人机不通过ROS(基本上就像一个网络摄像头)连接时,这一点非常完美。在
我的最终目标是通过使用OpenCV从摄像机接收到的图像进行跟踪和导航,这意味着我必须发布移动命令(cmd vel),这需要基于OpenCV接收和处理的图像通过ardrone_autonomy进行连接。在
在连接到ROS时,我是否可以通过使用无人机的IP摄像头来完成这一任务?在
谢谢你的帮助!在
http://wiki.ros.org/video_stream_opencv可以从HTTP/TCP URL打开视频流:
注意URL末尾的
/video?x.mjpeg
。在相关问题 更多 >
编程相关推荐