I’m making a physical simulator for for prototyping a control system for a UAV.
How do I make it so that different parts of the UAV have different mass?
My UAV model which consists of a core block (box), 4 beams attached to it (boxes) and a motor attached to each beam. The whole thing is attached to a UAVNode and given an object of RigidBodyControl. This makes it act as one single block with homogeneous mass, but in fact what I need is for the core block to have a mass m1 , the motors to have mass m2 and beams mass m3. The reason I need this is so that the moment of intertia and center of gravity is modeled correctly without me having mathematical calculations.
How do I do this? I’ve tried various approaches, all which failed.Do I somehow give all the individual parts rigidbodycontrol and attach them to the main node or does it have something to do with having to set some of the objects as kinematic?
Note: The collisionshape is not an issue, it can simple be a box around the UAV because the only thing that it will be colliding with is the floor
Thanks in advance
Anyone have any idea? I’ve read all the physics tutorials and documentations on the wiki and similar older threads
and cannot find an appropriate solution.
Thanks in advance.
I would try to make an continuous down force in the places of the object you would want it to have more mass, it would simulate this, but just testing to see it.
Thanks for the suggestion,
I thought of doing that but dismissed it because just using a downwards force does not simulate X-Y moments of intertia that I require.
If the engine does not support such behavior then I guess my only choice is to model the whole body as an ellipsoid which will take care of the required moment of the intertia criteria in all axes (if I remember last years physics lecture correctly ).
Is it possible to create an ellipsoid shape in JME3? I do not see any options for it. If I create a 3D model of an ellipsoid , import it and give it a collisionshape of the mesh then will the mass be appropriately distributed?
Just remember that the physics engine is not Jm3 , its bullet.
You can try to find information about how to do it in the bullet forum or bullet documentation in the internet…
I’ve never done this with bullet physics (I use my own physics package, which takes care of moments of inertia (actually the tensor of inertia), principal axes and the rotational as well as translational movement when you apply a force. (I use it for docking spacecraft modules and then applying some force or torque.)
BUT: I’ve seen that there are joints (i.e. connectors) available in the bullet physics thingy. You may just be able to connect your motors to your hinges and to your center box with these joints. This should in turn give you an approximation to the tensor of inertia, which is mathematically the sum over all masses times the radius to the center of mass squared, right?
If you have calculated the “inertia ellipsoid” on a piece of paper, then you may also find a way to scale the masses and radii, such that you get the exact values of your manual calculation.
EDIT: It would be an option to extend the bullet physics’ RigidBody (or whatever it is called) and solve the equations of rotational motion by yourself. They’re called Euler’s equations of motion. Find them on Wikipedia.
Thanks alot for the suggestion. I’m probably going to try it that way.