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

How can I use the drone’s moment of inertia? #251

Open
LvXinyu2003 opened this issue Dec 16, 2024 · 1 comment
Open

How can I use the drone’s moment of inertia? #251

LvXinyu2003 opened this issue Dec 16, 2024 · 1 comment
Labels
question Further information is requested

Comments

@LvXinyu2003
Copy link

LvXinyu2003 commented Dec 16, 2024

I don’t seem to find an explicit definition.I only found the definition of inertia in the URDF file.

@LvXinyu2003 LvXinyu2003 changed the title How can I use the drone’s moment of inertia? I don’t seem to find an explicit definition. How can I use the drone’s moment of inertia? Dec 16, 2024
@JacopoPan JacopoPan added the question Further information is requested label Dec 24, 2024
@JacopoPan
Copy link
Member

It is loaded from the URDF in variable self.J

def _parseURDFParameters(self):
"""Loads parameters from an URDF file.
This method is nothing more than a custom XML parser for the .urdf
files in folder `assets/`.
"""
URDF_TREE = etxml.parse(pkg_resources.resource_filename('gym_pybullet_drones', 'assets/'+self.URDF)).getroot()
M = float(URDF_TREE[1][0][1].attrib['value'])
L = float(URDF_TREE[0].attrib['arm'])
THRUST2WEIGHT_RATIO = float(URDF_TREE[0].attrib['thrust2weight'])
IXX = float(URDF_TREE[1][0][2].attrib['ixx'])
IYY = float(URDF_TREE[1][0][2].attrib['iyy'])
IZZ = float(URDF_TREE[1][0][2].attrib['izz'])
J = np.diag([IXX, IYY, IZZ])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants