I want my car to drive by a vector list. When I use setLocalTranslation and print the position of the agv the good positions are printed but the car doesn’t move. When I use move the positions are getting extremely high values in a short amount of time.
Output with agv.move(waypoints)
Agv loc (560.0, 9.5, -1500.0)
Agv loc (1120.0, 19.0, -30.0)
Agv loc (560.0, 28.5, 1440.0)
Agv loc (0.0, 38.0, -120.0)
Agv loc (560.0, 47.5, -1680.0)
Agv loc (1120.0, 57.0, -3180.0)
Agv loc (1680.0, 66.5, -4680.0)
Agv loc (2240.0, 76.0, -3210.0)
Agv loc (1680.0, 85.5, -1740.0)
Agv loc (1120.0, 95.0, -3300.0)
Agv loc (1680.0, 104.5, -4860.0)
Agv loc (2240.0, 114.0, -6360.0)
Agv loc (2800.0, 123.5, -7860.0)
Agv loc (3360.0, 133.0, -6390.0)
The drive method:
public void drive(AssetManager assetManager, Node rootNode, Node guiNode,FlyByCamera flyCam,final Camera cam){
parkingleft = new Vector3f (560,7,1465);
waypoints.add(new Vector3f(560,9.5f,-1500));
waypoints.add(new Vector3f(560,9.5f,1470));
waypoints.add(new Vector3f(-560,9.5f,1470));
waypoints.add(new Vector3f(-560,9.5f,-1560));
waypoints.add(new Vector3f(560,9.5f,-1560));
waypoints.add(new Vector3f(560,9.5f,-1500));
System.out.println("Content waypoints arraylist: " + waypoints);
}
Update agv position method
public void updateAgvPosition(float tpf){
for(Vector3f waypoint : waypoints){
// agv.move(waypoint);
agv.setLocalTranslation(waypoint);
System.out.println("Agv loc "+ agv.getLocalTranslation());
}
}
Main code
[code}
public void simpleUpdate(float tpf) {
agvtransporter.updateAgvPosition(tpf);
}
// the drive method is called in simpleinitapp
[/code]
How to move the car by my vector list?