Skip to content

Commit

Permalink
Added test for quat convention
Browse files Browse the repository at this point in the history
  • Loading branch information
tpanzarella committed Nov 2, 2021
1 parent b45fd32 commit 8213d21
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 4 deletions.
13 changes: 11 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
2.0.3 2020-07-12
----------------
2.0.4 (2021-11-02)
------------------
* Modified transformations.py for quaternion convention (`#2 <https://github.com/Box-Robotics/ros2_numpy/pull/2>`_)
* Added a test case for the quaternion convention
* Fixed rosdep dependencies in package.xml
* Contributors: Asil Orgen, Tom Panzarella


2.0.3 (2020-07-12)
------------------
* Renamed fork to ``ros2_numpy``
* Start tracking changes in CHANGELOG at 2.0.3
* Contributors: Tom Panzarella
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ if(BUILD_TESTING)
ament_add_nose_test(images test/test_images.py)
ament_add_nose_test(occupancygrids test/test_occupancygrids.py)
ament_add_nose_test(geometry test/test_geometry.py)
ament_add_nose_test(quaternions test/test_quat.py)
endif()

##############
Expand Down
3 changes: 1 addition & 2 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<package format="3">
<name>ros2_numpy</name>
<!-- MAJOR is 2 for ROS2 version -->
<version>2.0.3</version>
<version>2.0.4</version>
<description>A collection of conversion functions for extracting numpy arrays from messages</description>

<author email="wieser@mit.edu">Eric Wieser</author>
Expand All @@ -21,7 +21,6 @@
<exec_depend>nav_msgs</exec_depend>
<exec_depend>geometry_msgs</exec_depend>

<buildtool_depend>ament</buildtool_depend>
<buildtool_depend>ament_cmake_python</buildtool_depend>

<test_depend>python3-nose</test_depend>
Expand Down
18 changes: 18 additions & 0 deletions test/test_quat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import unittest
import numpy as np
import geometry_msgs

import ros2_numpy as rnp
import ros2_numpy.transformations as trans

class TestQuat(unittest.TestCase):
def test_representation(self):
q = trans.quaternion_from_euler(0., 0., 0.)
self.assertTrue(np.allclose(q, np.array([0., 0., 0., 1.])))

def test_identity_transform(self):
H = rnp.numpify(geometry_msgs.msg.Transform())
self.assertTrue(np.allclose(H, np.eye(4)))

if __name__ == '__main__':
unittest.main()

0 comments on commit 8213d21

Please sign in to comment.