Skip to content

Commit 8213d21

Browse files
committed
Added test for quat convention
1 parent b45fd32 commit 8213d21

File tree

4 files changed

+31
-4
lines changed

4 files changed

+31
-4
lines changed

CHANGELOG.rst

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
2.0.3 2020-07-12
2-
----------------
1+
2.0.4 (2021-11-02)
2+
------------------
3+
* Modified transformations.py for quaternion convention (`#2 <https://github.com/Box-Robotics/ros2_numpy/pull/2>`_)
4+
* Added a test case for the quaternion convention
5+
* Fixed rosdep dependencies in package.xml
6+
* Contributors: Asil Orgen, Tom Panzarella
7+
8+
9+
2.0.3 (2020-07-12)
10+
------------------
311
* Renamed fork to ``ros2_numpy``
412
* Start tracking changes in CHANGELOG at 2.0.3
13+
* Contributors: Tom Panzarella

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ if(BUILD_TESTING)
1717
ament_add_nose_test(images test/test_images.py)
1818
ament_add_nose_test(occupancygrids test/test_occupancygrids.py)
1919
ament_add_nose_test(geometry test/test_geometry.py)
20+
ament_add_nose_test(quaternions test/test_quat.py)
2021
endif()
2122

2223
##############

package.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<package format="3">
55
<name>ros2_numpy</name>
66
<!-- MAJOR is 2 for ROS2 version -->
7-
<version>2.0.3</version>
7+
<version>2.0.4</version>
88
<description>A collection of conversion functions for extracting numpy arrays from messages</description>
99

1010
<author email="wieser@mit.edu">Eric Wieser</author>
@@ -21,7 +21,6 @@
2121
<exec_depend>nav_msgs</exec_depend>
2222
<exec_depend>geometry_msgs</exec_depend>
2323

24-
<buildtool_depend>ament</buildtool_depend>
2524
<buildtool_depend>ament_cmake_python</buildtool_depend>
2625

2726
<test_depend>python3-nose</test_depend>

test/test_quat.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import unittest
2+
import numpy as np
3+
import geometry_msgs
4+
5+
import ros2_numpy as rnp
6+
import ros2_numpy.transformations as trans
7+
8+
class TestQuat(unittest.TestCase):
9+
def test_representation(self):
10+
q = trans.quaternion_from_euler(0., 0., 0.)
11+
self.assertTrue(np.allclose(q, np.array([0., 0., 0., 1.])))
12+
13+
def test_identity_transform(self):
14+
H = rnp.numpify(geometry_msgs.msg.Transform())
15+
self.assertTrue(np.allclose(H, np.eye(4)))
16+
17+
if __name__ == '__main__':
18+
unittest.main()

0 commit comments

Comments
 (0)