Battery status and Calibration Set-up Manual


#1

Hello srv,
Can you please tell me how i Set-up Calibration Manually in android application.
Is there any api for it.

Also tell me, the battery api data.
my mobile received the data like : voltage :12.126: current -1 remaining 0.99

but its differ from flytconsole battery status always.
when flytconsole showing 0% remaining battery status then i got remaining 0.17%.

when drone flying then the different will be 23 to 31 remaining batter. like flytconsole showing 56 and andorid api showing 79.

Can you also tell me, is there any Emergency landing button. which remove all kind of task and come back to base location.


#2

Trilok,
The calibration process is a more involved process which is not possible to implement just with one API call. It requires you to change the orientation of the system during calibration and subscribe to messages for current orientation of the system and several parameters to be initialised before starting calibration.

All this available in flytconsole calibration tab if you want to have a look at the work flow and location of the code for same is “/flyt/flytapps/web/flytconsole/static/js/calibration.js”

Regarding the battery API the remaining widget in the flytconsole is a little buggy which would be fixed later, but the battery values in the GCS tab of the flytconsole are the values that you need to expect.


Sensor calibration progress bar issue
#3

Can you also tell me about emergency landing api.
which cancel all current task and go back to home location or specific location.


#4

Currently there is a RTL mode(return to launch) mode through RC transmitter switch. Apart from that there is no RTL API available right now, but it is in our development roadmap.


#5

Hello Srv,
Am working on battery juice percentage. some time it working fine but some time it shows a fixed number of battery remaining.
Please have a look into the battery API

batteryTopic = new Topic(ros, “/” + + “/mavros/battery”, “mavros_msgs/BatteryStatus”, 1000);
batteryTopic.subscribe(batteryCallbackros = new CallbackRos() {
public void handleMessage(final JSONObject message) {

                runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        try {
                            voltage = round(message.getDouble("voltage"), 2);
                            current = round(message.getDouble("current"), 2);
                            remaining = round(message.getDouble("remaining"), 2);

                        } catch (JSONException e) {
                        }
                    }
                });

            }
        });

Please let me know if you have any update version of this API.


#6

@vallabh please take a look at this.


#7

Hi Trilok ,
In the new version of FlytOS we have an update in the message type involved in the subscription of the battery status API.
So what you need to do is replace mavros_msgs/BatteryStatus with sensor_msgs/BatteryState in the API and the remaining variable does not exist anymore but is replaced with percentage variable depicting the remaining battery percentage, value varying between 0-1.

Correct the message type to sensor_msgs/BatteryState
replace remaining with percentage


#8

Hi Vallabh,

Thanks for your help.
Please tell us, New version of FlytOS contain any other api changes.

Or few api alter in new Version.

Is it necessary to update the new version of flytsim. or last version fine for us.


#9

Trilok,
There are no more changes in any other API, but if there are some that don’t work, then you could always get back to us.
Regarding updates…it is recommended that you always use latest version of FlytOS or FlytSim as there are constant bug fixes.