Mapping with Script using STEM Bundle

Discussions about all things Bitcraze
Post Reply
undays
Beginner
Posts: 12
Joined: Sat Oct 30, 2021 1:20 am

Mapping with Script using STEM Bundle

Post by undays »

Hello, I had a question about the script in crazyflie-lib-python/examples/multiranger/multiranger_pointcloud.py

Are we able to map the drones points its generating with this script with autonomous flight? For example, if I just write a simple set of directions for it to move forward and back. From my understanding, when we launch the window to view the mapping performed, it essentially halts us in that logging block and we can't leave it until the program is terminated.

The lines in question are

Code: Select all

appQt = QtWidgets.QApplication(sys.argv)
win = MainWindow(URI)
win.show()
appQt.exec_()
Which is in the main, this allows the program to open the window for that specific URI address and start logging. I want to be able to send actions after that to tell the drone to move forward, backward, or any directions. Is it possible? Or can this mapping behavior only be done specifically for one drone that has opened this window.

Thanks
undays
Beginner
Posts: 12
Joined: Sat Oct 30, 2021 1:20 am

Re: Mapping with Script using STEM Bundle

Post by undays »

Sorry to further clarify, I essentially want to run the autonomous flight using the multiranger deck but be able to visually see this in the GUI that is open on multiranger_pointcloud.py.
undays
Beginner
Posts: 12
Joined: Sat Oct 30, 2021 1:20 am

Re: Mapping with Script using STEM Bundle

Post by undays »

Actually I understand the whole halt after calling the app to execute. I just want to know how to exactly to get the MainWindow object to command the drone to do a set of commands instead of just hovering and waiting for keyboard inputs. Is there a way I can write a sequence of movements for the drone to start flying a certain pattern?
kristoffer
Bitcraze
Posts: 630
Joined: Tue Jun 30, 2015 7:47 am

Re: Mapping with Script using STEM Bundle

Post by kristoffer »

This is manly a QT problem. You will have to read up on how QT behaves and probably use the asynchronous flavors of the python lib classes (using callbacks) as QT is event-driven.
Post Reply