Skip to content

Commit 9ab9319

Browse files
committed
move to pose test and animation are added
1 parent 1cf962a commit 9ab9319

File tree

3 files changed

+20
-11
lines changed

3 files changed

+20
-11
lines changed
8.25 MB
Loading

PathTracking/move_to_pose/move_to_pose.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -110,17 +110,19 @@ def transformation_matrix(x, y, theta):
110110

111111

112112
def main():
113-
x_start = 20 * random()
114-
y_start = 20 * random()
115-
theta_start = 2 * np.pi * random() - np.pi
116-
x_goal = 20 * random()
117-
y_goal = 20 * random()
118-
theta_goal = 2 * np.pi * random() - np.pi
119-
print("Initial x: %.2f m\nInitial y: %.2f m\nInitial theta: %.2f rad\n" %
120-
(x_start, y_start, theta_start))
121-
print("Goal x: %.2f m\nGoal y: %.2f m\nGoal theta: %.2f rad\n" %
122-
(x_goal, y_goal, theta_goal))
123-
move_to_pose(x_start, y_start, theta_start, x_goal, y_goal, theta_goal)
113+
114+
for i in range(5):
115+
x_start = 20 * random()
116+
y_start = 20 * random()
117+
theta_start = 2 * np.pi * random() - np.pi
118+
x_goal = 20 * random()
119+
y_goal = 20 * random()
120+
theta_goal = 2 * np.pi * random() - np.pi
121+
print("Initial x: %.2f m\nInitial y: %.2f m\nInitial theta: %.2f rad\n" %
122+
(x_start, y_start, theta_start))
123+
print("Goal x: %.2f m\nGoal y: %.2f m\nGoal theta: %.2f rad\n" %
124+
(x_goal, y_goal, theta_goal))
125+
move_to_pose(x_start, y_start, theta_start, x_goal, y_goal, theta_goal)
124126

125127

126128
if __name__ == '__main__':

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,13 @@ Ref:
645645

646646
# Path tracking
647647

648+
## move to a pose control
649+
650+
This is a simulation of moving to a pose control
651+
652+
![2](https://github.com/AtsushiSakai/PythonRobotics/raw/master/PathTracking/move_to_pose/animation.gif)
653+
654+
648655
## Pure pursuit tracking
649656

650657
Path tracking simulation with pure pursuit steering control and PID speed control.

0 commit comments

Comments
 (0)