I’m getting a ‘quadcopter’ model to hover by applying forces in the locations of the motors in the direction of the Y axis (relative to the quadcopter). The copter is modeled (for now) by a single body with rigidBodyControl. When I apply equal forces to all motors the copter hovers … sortof. But when I increase one motor ever so slightly the thing dives to one side immediately which is not correct behavior. I’ve tried with tpf and without , result is about the same.
UAVNode = new Node();
UAVNode.setLocalTranslation(arenaSize / 2, 1.5f, arenaSize / 2);
// Physics
bulletAppState = new BulletAppState();
stateManager.attach(bulletAppState);
bulletAppState.getPhysicsSpace().addTickListener(this);
Am I approaching this the right way?
I’m pretty sure that the direction of the applied forces is wrong because as soon as the orientation of the quadcopter deviates from zero then it looks like it’s being pulled by a force originated from some unknown location.
I printed out the values and it does indeed turn out that it was being modified so thanks for that.
I improved it by writing :
Vector3f v = new Vector3f(0, 1.0f, 0);
instead of
Vector3f v = Vector3f.UNIT_Y
but I’m still getting some wierd behavior (as if the wind suddenly starts blowing from the side) when I increase one of the motor outputs by just a very slight amount as soon as the orientation deviates from zero.
I tried drawing the vector output of the direction of the UAV (as in the tutorial on vector operations) but it requires some
include .org library and I’ve searched for about half an hour and could not find where to get it.
Thats a different topic where I am having trouble putting together one rigid body out of several.
Here however I have issues with force directions that are not being applied correctly.