Stream AttributeError

System: Ubuntu 18.04
Two days ago, I used the following command to update olympe:

cd code/parrot-groundsdk
repo init -u https://github.com/Parrot-Developers/groundsdk-manifest.git
repo sync

./products/olympe/linux/env/postinst

pip3 install -r ~/code/parrot-groundsdk/packages/olympe/requirements.txt
echo “export PYTHONPATH=$PYTHONPATH:~/code/parrot-groundsdk/out/olympe-linux/final/usr/lib/python/site-packages/” >> ~/code/parrot-groundsdk/products/olympe/linux/env/setenv

./build.sh -p olympe-linux -A all final -j


Then I tried to use the following program to open the drone camera to get the image:

import cv2
import olympe

def yuv_frame_cb(yuv_frame):
global cv2frame
info = yuv_frame.info()
cv2_cvt_color_flag = {
olympe.PDRAW_YUV_FORMAT_I420: cv2.COLOR_YUV2BGR_I420,
olympe.PDRAW_YUV_FORMAT_NV12: cv2.COLOR_YUV2BGR_NV12,
}[info[“yuv”][“format”]]
cv2frame = cv2.cvtColor(yuv_frame.as_ndarray(), cv2_cvt_color_flag)

DRONE_IP = “10.202.0.1”

drone = olympe.Drone(DRONE_IP)
drone.connect()
drone(olympe.messages.gimbal.set_target(gimbal_id=0, control_mode=“position”,
yaw_frame_of_reference=“relative”, yaw=0.0,
pitch_frame_of_reference=“relative”, pitch=-12.6, #2:8
roll_frame_of_reference=“relative”, roll=0.0,
)).wait()
drone.set_streaming_callbacks(raw_cb=yuv_frame_cb)
drone.start_video_streaming()

cv2frame = cv2.imread(‘fire.png’)
window_name = “Olympe Streaming Example”
cv2.namedWindow(window_name, cv2.WINDOW_NORMAL)

while True:
cv2.imshow(window_name, cv2frame)
if cv2.waitKey(1) & 0xFF == ord(‘q’):
break

drone.stop_video_streaming()
drone.disconnect()
cv2.destroyAllWindows()


The error message came out:

2021-04-21 14:50:30,128 [INFO] olympe.pdraw.ANAFI-0000000 - _media_added - _media_added id : 1
Traceback (most recent call last):

File “_ctypes/callbacks.c”, line 234, in ‘calling callback function’

File “/home/cvr-lab/code/parrot-groundsdk/out/olympe-linux/final/usr/lib/python/site-packages/olympe_deps.py”, line 81, in
type_((lambda callback: lambda *args: callback(*args))(

File “/home/cvr-lab/code/parrot-groundsdk/packages/olympe/src/olympe/arsdkng/pdraw.py”, line 840, in _media_added
if (media_info.contents._2.video.format !=

AttributeError: ‘struct_pdraw_media_info’ object has no attribute ‘_2’

Is there any way to solve or revert to the previous version?

@ndessart @Jerome Thanks in advance

using:
repo init -b refs/tags/v1.7.0 https://github.com/Parrot-Developers/groundsdk-manifest.git
instead of:
repo init -u https://github.com/Parrot-Developers/groundsdk-manifest.git

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.