Skip to content

Commit

Permalink
fix VisibleDeprecation Warning (AtsushiSakai#358)
Browse files Browse the repository at this point in the history
* try coverage

* add python warning setting

* add random seed for test coverage
  • Loading branch information
AtsushiSakai authored Jul 10, 2020
1 parent 72c4a89 commit 4c5e3cc
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 6 deletions.
7 changes: 4 additions & 3 deletions SLAM/EKFSLAM/ekf_slam.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def jacob_motion(x, u):

jF = np.array([[0.0, 0.0, -DT * u[0] * math.sin(x[2, 0])],
[0.0, 0.0, DT * u[0] * math.cos(x[2, 0])],
[0.0, 0.0, 0.0]])
[0.0, 0.0, 0.0]], dtype=np.float64)

G = np.eye(STATE_SIZE) + Fx.T @ jF @ Fx

Expand Down Expand Up @@ -236,8 +236,9 @@ def main():
if show_animation: # pragma: no cover
plt.cla()
# for stopping simulation with the esc key.
plt.gcf().canvas.mpl_connect('key_release_event',
lambda event: [exit(0) if event.key == 'escape' else None])
plt.gcf().canvas.mpl_connect(
'key_release_event',
lambda event: [exit(0) if event.key == 'escape' else None])

plt.plot(RFID[:, 0], RFID[:, 1], "*k")
plt.plot(xEst[0], xEst[1], ".r")
Expand Down
1 change: 1 addition & 0 deletions runtests.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bash
echo "Run test suites! "
export PYTHONWARNINGS=default # show warning
#python -m unittest discover tests
#python -Wignore -m unittest discover tests #ignore warning
coverage run -m unittest discover tests # generate coverage file
5 changes: 4 additions & 1 deletion tests/test_batch_informed_rrt_star.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
from unittest import TestCase
import sys
import os
import random
sys.path.append(os.path.dirname(__file__) + "/../")
try:
from PathPlanning.BatchInformedRRTStar import batch_informed_rrtstar as m
except:
except ImportError:
raise

print(__file__)

random.seed(12345)


class Test(TestCase):

Expand Down
4 changes: 3 additions & 1 deletion tests/test_closed_loop_rrt_star_car.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import os
import sys
import random
from unittest import TestCase

sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../")
sys.path.append(os.path.dirname(os.path.abspath(__file__)) +
"/../PathPlanning/ClosedLoopRRTStar/")
try:
from PathPlanning.ClosedLoopRRTStar import closed_loop_rrt_star_car as m
except:
except ImportError:
raise

random.seed(12345)

print(__file__)

Expand Down
1 change: 1 addition & 0 deletions tests/test_dubins_path_planning.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from unittest import TestCase

import numpy as np
np.random.seed(12345)

from PathPlanning.DubinsPath import dubins_path_planning

Expand Down
5 changes: 4 additions & 1 deletion tests/test_lqr_rrt_star.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
from unittest import TestCase
import sys
import os
import random
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../")
sys.path.append(os.path.dirname(os.path.abspath(__file__))
+ "/../PathPlanning/LQRRRTStar/")
try:
from PathPlanning.LQRRRTStar import lqr_rrt_star as m
except:
except ImportError:
raise

print(__file__)

random.seed(12345)


class Test(TestCase):

Expand Down
3 changes: 3 additions & 0 deletions tests/test_n_joint_arm_to_point_control.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import sys
import random
from unittest import TestCase

sys.path.append(os.path.dirname(__file__) + "/../ArmNavigation/n_joint_arm_to_point_control/")
Expand All @@ -8,6 +9,8 @@

print(__file__)

random.seed(12345)


class Test(TestCase):

Expand Down
3 changes: 3 additions & 0 deletions tests/test_rrt.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import sys
import random
from unittest import TestCase

sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../")
Expand All @@ -12,6 +13,8 @@

print(__file__)

random.seed(12345)


class Test(TestCase):

Expand Down

0 comments on commit 4c5e3cc

Please sign in to comment.