Hey!
I would like to know what would I need to put in a Python script to get the current battery status of a drone. Thank you!
API for reading battery status
Re: API for reading battery status
The battery status is expose as log variables in the "pm? log group.
- pm.batteryLevel is the battery level from 0 to 100
- pm.state indicates if the battery is charging or discharging
- pm.vbat is the battery voltage in volts
There is examples in the python lib project that shows how to read log variables from a python script.
Most information about the Crazyflie are available as log variables. You can see all of the existing log variables in the client "LogTOC" tab. You can also plot the variables in the plotter in order to see the real time values.
- pm.batteryLevel is the battery level from 0 to 100
- pm.state indicates if the battery is charging or discharging
- pm.vbat is the battery voltage in volts
There is examples in the python lib project that shows how to read log variables from a python script.
Most information about the Crazyflie are available as log variables. You can see all of the existing log variables in the client "LogTOC" tab. You can also plot the variables in the plotter in order to see the real time values.