Skip to content

Commit 84dd504

Browse files
authored
Add in the linters for tf2_ros_py. (#740)
Signed-off-by: Chris Lalancette <[email protected]>
1 parent eaaa2d6 commit 84dd504

16 files changed

+572
-431
lines changed

tf2_ros_py/doc/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
# -- Project information -----------------------------------------------------
3636

3737
project = 'tf2_ros_py'
38-
copyright = '2023, Open Source Robotics Foundation, Inc.'
38+
copyright = '2023, Open Source Robotics Foundation, Inc.' # noqa: A001
3939
author = 'Open Source Robotics Foundation, Inc.'
4040

4141
# The full version, including alpha/beta/rc tags

tf2_ros_py/test/test_buffer.py

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,39 @@
1-
# Copyright 2019 Open Source Robotics Foundation, Inc.
2-
# All rights reserved.
1+
# Copyright (c) 2019 Open Source Robotics Foundation, Inc. All rights reserved.
32
#
43
# Redistribution and use in source and binary forms, with or without
5-
# modification, are permitted provided that the following conditions
6-
# are met:
4+
# modification, are permitted provided that the following conditions are met:
75
#
8-
# * Redistributions of source code must retain the above copyright
9-
# notice, this list of conditions and the following disclaimer.
10-
# * Redistributions in binary form must reproduce the above
11-
# copyright notice, this list of conditions and the following
12-
# disclaimer in the documentation and/or other materials provided
13-
# with the distribution.
14-
# * Neither the name of the Willow Garage nor the names of its
15-
# contributors may be used to endorse or promote products derived
16-
# from this software without specific prior written permission.
6+
# * Redistributions of source code must retain the above copyright
7+
# notice, this list of conditions and the following disclaimer.
178
#
18-
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19-
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20-
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21-
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22-
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23-
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
24-
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25-
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26-
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27-
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
28-
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
9+
# * Redistributions in binary form must reproduce the above copyright
10+
# notice, this list of conditions and the following disclaimer in the
11+
# documentation and/or other materials provided with the distribution.
12+
#
13+
# * Neither the name of the copyright holder nor the names of its
14+
# contributors may be used to endorse or promote products derived from
15+
# this software without specific prior written permission.
16+
#
17+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20+
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
21+
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22+
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23+
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25+
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26+
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2927
# POSSIBILITY OF SUCH DAMAGE.
3028

29+
from geometry_msgs.msg import TransformStamped
3130
import pytest
3231
import rclpy
33-
3432
from tf2_ros.buffer import Buffer
35-
from geometry_msgs.msg import TransformStamped, PointStamped
33+
3634

3735
class TestBuffer:
36+
3837
def build_transform(self, target, source, rclpy_time):
3938
transform = TransformStamped()
4039
transform.header.frame_id = target

tf2_ros_py/test/test_buffer_client.py

Lines changed: 40 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,42 @@
1-
# Copyright 2019 Open Source Robotics Foundation, Inc.
2-
# All rights reserved.
1+
# Copyright (c) 2019 Open Source Robotics Foundation, Inc. All rights reserved.
32
#
43
# Redistribution and use in source and binary forms, with or without
5-
# modification, are permitted provided that the following conditions
6-
# are met:
4+
# modification, are permitted provided that the following conditions are met:
75
#
8-
# * Redistributions of source code must retain the above copyright
9-
# notice, this list of conditions and the following disclaimer.
10-
# * Redistributions in binary form must reproduce the above
11-
# copyright notice, this list of conditions and the following
12-
# disclaimer in the documentation and/or other materials provided
13-
# with the distribution.
14-
# * Neither the name of the Willow Garage nor the names of its
15-
# contributors may be used to endorse or promote products derived
16-
# from this software without specific prior written permission.
6+
# * Redistributions of source code must retain the above copyright
7+
# notice, this list of conditions and the following disclaimer.
178
#
18-
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19-
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20-
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21-
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22-
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23-
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
24-
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25-
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26-
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27-
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
28-
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
9+
# * Redistributions in binary form must reproduce the above copyright
10+
# notice, this list of conditions and the following disclaimer in the
11+
# documentation and/or other materials provided with the distribution.
12+
#
13+
# * Neither the name of the copyright holder nor the names of its
14+
# contributors may be used to endorse or promote products derived from
15+
# this software without specific prior written permission.
16+
#
17+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20+
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
21+
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22+
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23+
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25+
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26+
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2927
# POSSIBILITY OF SUCH DAMAGE.
3028

31-
import pytest
3229
import threading
33-
import time
34-
35-
import rclpy
3630

37-
from tf2_ros.buffer_client import BufferClient
3831
from geometry_msgs.msg import TransformStamped
39-
from tf2_msgs.action import LookupTransform
40-
from tf2_py import BufferCore, LookupException
32+
import pytest
33+
import rclpy
4134
from rclpy.executors import SingleThreadedExecutor
4235
from rclpy.time import Time
36+
from tf2_msgs.action import LookupTransform
4337
from tf2_msgs.msg import TF2Error
38+
from tf2_py import BufferCore, LookupException
39+
from tf2_ros.buffer_client import BufferClient
4440

4541

4642
def build_transform(target_frame, source_frame, stamp):
@@ -61,8 +57,10 @@ def build_transform(target_frame, source_frame, stamp):
6157

6258

6359
class MockBufferServer():
60+
6461
def __init__(self, node, buffer_core):
65-
self.action_server = rclpy.action.ActionServer(node, LookupTransform, 'lookup_transform', self.execute_callback)
62+
self.action_server = rclpy.action.ActionServer(
63+
node, LookupTransform, 'lookup_transform', self.execute_callback)
6664
self.buffer_core = buffer_core
6765

6866
def execute_callback(self, goal_handle):
@@ -72,9 +70,10 @@ def execute_callback(self, goal_handle):
7270

7371
try:
7472
if not goal_handle.request.advanced:
75-
transform = self.buffer_core.lookup_transform_core(target_frame=goal_handle.request.target_frame,
76-
source_frame=goal_handle.request.source_frame,
77-
time=Time.from_msg(goal_handle.request.source_time))
73+
transform = self.buffer_core.lookup_transform_core(
74+
target_frame=goal_handle.request.target_frame,
75+
source_frame=goal_handle.request.source_frame,
76+
time=Time.from_msg(goal_handle.request.source_time))
7877
else:
7978
transform = self.buffer_core.lookup_transform_full_core(
8079
target_frame=goal_handle.request.target_frame,
@@ -85,7 +84,7 @@ def execute_callback(self, goal_handle):
8584
)
8685
response.transform = transform
8786
goal_handle.succeed()
88-
except LookupException as e:
87+
except LookupException:
8988
response.error.error = TF2Error.LOOKUP_ERROR
9089
goal_handle.abort()
9190

@@ -96,6 +95,7 @@ def destroy(self):
9695

9796

9897
class TestBufferClient:
98+
9999
@classmethod
100100
def setup_class(cls):
101101
cls.context = rclpy.context.Context()
@@ -133,7 +133,8 @@ def spin(self):
133133

134134
def test_lookup_transform_true(self):
135135
buffer_client = BufferClient(
136-
self.node, 'lookup_transform', check_frequency=10.0, timeout_padding=rclpy.duration.Duration(seconds=0.0))
136+
self.node, 'lookup_transform', check_frequency=10.0,
137+
timeout_padding=rclpy.duration.Duration(seconds=0.0))
137138

