Closed defrag-bambino closed 1 month ago
Interesting, I've definitely never seen this before. I will look at it soon, thanks for the report!
@defrag-bambino I have looked at your issue and have identified the problem:
env.state(0)[-2]
. The relevant documentation for what each component of the states means is here.There are many ways to fix the issue, but fundamentally I think that the simulation expectations are a big unrealistic. Perhaps using flight mode 6 and capping the maximum flight velocity?
Interesting, thanks for the info! Any idea why the sim is so slow? Because of rendering the images? Or the high physics update rate?
About the delay when rendering images: I've had a similar problem when using AirSim before. The solution there was to pause the simulation right before taking the image and continuing it right after. Would that also be possible with PyBullet?
Regarding your proposed solution of using flight mode 6, and even more generally, the documentation does not really state what the input limits or even its units (e.g. deg vs rad, m/s vs km/h?). I will definetly try mode 6 though, thanks.
All units are SI, so we're using m/s and rad/s for velocities. In terms of thrust, at full throttle, the cf2x produces a 2.25:1 T:W. It's motor specs are here with the weight defined here (thrust is in Newtons, mass is in kg).
The speed of the simulation being slow is interesting... Most likely plt and data copying is introducing a significant overhead. I will have another look at that in the morning.
@defrag-bambino, I finally got round to looking at this. It turns out that the main issue is related to #42. The solution is to set the camera_fps
parameter for the quadx to something like 30 FPS. This can be achieved via:
# individual spawn options
quadx_options = dict(
use_camera=True,
drone_model="cf2x",
camera_angle_degrees=-90,
camera_FOV_degrees=130,
camera_fps=30,
)
Thanks, this definitely answers the slow simulation. However, even without all the plotting stuff (and now RTF ~= 1.0) the drone still sees itself from a certain speed on. While I admit these speeds may be unreasonable to use, the problem still remains. For now, I will just reduce the speed of the drone. I am fine with closing this issue. If you want to keep it open for debugging later, feel free.
Yep, I think we can close the issue, the simulation is already paused between each step since it is a synchronous physics engine. I think this is something on Bullet's simulation side. Thanks for raising the issue!
Hey,
I am seeing some strange behavior where after a few seconds, the onboard camera of the drone moves away, such that the drone sees itself. Here is a minimal example, only flying straight up. Also, the drone seems to be of slow?