Comments (8)
See #112 for a fix of the example.
Longer term, I think we need to remove the injection from the CLI tool, or be able to detect that the preamble has already been included to avoid including it more than once.
from launch_ros.
Any updates here? I'm stuck to the same issue.
from launch_ros.
I can reproduce the issue.
Interestingly, if you run the test with the CLI tool ros2 test
, then there is no error:
ros2 test src/ros2/launch_ros/launch_testing_ros/test/examples/talker_listener_launch_test.py
from launch_ros.
I guess it kind of makes sense, since the ROS node is specific to launch_ros
and not launch
; the node is started by the default launch_ros
description here:
launch_ros/launch_ros/launch_ros/default_launch_description.py
Lines 80 to 92 in c37340d
I think either the README should be updated to use ros2 test
, or the example launch file should be updated to use the get_default_launch_description
.
from launch_ros.
Updating the launch file fixes the issue for launching with launch_test
, e.g.:
ld = launch_ros.get_default_launch_description()
ld.add_action(talker_node)
ld.add_action(listener_node)
# Start tests right away - no need to wait for anything
ld.add_action(launch_testing.actions.ReadyToTest())
But, then two nodes are created if we run with ros2 test
and we get the following warning:
[WARN] [rcl.logging_rosout]: Publisher already registered for provided node name. If this is due to multiple nodes with the same name then all logs for that logger name will go out over the existing publisher. As soon as any node with that name is destructed it will unregister the publisher, preventing any further logs for that name from being published on the rosout topic.
Seems like a different approach is required.
from launch_ros.
There's no good solution here really, besides not mixing up launch_test
and ros2 test
. The former just runs the test, the latter injects launch_ros
default launch description. There was a discussion about this in ros2/launch#208. I still think tools should not inject anything, but consensus back then was to reduce boilerplate as much as possible.
from launch_ros.
Got burned by this last night as well.
+1 for removing the injection. Reasoning:
- Prefer to have one launch test file format, not two (e.g. the current launch_test file is broken with launch_test, which makes it something else).
- Prefer not to depend on user friendly tooling (i.e.
ros2 test
). There already is an execution framework (i.e. launch_test) soros2 test
should be there to provide conveniences, not dependencies.
from launch_ros.
I've fixed the example in #121 and opened a ticket to discuss removing the injected launch description: #120
from launch_ros.
Related Issues (20)
- WaitForToppics spends a long time waiting for the thread to join HOT 4
- Hang after repeated ctrl+c on Windows HOT 3
- `test_load_composable_nodes.py` flaky on Windows HOT 1
- Action that automatically brings LifecycleNode to active state HOT 5
- Numbers in scientific notation are not tolerated HOT 8
- :man_farmer: `test_launch_ros` test regressions on Foxy `test_launch_ros.test.test_launch_ros.actions.test_node.TestNode.*` HOT 1
- Support for conditional parameter import from yaml file in XML launch file HOT 11
- :man_farmer: Flaky issues with `launch_testing_ros`: `terminate called without an active exception` HOT 13
- LaunchConfiguration is not read from ComposableNode when included inside a group action HOT 11
- how to write a launch file to show .xacro or .urdf file to rviz2 for ros-dashing HOT 1
- IfCondition is ignored in ComposableNode if LoadComposableNodes is used HOT 5
- Is it possible to pass namespace of ComposableContainer? HOT 1
- Accessing numerical parameter causes exception
- Setting name parameter leads to duplicate nodes with same name HOT 1
- YAML-parameters won't read correctly for two or more composable nodes with non-empty root namespace HOT 2
- Get content of topic from `launch_testing_ros::WaitForTopics` HOT 6
- `WaitForTopics`: there is no way to manually trigger a topic HOT 8
- `WaitForTopics`: exit() methods should not reraise the passed-in exception HOT 1
- Component Containers on Different ROS_DOMAIN_IDs Fail to Launch HOT 1
- --ros-args argument is always present in Node HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from launch_ros.