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

Question on drone dynamics #10

Closed
thaipduong opened this issue Nov 25, 2020 · 3 comments
Closed

Question on drone dynamics #10

thaipduong opened this issue Nov 25, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@thaipduong
Copy link

thaipduong commented Nov 25, 2020

Hi Jacopo,
Thank you for working on this simulator. I have a question on the dynamics of the drones. In gym-pybullet-drones/gym_pybullet_drones/envs/BaseAviary.py, line 851:
rpy = rpy + self.TIMESTEP * ang_v

Please correct me if I'm wrong here. I think the angular velocity is generally not the same as roll, pitch and yaw rates so I wonder if this is a bug? To calculate the new rotation matrix after 1 TIMESTEP, I think it should be something like:
next_rotation = matmul(rotation,expm(skew(self.TIMESTEP * ang_v)))
And then the new roll, pitch, yaw can be calculated from this new rotation matrix.
Best.

@JacopoPan
Copy link
Member

JacopoPan commented Nov 25, 2020

Thanks Thai! You are likely correct and/or spotted a mix-up in variable names.
I'll double check the content of ang_v and fix it ASAP.
However, note that the function you are referring to, _dynamics() is currently unused, by default.

@JacopoPan JacopoPan added the bug Something isn't working label Nov 25, 2020
@thaipduong
Copy link
Author

I see. Thanks, Jacopo.

@JacopoPan
Copy link
Member

There was a mix-up in variable names as PyBullet's angular velocity vector was used as intermediate storage (with the intent of reducing code duplication) for the RPY rates (but not to update the pose) when choosing to call _dynamics() instead of _physics. It should be fixed in the next commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants