-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4ddfb85
commit a7293c7
Showing
3 changed files
with
25 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
def test_imports(): | ||
from trajectories import TrajectoryFactory | ||
|
||
def test_square_trajectory(): | ||
from trajectories import TrajectoryFactory | ||
from trajectories.trajectories import SquareLinearTrajectory | ||
import numpy as np | ||
trajectory: SquareLinearTrajectory = TrajectoryFactory.get_linear_square_trajectory() | ||
p0 = trajectory.get_waypoint(0) | ||
p1 = trajectory.get_waypoint(0.25) | ||
p2 = trajectory.get_waypoint(0.5) | ||
p3 = trajectory.get_waypoint(0.75) | ||
|
||
# assert corner points | ||
assert((p0.coordinate == trajectory.corner_points[0]).all()) | ||
assert((p1.coordinate == trajectory.corner_points[1]).all()) | ||
assert((p2.coordinate == trajectory.corner_points[2]).all()) | ||
assert((p3.coordinate == trajectory.corner_points[3]).all()) | ||
|
||
# assert interpolation | ||
assert(trajectory.get_waypoint(0.1).coordinate == np.asarray([0.4, 0., 1.], dtype=np.float32)).all() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters