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

Multiple Drones example doesnt work properly #1255

Open
Edelbert opened this issue Jul 18, 2018 · 1 comment
Open

Multiple Drones example doesnt work properly #1255

Edelbert opened this issue Jul 18, 2018 · 1 comment

Comments

@Edelbert
Copy link

Edelbert commented Jul 18, 2018

Python and C++ multi drones examples behave strange.
Example of C++ code for 2 drones (I just modified original "hellodrone" example):

        std::cout << "Press Enter to arm the drone" << std::endl; std::cin.get();
        client.enableApiControl(true, "Drone1");
        client.armDisarm(true, "Drone1");

        client.enableApiControl(true, "Drone2");
        client.armDisarm(true, "Drone2");

        std::cout << "Press Enter to takeoff" << std::endl; std::cin.get();
        float takeoffTimeout = 5; 
        client.takeoffAsync(takeoffTimeout, "Drone2")->waitOnLastTask();
        client.takeoffAsync(takeoffTimeout, "Drone1")->waitOnLastTask();

Result:

Waiting for connection - 
Connected!

Client Ver:1 (Min Req:1), Server Ver:1 (Min Req:1)
Press Enter to get FPV image

# of images received: 2
Enter path with ending separator to save images (leave empty for no save)

Image uint8 size: 41733
Image float size: 0
Image uint8 size: 0
Image float size: 36864
Press Enter to arm the drone

Press Enter to takeoff

Exception raised by the API, something went wrong.
rpclib: function 'takeoff' (called with 2 arg(s)) threw an exception. The exception contained this information: Cannot perform takeoff because vehicle is already moving with velocity 0.585877 m/s.

I managed to make them taking off only one by one.

Python API sometimes works, sometimes doesnt. When it works, drones are taking off simultaneously and everything is fine, when it doesnt, the second drone doesnt take off, and program doesnt responding. Trace after interruption:

^CTraceback (most recent call last):
  File "PythonClient/multirotor/multi_agent_drone.py", line 57, in <module>
    f1.join()
  File "/anaconda3/lib/python3.6/site-packages/msgpackrpc/future.py", line 22, in join
    self._loop.start()
  File "/anaconda3/lib/python3.6/site-packages/msgpackrpc/loop.py", line 22, in start
    self._ioloop.start()
  File "/anaconda3/lib/python3.6/site-packages/tornado/ioloop.py", line 863, in start
    event_pairs = self._impl.poll(poll_timeout)
KeyboardInterrupt

But "moveToPositionAsync" works fine for both C++ and Python API.
Info: UE4.19.2, ubuntu 16.04, AirSim (latest master).

@AloshkaD
Copy link
Contributor

I'm having the same issue.

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

No branches or pull requests

4 participants