Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to determine new thrust input to move current coordinate to specified coordinate position

So say I have a drone in X,Y space at a known position (X1,Y1) with an orientation of 45 degrees to the right with respect to origin in the coordinate system (see example below).

Drone1

The red arrow depicts the front face of the drone and the orange point represents where it is in space (X1,Y1).

Knowing the drone has thrust input for forward and backward motion (which range from +1 (forward) to -1 (backward); and leftward, and rightwards motion (which range from +1 (rightward) to -1 (leftward). With respect to the drones front face (see example below shown in purple).

Drone2

How would I go about determining the thrust input to reach a new point in the coordinate system (X2,Y2) taking into account the orientation of the drone. Forgive my crude mspaint drawings. Appreciate any help!

Drone3

like image 358
Sam W Avatar asked Nov 27 '25 21:11

Sam W


1 Answers

The way your question is posed, I assume you do not want to turn the drone.

Let's give some names to the points: A = (X1, Y1), B = (X2, Y2).

The direction you want to move is D = normalize(B - A).

The front of the drone is facing U = (cos(a), sin(a)) where a is the angle.
The right side of the drone is facing V = (sin(a), -cos(a)).

If you turn the forward/backward thruster on proportional to dot(D, U) and the left/right thruster on proportional to dot(D, V), you will move in the direction you want. (This is called a change of basis.)

You can scale (dot(D, U), dot(D, V)) uniformly to increase or decrease the speed.

like image 98
Timothy Shields Avatar answered Nov 29 '25 10:11

Timothy Shields



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!