|
16 | 16 | # contributors may be used to endorse or promote products derived from |
17 | 17 | # this software without specific prior written permission. |
18 | 18 | # |
19 | | -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 19 | +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' |
20 | 20 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
21 | 21 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
22 | 22 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
|
28 | 28 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
29 | 29 | # POSSIBILITY OF SUCH DAMAGE. |
30 | 30 |
|
31 | | -import unittest |
| 31 | +import copy |
32 | 32 | import struct |
33 | | -import tf2_sensor_msgs |
| 33 | +import unittest |
| 34 | + |
34 | 35 | from sensor_msgs import point_cloud2 |
35 | 36 | from sensor_msgs.msg import PointField |
36 | 37 | from tf2_ros import TransformStamped |
37 | | -import copy |
| 38 | +import tf2_sensor_msgs |
38 | 39 |
|
39 | 40 |
|
40 | 41 | # A sample python unit test |
41 | 42 | class PointCloudConversions(unittest.TestCase): |
| 43 | + |
42 | 44 | def setUp(self): |
43 | 45 | self.point_cloud_in = point_cloud2.PointCloud2() |
44 | 46 | self.point_cloud_in.fields = [ |
@@ -75,13 +77,13 @@ def test_simple_transform(self): |
75 | 77 | k = 300 |
76 | 78 | expected_coordinates = [(1+k, 2+k, 0+k), (10+k, 20+k, 30+k)] |
77 | 79 | new_points = list(point_cloud2.read_points(point_cloud_transformed)) |
78 | | - print("new_points are %s" % new_points) |
| 80 | + print('new_points are %s' % new_points) |
79 | 81 | assert(expected_coordinates == new_points) |
80 | 82 | # checking no modification in input cloud |
81 | 83 | assert(old_data == self.point_cloud_in.data) |
82 | 84 |
|
83 | 85 |
|
84 | 86 | if __name__ == '__main__': |
85 | 87 | import rosunit |
86 | | - rosunit.unitrun("test_tf2_sensor_msgs", "test_point_cloud_conversion", |
| 88 | + rosunit.unitrun('test_tf2_sensor_msgs', 'test_point_cloud_conversion', |
87 | 89 | PointCloudConversions) |
0 commit comments