svengronauer / phoenix-drone-simulation Goto Github PK
View Code? Open in Web Editor NEWSimulation environments for the CrazyFlie quadrotor: Used for Reinforcement Learning and Sim-to-Real Transfer
License: MIT License
Simulation environments for the CrazyFlie quadrotor: Used for Reinforcement Learning and Sim-to-Real Transfer
License: MIT License
I really want to try this out, with a simple task, with a real crazyflie drone, have you any suggestion on how should i do it?
Hi Sven,
Thanks for the work! Brief question: Is the following line in the Attitude controller a bug or do we divide on purpose by 18 instead of 180 [degree]?
Best,
Martin
error :
File "phoenix_drone_simulation/utils/evaluation.py", line 93, in eval_once
obs = torch.as_tensor(x, dtype=torch.float32)
ValueError: expected sequence of length 34 at dim 1 (got 0)
Need to change line 93 https://github.com/SvenGronauer/phoenix-drone-simulation/blob/2265a4867e65af483a61009ddaf5b488449793eb/phoenix_drone_simulation/utils/evaluation.py#L93C1-L93C29 with :
x, info = self.env.reset()
Hi! I am trying to run the demos, but unfortunately encountered some problems.
When I ran python -m phoenix_drone_simulation.train --alg ppo --env DroneHoverBulletEnv-v0
, everything looked fine and I got a policy checkpoint (though it did not behave as I expected). However, when I ran python -m phoenix_drone_simulation.train --alg ppo --env DroneHoverSimpleEnv-v0
or python examples/transfer_learning_drone_hover.py
, I got the following error. What might be wrong in my settings?
b3Warning[examples/Importers/ImportURDFDemo/UrdfFindMeshFile.h,102]:
/home/usr/phoenix-drone-simulation/phoenix_drone_simulation/envs/assets/cf21x_sys_eq.urdf:29: cannot find './cf2.dae' in any directory in urdf path
b3Error[examples/Importers/ImportURDFDemo/BulletUrdfImporter.cpp,121]:
Could not parse visual element for Link:b3Error[examples/Importers/ImportURDFDemo/BulletUrdfImporter.cpp,121]:
base_linkb3Error[examples/Importers/ImportURDFDemo/BulletUrdfImporter.cpp,121]:
failed to parse linkTraceback (most recent call last):
File "/home/usr/phoenix-drone-simulation/examples/transfer_learning_drone_hover.py", line 55, in <module>
main()
File "/home/usr/phoenix-drone-simulation/examples/transfer_learning_drone_hover.py", line 15, in main
env_source = gym.make("DroneHoverSimpleEnv-v0")
File "/home/usr/anaconda3/lib/python3.9/site-packages/gym/envs/registration.py", line 200, in make
return registry.make(id, **kwargs)
File "/home/usr/anaconda3/lib/python3.9/site-packages/gym/envs/registration.py", line 105, in make
env = spec.make(**kwargs)
File "/home/usr/anaconda3/lib/python3.9/site-packages/gym/envs/registration.py", line 75, in make
env = cls(**_kwargs)
File "/home/usr/phoenix-drone-simulation/phoenix_drone_simulation/envs/hover.py", line 258, in __init__
super(DroneHoverSimpleEnv, self).__init__(
File "/home/usr/phoenix-drone-simulation/phoenix_drone_simulation/envs/hover.py", line 49, in __init__
super(DroneHoverBaseEnv, self).__init__(
File "/home/usr/phoenix-drone-simulation/phoenix_drone_simulation/envs/base.py", line 123, in __init__
self._setup_simulation(physics=physics)
File "/home/usr/phoenix-drone-simulation/phoenix_drone_simulation/envs/base.py", line 213, in _setup_simulation
self.drone = CrazyFlieSimpleAgent(bc=self.bc, **self.agent_params)
File "/home/usr/phoenix-drone-simulation/phoenix_drone_simulation/envs/agents.py", line 486, in __init__
super(CrazyFlieSimpleAgent, self).__init__(
File "/home/usr/phoenix-drone-simulation/phoenix_drone_simulation/envs/agents.py", line 129, in __init__
super(CrazyFlieAgent, self).__init__(
File "/home/usr/phoenix-drone-simulation/phoenix_drone_simulation/envs/agents.py", line 68, in __init__
self.body_unique_id = self.load_assets()
File "/home/usr/phoenix-drone-simulation/phoenix_drone_simulation/envs/agents.py", line 367, in load_assets
body_unique_id = self.bc.loadURDF(
pybullet.error: Cannot load URDF file.
Also, I would like to try other control modes as well. Can I set the control mode through command line argument? Or, which part of code should I modify to change it from 'PWM' to, say, 'AttitudeRate'?
Looking forward to your reply. Thanks a lot!
Hi thanks for the amazing codebase. I am wondering does the code use gpu during training? I did not find anything relevant on setting the device for training in the code.
Thank you a lot for contributing to this repo, it is really useful!
I have a question about how the frequency of PWM and observation (100hz) is determined. Is it a built-in speed of Pybullet, or it would get affected by the computer hardware speed? I also saw for the env step loop, there is something like time.sleep(0.05), time.sleep(1/60). why do we need time.sleep()? will it change the 100hz frequency?
Look forward to your reply!
Best,
Xubo
Hi Sven,
Yet another question appeared. In the reference code below, we differentiate whether we are at 100Hz or 200Hz since the simulator runs at 200Hz while the observation frequency is only 100 Hz. But why is the low-pass filtering of the gyro (line 168) outside the if-else? The comment says that the filter is applied only with 100Hz, but right now, it is always executed.
Or do I have a misunderstanding here?
Thanks and best wishes,
Martin
In all code with : while not done:
for example in line 98 of phoenix_drone_simulation/utils/evaluation.py
: https://github.com/SvenGronauer/phoenix-drone-simulation/blob/2265a4867e65af483a61009ddaf5b488449793eb/phoenix_drone_simulation/utils/evaluation.py#L98C1-L98C24
Need to add done = terminated or truncated
to avoid infinite loop
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.