Comments (2)
I believe this is expected behavior, so I'm going to close this issue, but I will provide more information below.
In your example what you're passing to the target_action
argument of the OnProcessStart
event handler is an IncludeLaunchDescription
action, which cannot be a target for that event handler. The target_action
needs to point to an action that represents a single process, e.g. an ExecuteProcess
action, or a callable (like a function) that takes the Action
instance that created the event and returns true if it matches or false otherwise. The IncludeLaunchDescription
action you're passing isn't something that the OnProcessStart
can use to match to a process, hence this error:
TypeError: action_matcher must be an 'ExecuteProcess' instance or a callable
Instead, you'll need to figure out how to get access to the exact ExecuteProcess
instance you want to match (which will not be possible through an include statement I think) or you'll need to write a function that can match it. I think making a custom matcher is probably your best bet, but you can also use some of the built-in matchers:
launch/launch/launch/events/process/process_matchers.py
Lines 25 to 61 in 651f574
If none of those are what you need to match the process you want, then you can use one of those as a starting point for making your own matcher to pass to the target_action
.
On a higher level, I don't think this event is a reliable way to know when Gazebo is "done launch" and/or "ready for use". This process started event happens pretty much immediately, and simply means the process has been started by the OS and stdout/stderr/stdin are attached to launch
. It does not, however, mean that gazebo has loaded your world file, opened the ui, finished loading the server, is running the simulation, is providing ROS topics or services, etc...
Instead, you probably want to wait for some specific IO event (like a particular string to appear in stdout) or for something else that implies the system is working, like the availability of a ros topic or maybe clock messages being produced by the simulation.
But I'll leave that up to you, since I'm not sure exactly what you're trying to detect.
from launch.
Oh and with respect to:
If tried many combinations for using an RegisterEventHandler, even those from the humble tutorials, None worked:
If you can link to me the tutorials you tried, I can verify that they're working, or maybe help you understand them.
Cheers!
from launch.
Related Issues (20)
- Launch.py from another launcher HOT 2
- Substitutions for string manipulations and xacro HOT 1
- Bug or feature? PushRosNamespace is not forwarded to managed actions HOT 4
- XMLLaunchDescriptionSource: Unknown substitution: find HOT 1
- [FeatureRequest] Is it possible to skip argument checking in include_launch_description
- Launch doesn't stop running nodes when exception thrown HOT 2
- Can't include [launch_testing_ament_cmake] in a launch only package HOT 1
- Bug when setting launch arguments of included descriptions HOT 1
- Requirement:Only start all nodes and then this ros2 launch process exit HOT 2
- `ExecuteProcess` with `shell=True` gets incorrect exit code from the executed process HOT 2
- Add an option to disable creating log files by the launch system HOT 1
- Unexpected YAML parsing with get_attr and List[Entity] type HOT 1
- pytest 8.1 incompatibility: TypeError: import_path() missing 1 required keyword-only argument: 'consider_namespace_packages' HOT 3
- Tests on Windows falsely positive reporting passed due to SIGINT handling HOT 1
- ThisLaunchFileDir throws error in debug mode
- Change ISSUE_TEMPLATE.md HOT 1
- Return Code not set on SIGINT HOT 3
- Request for Release in Iron HOT 2
- Feature request: run multiple tests in parallel with `colcon test` HOT 3
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.