Editing/compiling/debugging Python files in the Bitcraze VM

Firmware/software/electronics/mechanics
Post Reply
f-rower
Beginner
Posts: 16
Joined: Wed Jun 14, 2017 10:19 am

Editing/compiling/debugging Python files in the Bitcraze VM

Post by f-rower »

Hello,

In the Crazyflie PC Client readme it is stated that for a Linux system, which is the system used in the Bitcraze VM, the Crazyflie PC Client has dependencies on the system packages Python 3.4+, PyQt5 , etc. Are all of these already installed in the VM or do I have to install them? If they are already installed, what development environment within the VM should I be using to edit/compile/build/debug Python files?

Kind regards,

f
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Editing/compiling/debugging Python files in the Bitcraze VM

Post by arnaud »

These dependencies are required to run the client so yes they are installed. Python programs runs from source, they cannot be compiled, so development and runtime dependencies are very often identical.

The crazyflie-client and crazyflie-lib are in the projects folder.

You can edit the source file with any editor. By default the VM has mousepad installed, it is a simple editor with syntax color. You can also use Eclipse.

If you want a more complete python IDE you can install pycharm in the VM (https://www.jetbrains.com/pycharm/), it will also allow you to debug.
bennetcole
Beginner
Posts: 1
Joined: Thu Oct 24, 2019 11:28 am

Re: Editing/compiling/debugging Python files in the Bitcraze VM

Post by bennetcole »

Python has a debugger , which is available as a module called pdb . It supports setting conditional breakpoints , stepping through the source code one line at a time, stack inspection, and more.

Code: Select all

import pdb
msg = "this is a test"
pdb.set_trace()
print(msg)
Insert pdb.set_trace() anywhere and it will function as a breakpoint . When you execute the script by python test.py, you will in the debug mode.
Post Reply