Skip to content

Commit ccc9895

Browse files
committed
Changed alpha/beta variables to have a nicer semantic. Makes it easier to understand.
1 parent 7442bdc commit ccc9895

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

PathTracking/move_to_pose/move_to_pose.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
# simulation parameters
1717
Kp_rho = 9
18-
Kp_alpha = 15
18+
Kp_alpha = -18
1919
Kp_beta = -3
2020
dt = 0.01
2121

@@ -53,9 +53,9 @@ def move_to_pose(x_start, y_start, theta_start, x_goal, y_goal, theta_goal):
5353
# from 0 rad to 2*pi rad with slight turn
5454

5555
rho = np.hypot(x_diff, y_diff)
56-
alpha = (np.arctan2(y_diff, x_diff)
57-
- theta + np.pi) % (2 * np.pi) - np.pi
58-
beta = (theta_goal - theta - alpha + np.pi) % (2 * np.pi) - np.pi
56+
alpha = (theta - np.arctan2(y_diff, x_diff)
57+
+ np.pi) % (2 * np.pi) - np.pi
58+
beta = (theta_goal - theta + np.pi) % (2 * np.pi) - np.pi
5959

6060
v = Kp_rho * rho
6161
w = Kp_alpha * alpha + Kp_beta * beta

0 commit comments

Comments
 (0)