How to use evo - 10 common examples

To help you get started, we’ve selected a few evo examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github MichaelGrupp / evo / test / test_lie_algebra.py View on Github external
def test_is_sim3(self):
        r = lie.random_so3()
        t = np.array([1, 2, 3])
        s = 3
        p = lie.sim3(r, t, s)
        self.assertTrue(lie.is_sim3(p, s))
github MichaelGrupp / evo / test / test_lie_algebra.py View on Github external
def test_so3_log_exp(self):
        r = lie.random_so3()
        self.assertTrue(lie.is_so3(r))
        rotvec = lie.so3_log(r, return_angle_only=False)
        self.assertTrue(np.allclose(r, lie.so3_exp(rotvec), atol=1e-6))
        angle = lie.so3_log(r)
        self.assertAlmostEqual(np.linalg.norm(rotvec), angle)
github MichaelGrupp / evo / test / helpers.py View on Github external
def random_se3_list(length):
    return [lie.random_se3() for _ in range(length)]
github MichaelGrupp / evo / test / test_lie_algebra.py View on Github external
def test_so3_from_se3(self):
        p = lie.random_se3()
        r = lie.so3_from_se3(p)
        self.assertTrue(lie.is_so3(r))
github MichaelGrupp / evo / test / test_trajectory.py View on Github external
def test_transform_sim3(self):
        path = helpers.fake_path(10)
        path_transformed = copy.deepcopy(path)
        t = lie.sim3(r=lie.random_so3(), t=np.ones(3), s=1.234)
        path_transformed.transform(t)
        self.assertAlmostEqual(path_transformed.path_length,
                               path.path_length * 1.234)
github MichaelGrupp / evo / test / test_file_interface.py View on Github external
def test_write_read_integrity(self):
        result_out = Result()
        result_out.add_np_array("test-array", np.ones(1000))
        result_out.add_info({"name": "test", "number": 666})
        result_out.add_trajectory("traj", helpers.fake_trajectory(1000, 0.1))
        file_interface.save_res_file(self.mock_file, result_out)
        result_in = file_interface.load_res_file(self.mock_file,
                                                 load_trajectories=True)
        self.assertEqual(result_in, result_out)
github MichaelGrupp / evo / test / test_file_interface.py View on Github external
def test_write_read_integrity(self):
        traj_out = helpers.fake_trajectory(1000, 0.1)
        self.assertTrue(traj_out.check())
        file_interface.write_tum_trajectory_file(self.mock_file, traj_out)
        self.mock_file.seek(0)
        traj_in = file_interface.read_tum_trajectory_file(self.mock_file)
        self.assertIsInstance(traj_in, PoseTrajectory3D)
        self.assertTrue(traj_in.check())
        self.assertTrue(traj_out == traj_in)
github MichaelGrupp / evo / test / test_file_interface.py View on Github external
def test_with_bom(self):
        tmp_file = tempfile.NamedTemporaryFile(delete=False)
        with open(tmp_file.name, 'wb') as f:
            f.write(b"\xef\xbb\xbf")
        self.assertTrue(file_interface.has_utf8_bom(tmp_file.name))
github MichaelGrupp / evo / test / test_file_interface.py View on Github external
def test_write_read_integrity(self):
        import rosbag
        tmp_file = tempfile.NamedTemporaryFile(delete=False)
        bag_out = rosbag.Bag(tmp_file.name, 'w')
        traj_out = helpers.fake_trajectory(1000, 0.1)
        self.assertTrue(traj_out.check())
        file_interface.write_bag_trajectory(bag_out, traj_out, "/test",
                                            frame_id="map")
        bag_out.close()
        bag_in = rosbag.Bag(tmp_file.name, 'r')
        traj_in = file_interface.read_bag_trajectory(bag_in, "/test")
        self.assertIsInstance(traj_in, PoseTrajectory3D)
        self.assertTrue(traj_in.check())
        self.assertTrue(traj_out == traj_in)
        self.assertEqual(traj_in.meta["frame_id"], "map")
github MichaelGrupp / evo / test / test_file_interface.py View on Github external
def test_too_many_columns(self):
        self.mock_file.write(u"1 2 3 4 5 6 7 8 9 10 11 12 13")
        self.mock_file.seek(0)
        with self.assertRaises(file_interface.FileInterfaceException):
            file_interface.read_kitti_poses_file(self.mock_file)