138139
result = buffer_client.lookup_transform(
139140
'foo', 'bar', rclpy.time.Time(), rclpy.duration.Duration(seconds=5.0))
@@ -144,7 +145,8 @@ def test_lookup_transform_true(self):
144145

145146
def test_lookup_transform_fail(self):
146147
buffer_client = BufferClient(
147-
self.node, 'lookup_transform', check_frequency=10.0, timeout_padding=rclpy.duration.Duration(seconds=0.0))
148+
self.node, 'lookup_transform', check_frequency=10.0,
149+
timeout_padding=rclpy.duration.Duration(seconds=0.0))
148150

149151
with pytest.raises(LookupException) as excinfo:
150152
buffer_client.lookup_transform(

tf2_ros_py/test/test_copyright.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Copyright (c) 2024 Open Source Robotics Foundation, Inc. All rights reserved.
2+
#
3+
# Redistribution and use in source and binary forms, with or without
4+
# modification, are permitted provided that the following conditions are met:
5+
#
6+
# * Redistributions of source code must retain the above copyright
7+
# notice, this list of conditions and the following disclaimer.
8+
#
9+
# * Redistributions in binary form must reproduce the above copyright
10+
# notice, this list of conditions and the following disclaimer in the
11+
# documentation and/or other materials provided with the distribution.
12+
#
13+
# * Neither the name of the copyright holder nor the names of its
14+
# contributors may be used to endorse or promote products derived from
15+
# this software without specific prior written permission.
16+
#
17+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20+
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
21+
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22+
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23+
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25+
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26+
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27+
# POSSIBILITY OF SUCH DAMAGE.
28+
29+
from ament_copyright.main import main
30+
import pytest
31+
32+
33+
@pytest.mark.copyright
34+
@pytest.mark.linter
35+
def test_copyright():
36+
assert main(argv=['.', 'test']) == 0, 'Found errors'

tf2_ros_py/test/test_flake8.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Copyright (c) 2024 Open Source Robotics Foundation, Inc. All rights reserved.
2+
#
3+
# Redistribution and use in source and binary forms, with or without
4+
# modification, are permitted provided that the following conditions are met:
5+
#
6+
# * Redistributions of source code must retain the above copyright
7+
# notice, this list of conditions and the following disclaimer.
8+
#
9+
# * Redistributions in binary form must reproduce the above copyright
10+
# notice, this list of conditions and the following disclaimer in the
11+
# documentation and/or other materials provided with the distribution.
12+
#
13+
# * Neither the name of the copyright holder nor the names of its
14+
# contributors may be used to endorse or promote products derived from
15+
# this software without specific prior written permission.
16+
#
17+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20+
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
21+
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22+
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23+
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25+
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26+
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27+
# POSSIBILITY OF SUCH DAMAGE.
28+
29+
from ament_flake8.main import main_with_errors
30+
import pytest
31+
32+
33+
@pytest.mark.flake8
34+
@pytest.mark.linter
35+
def test_flake8():
36+
rc, errors = main_with_errors(argv=[])
37+
assert rc == 0, \
38+
'Found %d code style errors / warnings:\n' % len(errors) + \
39+
'\n'.join(errors)

tf2_ros_py/test/test_listener_and_broadcaster.py

Lines changed: 37 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,40 @@
1-
# Copyright 2019 Open Source Robotics Foundation, Inc.
2-
# All rights reserved.
1+
# Copyright (c) 2019 Open Source Robotics Foundation, Inc. All rights reserved.
32
#
43
# Redistribution and use in source and binary forms, with or without
5-
# modification, are permitted provided that the following conditions
6-
# are met:
4+
# modification, are permitted provided that the following conditions are met:
75
#
8-
# * Redistributions of source code must retain the above copyright
9-
# notice, this list of conditions and the following disclaimer.
10-
# * Redistributions in binary form must reproduce the above
11-
# copyright notice, this list of conditions and the following
12-
# disclaimer in the documentation and/or other materials provided
13-
# with the distribution.
14-
# * Neither the name of the Willow Garage nor the names of its
15-
# contributors may be used to endorse or promote products derived
16-
# from this software without specific prior written permission.
6+
# * Redistributions of source code must retain the above copyright
7+
# notice, this list of conditions and the following disclaimer.
178
#
18-
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19-
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20-
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21-
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22-
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23-
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
24-
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25-
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26-
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27-
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
28-
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
9+
# * Redistributions in binary form must reproduce the above copyright
10+
# notice, this list of conditions and the following disclaimer in the
11+
# documentation and/or other materials provided with the distribution.
12+
#
13+
# * Neither the name of the copyright holder nor the names of its
14+
# contributors may be used to endorse or promote products derived from
15+
# this software without specific prior written permission.
16+
#
17+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20+
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
21+
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22+
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23+
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25+
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26+
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2927
# POSSIBILITY OF SUCH DAMAGE.
3028

29+
from geometry_msgs.msg import TransformStamped
3130
import pytest
3231
import rclpy
33-
34-
from geometry_msgs.msg import TransformStamped
32+
from tf2_ros import ExtrapolationException
3533
from tf2_ros.buffer import Buffer
36-
from tf2_ros.transform_broadcaster import TransformBroadcaster
3734
from tf2_ros.static_transform_broadcaster import StaticTransformBroadcaster
38-
from tf2_ros.transform_listener import TransformListener
3935
from tf2_ros.static_transform_listener import StaticTransformListener
40-
from tf2_ros import ExtrapolationException
36+
from tf2_ros.transform_broadcaster import TransformBroadcaster
37+
from tf2_ros.transform_listener import TransformListener
4138

4239

4340
def build_transform(target_frame, source_frame, stamp):
@@ -58,6 +55,7 @@ def build_transform(target_frame, source_frame, stamp):
5855

5956

6057
class TestBroadcasterAndListener:
58+
6159
@classmethod
6260
def setup_class(cls):
6361
rclpy.init()
@@ -160,21 +158,21 @@ def test_broadcaster_and_listener(self):
160158
assert broadcasted_transform == listened_transform_async
161159

162160
def test_static_broadcaster_and_listener(self):
163-
broadcasted_transform = self.broadcast_static_transform(
161+
broadcasted_tf = self.broadcast_static_transform(
164162
target_frame='foo', source_frame='bar',
165163
time_stamp=rclpy.time.Time(seconds=1.1, nanoseconds=0).to_msg())
166164

167-
listened_transform = self.buffer.lookup_transform(
165+
listened_tf = self.buffer.lookup_transform(
168166
target_frame='foo', source_frame='bar',
169167
time=rclpy.time.Time(seconds=1.5, nanoseconds=0).to_msg())
170168

171-
assert broadcasted_transform.header.stamp.sec == 1
172-
assert broadcasted_transform.header.stamp.nanosec == 100000000
169+
assert broadcasted_tf.header.stamp.sec == 1
170+
assert broadcasted_tf.header.stamp.nanosec == 100000000
173171

174-
assert listened_transform.header.stamp.sec == 1
175-
assert listened_transform.header.stamp.nanosec == 500000000
172+
assert listened_tf.header.stamp.sec == 1
173+
assert listened_tf.header.stamp.nanosec == 500000000
176174

177-
assert broadcasted_transform.header.frame_id == listened_transform.header.frame_id
178-
assert broadcasted_transform.child_frame_id == listened_transform.child_frame_id
179-
assert broadcasted_transform.transform.translation == listened_transform.transform.translation
180-
assert broadcasted_transform.transform.rotation == listened_transform.transform.rotation
175+
assert broadcasted_tf.header.frame_id == listened_tf.header.frame_id
176+
assert broadcasted_tf.child_frame_id == listened_tf.child_frame_id
177+
assert broadcasted_tf.transform.translation == listened_tf.transform.translation
178+
assert broadcasted_tf.transform.rotation == listened_tf.transform.rotation

0 commit comments

Comments
 (0)