autoPluto module¶
-
class
autoPluto.
autoPluto
(debug=False)¶ Bases:
object
This is a class integrating all the modules of the pipeline and sending the data to the drone using MSP Packets. We integrate the controls, vision and state estimation modules and it is an easy-to-use class.
- Attributes:
- DEBUG: flag to enable prints in code for debugging. Default is False.
-
handler
(sigma, frame)¶ If the pose estimation for the drone is not recieved for a specified time, it lands the drone and the two threads for writing and reading is joined and code exits.
-
run
()¶ Implements the complete pipeline on the drone integrating the PID controller with pose estimation using the vision pipeline. Flags are setup to update the current condition of the drone, i.e., hovering, landing, etc.
-
takeAction
()¶ Sending the updated control actions using MSP Packets to the drone by setting the control parameters. In case of an undesired state of the drone, landing command is sent to it. For updating the states of the drone, we apply locking between the threads, to read the states at one timestep.
-
updateAction
()¶ Updating the control actions in terms of the calculated error by the PID and determining the values of pitch, roll, throttle and yaw.
-
updateState
()¶ Parsing the Camera and IMU feed and updating the sensor data to determine the states of the drone for pose estimation. Based on a horizon parameter, moving average is applied on the sensor data feed to reduce the noise in the data.