Ai
1 Star 0 Fork 2

AIS/PythonRobotics

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
test_utils.py 815 Bytes
一键复制 编辑 原始数据 按行查看 历史
Atsushi Sakai 提交于 2022-05-17 20:57 +08:00 . Enhance dubins path docs (#679)
import conftest # Add root path to sys.path
from utils import angle
from numpy.testing import assert_allclose
import numpy as np
def test_rot_mat_2d():
assert_allclose(angle.rot_mat_2d(0.0),
np.array([[1., 0.],
[0., 1.]]))
def test_angle_mod():
assert_allclose(angle.angle_mod(-4.0), 2.28318531)
assert(isinstance(angle.angle_mod(-4.0), float))
assert_allclose(angle.angle_mod([-4.0]), [2.28318531])
assert(isinstance(angle.angle_mod([-4.0]), np.ndarray))
assert_allclose(angle.angle_mod([-150.0, 190.0, 350], degree=True),
[-150., -170., -10.])
assert_allclose(angle.angle_mod(-60.0, zero_2_2pi=True, degree=True),
[300.])
if __name__ == '__main__':
conftest.run_this_test(__file__)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/aircraft-is-design/PythonRobotics.git
git@gitee.com:aircraft-is-design/PythonRobotics.git
aircraft-is-design
PythonRobotics
PythonRobotics
master

搜索帮助