SW Dev 2: quadcopter.py

Hello ,  I’m publishing the new module quadcopter.py.

This object  has the main scope to be the controller of the quadcopter.

It includes 4 motors (from motor.py class) and the necessary interface for manage the commands coming from user.

This version is preliminary since it does not iplements all the functionality  but it can be considered the first step for the qpi logics.

Let’s see in details what is included in the modules for qpi_test2

motor.py is getting more robust. i added some procedures to manage the motor  parameters like setSimulation and getSimulation.

I also added a check to verify if the RPIO library is available.In case it can work anyway in simulation mode.

Procedure  motor.start  implements a sequence for initialize the ESC (it must to be verified yet)

Procedure motor.stop  that stops immediatly the motors.

quadcopter.py can manage 4 motors. the motors are defined as a list (array) so it is possible to direct access any  motor  with its index, for exemple:  self.motor[1].start

it includes procedures to move the quadcopter, like increaseThrottle,decreaseThrottle, increaseRoll,decreaseRoll ,increasePitch,decrease Pithc, increaseYaw,decreaseYaw and hover.

For the moment those procedures are used directly on the motor speed, but in next releases they will work  on angles and the conversion has to be managed

For this reason this class can be used only for development activity to have an overview of the whole flow.

qpi.py is  again the user interface, but i added a minimal graphical interface.

it is possible start the motors by pushing 0-1-2-3

  • increase motor rotation with a-z , s-x,d-c,f-v
  • play with throttle y-n, roll i-m, pitch j-k yaw g-j, hover h

you can test it even if no motor is connected, but also in a pc running linux, different from raspberry pi

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s