-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert test_verb_dump into launch test
Fixes #480 The actual tests are the same, except with the use of launch_testing we ensure the CLI daemon is restarted between tests. This follows a similar pattern as the other ros2cli tests. I've left a TODO to test with all RMW implementations. I did not enable this now since I do not expect the tests to pass with all RMW implementations. See #482 Signed-off-by: Jacob Perron <[email protected]>
- Loading branch information
1 parent
8e6e051
commit 5ba0bc0
Showing
3 changed files
with
197 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Copyright 2020 Open Source Robotics Foundation, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
import sys | ||
|
||
import rclpy | ||
from rclpy.parameter import PARAMETER_SEPARATOR_STRING | ||
|
||
|
||
def main(args=None): | ||
rclpy.init(args=args) | ||
|
||
node = rclpy.create_node('parameter_node') | ||
node.declare_parameter('bool_param', True) | ||
node.declare_parameter('int_param', 42) | ||
node.declare_parameter('double_param', 1.23) | ||
node.declare_parameter('str_param', 'Hello World') | ||
node.declare_parameter('foo' + PARAMETER_SEPARATOR_STRING + 'str_param', 'foo') | ||
node.declare_parameter('foo' + PARAMETER_SEPARATOR_STRING + | ||
'bar' + PARAMETER_SEPARATOR_STRING + | ||
'str_param', 'foobar') | ||
|
||
try: | ||
rclpy.spin(node) | ||
except KeyboardInterrupt: | ||
print('parameter node stopped cleanly') | ||
except BaseException: | ||
print('exception in parameter node:', file=sys.stderr) | ||
raise | ||
finally: | ||
node.destroy_node() | ||
rclpy.shutdown() | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters