Are you trying to run the streaming.py example unmodified? We had issues early on with streaming because we were trying to run a modified example where the drone didn’t take off (as we were in a lab setting). It appears that the drone has to actually take off and get to a hover state before the stream will start working. Once we tried the unmodified streaming.py example in the field, it worked just fine after takeoff and we were able to view the frames.
Yes, we (me and a fellow student) are trying to get the unmodified version of streaming.py running. This is only for testing purposes, our real goal is to realize an object recognition together with OpenCv. What we have done so far is that we first installed Ubuntu (20.04.3) and Python (3.8.10). Then we upgraded pip to version 21.3.1 and installed Olympe over it. A manual installation is currently not possible as listed in this post:
This one worked. After that we wanted to get the camera feed via the unmodified streaming.py script. At first some Python errors occurred. These could then be solved by manually installing PySDL2, OpenGL and the dependencies given in the post mentioned above (Postinst missing in release 7.0.1) After that, the in our first Post mentioned errors occurred when running.
We have had no trouble running the streaming.py out of the box. It sounds like perhaps your environment is not setup quite right and you may be missing some libraries. We are using docker to encapsulate all of the dependencies for Olympe and have a Dockerfile that contains the minimum set of commands to set up your environment. Even if you aren’t using docker, you should be able to just take the commands in the Dockerfile and run them on your bare metal system. I have pasted the core of the Dockerfile below so you can either use it directly with docker build or execute the commands individually. Once you set up the environment, I would try to the streaming.py example again.
# Install build and runtime dependencies
RUN apt-get update && apt-get install -y \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN pip3 install --upgrade pip
RUN python3 -m pip install jupyter ipython jinja2 zmq opencv-python
RUN ln -s /usr/bin/python3 /usr/bin/python
RUN useradd -ms /bin/bash ubuntu
RUN echo "ubuntu ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
RUN python3 -m pip install --user parrot-olympe
First of all, thanks for the quick answers!
I ran the above commands and got the same errors as before.
At some point I got the idea that it was also due to the venv of Pycharm which I am currently using. After running the script from the command line, I did get a video stream(sigh), but the errors still occurred…
The video and JSON file are also created correctly, but the drone doesn’t take off!
After playing around with the script a bit and commenting out lines of code and re-running it, I found that the Persistently Repeated Error:
I see this error regularly, even though streaming works fine after that. We have ignored it thus far.
We are not relying on the h264 frames so we made the h264 callback just do a pass. Similarly, we didn’t care about saving output files (and creating an .mp4 at the end) so we removed most of that code and just focused on handling the frame in the yuv callback.
In our scripts, we issue the TakeOff() command prior to starting the streaming thread. In the streaming.py example, the thread is started prior to the fly() method which actually takes off. If you aren’t getting to the point where it takes off, it could be that some exception is thrown in the streaming thread code causing the script to exit prematurely.
The video stream should work regardless of the state of the drone. I am not sure to understand what’s going on on your side.
Olympe 7.0.2 has been released on github and should fix this issue. I’ve updated the installation procedure and fixed the missing “-L” flag in the curl command. The online documentation is still lagging behind and should be up to date by next Monday.
Prior to 7.0.0 we could not get a modified streaming.py to work while the drone was in a landed state in our lab (we were just trying to stream from the camera which the drone was on the ground). None of the frames would pop up in the cv2.imshow window and it stop abruptly. Once we tried the example in the field, it worked well, though the stream takes a few seconds to start, only once the drone had finished taking off. This is what led us to believe streaming only worked once the drone was in a particular state (i.e. after take off). We haven’t tried streaming in the lab with the drone stationary since we have upgraded to 7.0.0,.
Hi @DHBW ,
i just have the same problem with Pycharm, the code is running in the command line with the normal ulog - vmeta - vmeta_frame_proto_get_buffer:408: err=71(Protocol error), but i can see the stream.
In Pycharm i see nothing, have you already been able to solve the problem?