Skip to content

Commit 2458382

Browse files
committed
fix unittests.
1 parent afbcdfc commit 2458382

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

PathPlanning/LQRPlanner/LQRplanner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def __init__(self):
2525
self.MAX_ITER = 150
2626
self.EPS = 0.01
2727

28-
def lqr_planning(self, sx, sy, gx, gy, show_animation=SHOW_ANIMATION):
28+
def lqr_planning(self, sx, sy, gx, gy, show_animation=True):
2929

3030
rx, ry = [sx], [sy]
3131

@@ -129,7 +129,7 @@ def main():
129129
gx = random.uniform(-area, area)
130130
gy = random.uniform(-area, area)
131131

132-
rx, ry = lqr_planner.lqr_planning(sx, sy, gx, gy)
132+
rx, ry = lqr_planner.lqr_planning(sx, sy, gx, gy, show_animation=SHOW_ANIMATION)
133133

134134
if SHOW_ANIMATION: # pragma: no cover
135135
plt.plot(sx, sy, "or")

tests/test_drone_3d_trajectory_following.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
import os
2+
import sys
13
from unittest import TestCase
24

3-
import sys
4-
sys.path.append("./AerialNavigation/drone_3d_trajectory_following/")
5+
sys.path.append(os.path.dirname(__file__) + "/../AerialNavigation/drone_3d_trajectory_following/")
6+
7+
import drone_3d_trajectory_following as m
58

6-
from AerialNavigation.drone_3d_trajectory_following import drone_3d_trajectory_following as m
79
print(__file__)
810

911

tests/test_grid_based_sweep_coverage_path_planner.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
except ImportError:
1010
raise
1111

12+
grid_based_sweep_coverage_path_planner.do_animation = False
13+
14+
1215
class TestPlanning(TestCase):
1316

1417
def test_planning1(self):

tests/test_n_joint_arm_to_point_control.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
import os
2+
import sys
13
from unittest import TestCase
24

3-
import sys
4-
sys.path.append("./ArmNavigation/n_joint_arm_to_point_control/")
5+
sys.path.append(os.path.dirname(__file__) + "/../ArmNavigation/n_joint_arm_to_point_control/")
6+
7+
import n_joint_arm_to_point_control as m
58

6-
from ArmNavigation.n_joint_arm_to_point_control import n_joint_arm_to_point_control as m
79
print(__file__)
810

911

0 commit comments

Comments
 (0)