Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting energy of the multirotor in Airsim #3

Open
charbelmansour opened this issue Feb 26, 2020 · 1 comment
Open

Getting energy of the multirotor in Airsim #3

charbelmansour opened this issue Feb 26, 2020 · 1 comment

Comments

@charbelmansour
Copy link

Hello,
I cloned this project: https://github.com/srivatsankrishnan/AirSim-1
I want to get information about the energy of the drone. In this repository, they have implemented a method getTripStats that returns information about the trip including the energy consumed.
I am able to control the drone using python commands.
I am trying to run this code:

import airsim

import numpy as np
import os
import tempfile
import pprint

client = airsim.MultirotorClient(ip="127.0.0.1")
client.confirmConnection()
client.enableApiControl(True)
client.armDisarm(True)

res = client.getTripStats()
print (res.flight_time)

I'm getting the following error:
ErrorEnergy1
I also tried this code to get the state of the multirotor:
import airsim

import numpy as np
import os
import tempfile
import pprint

client = airsim.MultirotorClient(ip="127.0.0.1")
client.confirmConnection()
client.enableApiControl(True)
client.armDisarm(True)

state = client.getMultirotorState()
s = pprint.pformat(state)
print("state: %s" % s)

I get the following error:
Error2

Any suggestions about the python command that allows to retrieve the trip stats including the energy?

Thank you for your help,

Best Regards,
Charbel

@srivatsankrishnan
Copy link
Member

Hi,
Can you confirm if you are using this version of client.py?
https://github.com/harvard-edge/airlearning-rl/tree/master/misc/move_to_airsim

If not, please run the move.py script. That includes the modifications we did on top of AirSim.

-Sri

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants