Comments (4)
Hey @kevin-thankyou-lin,
DynAviary
expects an action
is thrust and torques so it wouldn't work with script fly.py
where actions are RPMs returned by a PID controller.
Is #37 what you are trying to achieve? If so, yes you should try option --physics dyn
but with the original CtrlAviary
class (that bypasses the use of PyBullet's applyExternalForce
for a simple dynamics update written in Python).However, I'm not sure on your reasoning about p.setRealTimeSimulation(1)
, are you sure that is what you are looking for?
By default, the physics server will not step the simulation, unless you explicitly send a 'stepSimulation' command. This way you can maintain control determinism of the simulation. It is possible to run the simulation in real-time by letting the physics server automatically step the simulation according to its real-time-clock (RTC) using the setRealTimeSimulation command. If you enable the real-time simulation, you don't need to call 'stepSimulation'.
Note that setRealTimeSimulation has no effect in DIRECT mode: in DIRECT mode the physics server and client happen in the same thread and you trigger every command. In GUI mode and in Virtual Reality mode, and TCP/UDP mode, the physics server runs in a separate thread from the client (PyBullet), and setRealTimeSimulation allows the physicsserver thread to add additional calls to stepSimulation.
from gym-pybullet-drones.
Hi @JacopoPan, thanks for the fast response!
Gotcha
Yes, #37, I'm planning to run in simulation and then on hardware. Gotcha, --physics dyn
work and subverts the need for applyForces
, but when I set p.setRealTimeSimulation(1)
, on around line 140 of fly.py
(and remove these lines from BaseAviary
)
#### Obtain the PyBullet Client ID from the environment ####
PYB_CLIENT = env.getPyBulletClient()
p.setGravity(0, 0, -9.8, physicsClientId=PYB_CLIENT)
p.setRealTimeSimulation(1, physicsClientId=PYB_CLIENT)
p.setTimeStep(1/ARGS.simulation_freq_hz, physicsClientId=PYB_CLIENT)
the drones just drop to the ground i.e. different behavior from p.setRealTimeSimulation(0, physicsClientId=PYB_CLIENT)
.
Would you know how to fix this?
Thanks for your help, again!
from gym-pybullet-drones.
--physics dyn
really subverts PyBullet entirely other than using it for the GUI and/or rendering.
I don't necessarily see why you think p.setRealTimeSimulation(1)
would help moving towards hardware.
What type of policy are you trying to implement or learn? The CtrlAviary
in fly.py
is intended for a low level attitude/position controller that would need to be ported to C to run on a real Crazyflie.
from gym-pybullet-drones.
Okay, that's fair. True, I was just thinking I could use the real time sim as a heuristic, but that's true about porting to C. I'm not quite focusing on end to end policy learning (if that were the case, yeah, I wouldn't need a PID controller). I'm more decoupling control from perception so that's why I need a PID controller.
Thank you!
from gym-pybullet-drones.
Related Issues (20)
- is there a specific ordinary differential equation (ODE) of model system? HOT 1
- RPM Motor Mapping HOT 6
- Some camera associated issues HOT 1
- What does pycffirmware do HOT 1
- run learn.py
- rgb and GL HOT 2
- path planning algorithms HOT 1
- Ctrl Freq and Simulation Freq Questions HOT 3
- Clarification on Each Dimension's Meaning for ActionType.VEL HOT 3
- Discrete action space implementation based on BaseRLAviary HOT 1
- Visualize drone cameras in explorer HOT 1
- Location of Paper on Dynamics Code HOT 1
- -1 to 1 action space meaning HOT 1
- Pybullet drones
- No module named 'gym_pybullet_drones.envs.VisionAviary'
- Units HOT 1
- High frequency in RPMs when include action buffer in observation space can couse problems in real hardware HOT 2
- Why might my rewards be inversely proportional to the target height in the HoverAviary environment? HOT 2
- Error while running velocity.py and fly.py examples HOT 1
- ray 1.9 error while installing gym-pybullet-drones HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gym-pybullet-drones.