Skip to main content
more specific calculations
Source Link

I suggest the first thing you do is move the object straight ahead for a short duration. Now you will know the original position as well as it's new position. From the knowledge of these you will be able to calculate the rotation of the object.

originalPosition = (3 ; 2)
newPosition = (3.5 ; 1.7)
offset = (newPosition - originalPosition) = (0.5 ; -0.3)
offsetLength = sqrt(0.5^2-0.3^2) = 0.583
currentDirection = Normalize(offset) = (0.5 / 0.583 ; -0.3 / 0.583) =(0.857 ; -0.515) 

Once the rotation of the objectcurrent direction is known, all you have to do is to offset the rotationdirection so it points towards the goal location and start moving until you reach it.

For additional information such as ETA you could compute the speed of object while it's moving.

I suggest the first thing you do is move the object straight ahead for a short duration. Now you will know the original position as well as it's new position. From the knowledge of these you will be able to calculate the rotation of the object.

Once the rotation of the object, all you have to do is to offset the rotation so it points towards the goal location and start moving until you reach it.

For additional information such as ETA you could compute the speed of object while it's moving.

I suggest the first thing you do is move the object straight ahead for a short duration. Now you will know the original position as well as it's new position. From the knowledge of these you will be able to calculate the rotation of the object.

originalPosition = (3 ; 2)
newPosition = (3.5 ; 1.7)
offset = (newPosition - originalPosition) = (0.5 ; -0.3)
offsetLength = sqrt(0.5^2-0.3^2) = 0.583
currentDirection = Normalize(offset) = (0.5 / 0.583 ; -0.3 / 0.583) =(0.857 ; -0.515) 

Once the current direction is known, all you have to do is to offset the direction so it points towards the goal location and start moving until you reach it.

For additional information such as ETA you could compute the speed of object while it's moving.

Source Link

I suggest the first thing you do is move the object straight ahead for a short duration. Now you will know the original position as well as it's new position. From the knowledge of these you will be able to calculate the rotation of the object.

Once the rotation of the object, all you have to do is to offset the rotation so it points towards the goal location and start moving until you reach it.

For additional information such as ETA you could compute the speed of object while it's moving.