Skip to content

Commit 599ddf2

Browse files
Draw goal vector on plot
1 parent 8e71c36 commit 599ddf2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

PathTracking/move_to_pose/move_to_pose.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ def move_to_pose(x_start, y_start, theta_start, x_goal, y_goal, theta_goal):
6060
x_traj.append(x)
6161
y_traj.append(y)
6262

63-
plot_vehicle(x, y, theta, x_start, y_start, x_goal, y_goal, x_traj, y_traj)
63+
plot_vehicle(x, y, theta, x_start, y_start, x_goal, y_goal, theta_goal, x_traj, y_traj)
6464

6565

66-
def plot_vehicle(x, y, theta, x_start, y_start, x_goal, y_goal, x_traj, y_traj):
66+
def plot_vehicle(x, y, theta, x_start, y_start, x_goal, y_goal, theta_goal, x_traj, y_traj):
6767
T = transformation_matrix(x, y, theta)
6868
p1 = np.matmul(T, p1_i)
6969
p2 = np.matmul(T, p2_i)
@@ -73,7 +73,7 @@ def plot_vehicle(x, y, theta, x_start, y_start, x_goal, y_goal, x_traj, y_traj):
7373
plt.plot([p2[0], p3[0]], [p2[1], p3[1]], 'k-')
7474
plt.plot([p3[0], p1[0]], [p3[1], p1[1]], 'k-')
7575
plt.plot(x_start, y_start, 'r*')
76-
plt.plot(x_goal, y_goal, 'g*')
76+
plt.arrow(x_goal, y_goal, cos(theta_goal), sin(theta_goal), color='g', width=0.1)
7777
plt.plot(x_traj, y_traj, 'b--')
7878
plt.xlim(0, 20)
7979
plt.ylim(0, 20)

0 commit comments

Comments
 (0)