Skip to content

Low level quadcopter control #808

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

Closed
zbenic opened this issue Feb 13, 2018 · 22 comments
Closed

Low level quadcopter control #808

zbenic opened this issue Feb 13, 2018 · 22 comments

Comments

@zbenic
Copy link

zbenic commented Feb 13, 2018

Hello.

My plan is to recreate the work done in:
https://arxiv.org/pdf/1707.05110.pdf

and to continue to research further. The only thing missing is the access to the low level quad controls (to be able to set individual motor rpms or thrusts).

Regarding the closed issue:
#99

Are there any progress on the said matter?
I am also willing to help with the necessary code changes.

@sytelus
Copy link
Contributor

sytelus commented Feb 13, 2018

It's just matter of adding new API call, for example, void setActuators(std::vector<float>). Then in simple_flight, just set these values directly via PassthroughController. Nothing too hard, just bit of plumbing. However as I'd mentioned in my comment, RPC APIs have poor throughput so this might not work...

@zbenic
Copy link
Author

zbenic commented Mar 5, 2018

Thanks for the advice.
I've managed to implement it.
Created new movebyrotorspeed command which converts input argument that are rotor RPMs to arguments for the PassthroughController (roll, pitch, yaw and throttle control variables).

My next step would be to implement the functionality that is mentioned in issue:
#600

What I would like to do is to get the rotor speeds via the reinforcement learning, apply them by using movebyrotorspeed command, and get the state from the environment.
I would like to do that with the fixed timestep dt.

Can you give me a few pointers?

@nrocketmann
Copy link

Hi zbenic, I am also trying to reproduce the results from that paper, but I'm very new to airsim and C++ in general. How did you gain access to the low level commands for rpms on each rotor, etc.? What would I need to do to use those?

@zbenic
Copy link
Author

zbenic commented Jun 29, 2018

Hello @nrocketmann.

Actually, I've given up on using AirSim for my purposes because I've switched to https://github.com/wil3/gymfc which should be OpenAI Gym environment for testing RL on quadcopters.

@nrocketmann
Copy link

@zbenic Thanks for the info. I'll give that a try. Good luck!

@vinbo
Copy link
Contributor

vinbo commented Jun 30, 2018

Oh, that sounds a sad news to me @zbenic , how do you compare the two, which part of gymfc do you think is better than airsim?

@wil3
Copy link

wil3 commented Jul 4, 2018

Hey @vinbo gymfc author here. Airsim is a simulator while gymfc is an environment for constructing intelligent flight control systems so they have different goals. Currently gymfc has environments for learning attitude control but the goal is to expand this to include navigation and guidance. Gymfc is using Gazebo as the backend physics engine, while airsim is uses the unreal engine. Gymfc could potentially use airsim as its backend, you'd just need write the interface to the aircraft model to control the actuators and read sensor data. Luckily Gazebo already provides an interface for controlling a quadcopter which made it easiest for gymfc to use this engine. You wouldnt use gymfc as a flight simulator, the environment is constructed specifically for learning certain tasks and the graphics aren't nearly as impressive as airsim. I've been working on another project for doing SITL testing of betaflight called Aeroloop which I'd love to port over the backend currently using Gazebo to Airsim.

Edit: I shouldn't say they have different goals necessarily, AirSim as described is created for being used with ML in mind and expose APIs to allow you to do this. It is a general framework for learning. GymFC on the other is specialized and has this all implemented for attitude control. You just interact with the gymfc environment with your control algorithm (e.g using openai baselines) in order to train it its control task.

@vinbo
Copy link
Contributor

vinbo commented Jul 5, 2018

Thank you for your introduction, wil3, already stared. I'll look into it. Thanks

@RVBldr
Copy link
Contributor

RVBldr commented Oct 19, 2018

@zbenic Can you confirm that we consider this closed?

@zbenic
Copy link
Author

zbenic commented Oct 20, 2018

Yes, we can close this.

@juanmed
Copy link

juanmed commented Jan 7, 2019

@zbenic Hello! Hey I read what you did regarding controlling the rotation speed of the rotors and also briefly saw your changes in your personal repository. Could you please let me know if you were able to actually make the drone move in the simulator via commanding rotor speeds in the way you did it? More strictly, if through your movebyrotorspeed command function, the drone in the simulator actually moved according to forces generated by those rotor speeds? I would like to develop a low level controller based on other control strategies different from the implement PID, so I would need to command rotor speeds and the simulated drone state to change according to those commanded rotor speeds.

I understand you dropped airsim, but just would like to confirm up to which point you were able to get, and maybe I can pick up from there.

Thanks for your answer.

@zbenic
Copy link
Author

zbenic commented Jan 8, 2019

@juanmed Hello! Yes, I was able to use the movebyrotorspeed command to move the quad in the simulator. Good luck!

@juanmed
Copy link

juanmed commented Jan 8, 2019

Nice to know! Thanks!

@linxiaobo110
Copy link

@zbenic
Hi, I am do research about reinforcement learning for quadrotor too. I use the DDPG. Now I want to simulate in airsim. . AsI used to code in tensorflow in python, can the low level control be implemented in airsim + python?
And, do you know where can find bbs or community for this subject?

@zbenic
Copy link
Author

zbenic commented Mar 12, 2019

@linxiaobo110
Hello. I believe everything is explained here: #1680 (comment).

The low level control is already implemented.

@linxiaobo110
Copy link

linxiaobo110 commented Mar 12, 2019 via email

@zbenic
Copy link
Author

zbenic commented Mar 13, 2019

I'm not doing anything in AirSim for the moment.
You can use gymfc to simulate problems of position control.

@wil3
Copy link

wil3 commented Mar 13, 2019

@linxiaobo110 new version of gymfc will be released in the next couple weeks making it even easier to do trajectory and navigation control. Out of the box the current gymfc version is for attitude control.

@zbenic
Copy link
Author

zbenic commented Mar 13, 2019

@wil3 Which version of Gazebo will it use and will it work on Ubuntu 18.04? I remember when setting up Gazebo 8, I had some problems with dependencies on 18.04 so I had to revert to 16.04.

@wil3
Copy link

wil3 commented Mar 13, 2019

Hi @zbenic Gymfc is under pretty heavy development and changes fast. Ubuntu 18.04 is now supported and Gazebo 8 and 9. The Gazebo plugins are now built dynamically on install for whatever version you have installed. The new version is basically a complete rewrite though addressing a lot of dependency issues with the aircraft, I'm almost done with it.

@zbenic
Copy link
Author

zbenic commented Mar 13, 2019

@wil3 Great, thank you for your efforts. Looking forward to the new version.

@linxiaobo110
Copy link

linxiaobo110 commented Mar 14, 2019 via email

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

9 participants