-
Notifications
You must be signed in to change notification settings - Fork 4
Running with Rolling, create msg model, create connections in rossystem #61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
… extraction and package/executable identification
…kage/executable identification
…d-line arguments for including robot_description parameters and refining package/executable information from launch files.
Removes leading '/' from node names to ensure cleaner output and prevent inconsistencies when referencing node identifiers across generated artifacts.
…connection mapping Improves node interface handling and connection mapping Refactors the template to better collect node interfaces and systematically map connections between publishers, subscribers, services, and actions. Enhances clarity and future extensibility of generated files by centralizing data and connection logic.
…nhance usage examples for node and system model generation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request enhances the ROS 2 model extraction toolchain to improve compatibility across ROS distributions (Humble/Rolling), implement dynamic system model generation with connection mapping, and add comprehensive message interface modeling capabilities.
- Added robust ROS distribution detection and parameter client compatibility for both AsyncParameterClient (Rolling) and legacy ros2param.api methods
- Implemented dynamic rossystem template with automatic connection generation between publishers/subscribers, services, and actions
- Created new message verb for generating .ros models from interface packages with proper type formatting and namespace handling
Reviewed Changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| templates/rossystem.rossystem.j2 | Enhanced template with connection generation and improved node/interface mapping |
| templates/message.ros.j2 | Added proper type formatting for message fields with namespace qualification |
| templates/component.ros2.j2 | Fixed node name stripping for consistent formatting |
| setup.py | Added message template and new message verb to package configuration |
| ros2model/verb/runtime_system.py | Added launch file parsing and mapping functionality for package/executable resolution |
| ros2model/verb/runtime_node.py | Enhanced node generation with launch mapping and description parameter filtering |
| ros2model/verb/message.py | New verb implementation for generating interface models from packages |
| ros2model/core/utils.py | Improved process detection with better parsing of ROS node arguments and environment |
| ros2model/api/runtime_parser/rossystem_runtime_parser.py | Extended RuntimeRossystem with configuration options and launch mapping support |
| ros2model/api/runtime_parser/rosmodel_runtime_parser.py | Added ROS distribution detection and improved parameter handling compatibility |
| ros2model/api/model_generator/message_generator.py | Fixed template path resolution for message generation |
| README.md | Updated documentation with clearer installation and usage instructions |
| .pre-commit-config.yaml | Updated tool versions for code quality checks |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| {% set collected.pub = collected.pub + [{'topic': interface.full_name, 'display': interface.name, 'type': interface.type, 'node': node_identifier}] %} | ||
| - "{{ interface.name }}": pub-> "{{ exec_name }}::{{ interface.name }}" | ||
| {% endfor %} | ||
| {% for interface in node.subscriber %} | ||
| {% if interface.name in publisher_names %} | ||
| {% set sub_display = 'sub_' ~ interface.name %} | ||
| {% else %} | ||
| {% set sub_display = interface.name %} | ||
| {% endif %} | ||
| {% set collected.sub = collected.sub + [{'topic': interface.full_name, 'display': sub_display, 'type': interface.type, 'node': node_identifier}] %} | ||
| - "{{ sub_display }}": sub-> "{{ exec_name }}::{{ interface.name }}" | ||
| {% endfor %} | ||
| {% for interface in node.actionserver %} | ||
| {% set collected.action_server = collected.action_server + [{'topic': interface.full_name, 'display': interface.name, 'type': interface.type, 'node': node_identifier}] %} | ||
| - "{{ interface.name }}": as-> "{{ exec_name }}::{{ interface.name }}" | ||
| {% endfor %} | ||
| {% for interface in node.actionclient %} | ||
| {% set collected.action_client = collected.action_client + [{'topic': interface.full_name, 'display': interface.name, 'type': interface.type, 'node': node_identifier}] %} | ||
| - "{{ interface.name }}": ac-> "{{ exec_name }}::{{ interface.name }}" | ||
| {% endfor %} | ||
| {% for interface in node.serviceserver %} | ||
| {% set collected.srv_server = collected.srv_server + [{'topic': interface.full_name, 'display': interface.name, 'type': interface.type, 'node': node_identifier}] %} | ||
| - "{{ interface.name }}": ss-> "{{ exec_name }}::{{ interface.name }}" | ||
| {% endfor %} | ||
| {% for interface in node.serviceclient %} | ||
| {% set collected.srv_client = collected.srv_client + [{'topic': interface.full_name, 'display': interface.name, 'type': interface.type, 'node': node_identifier}] %} | ||
| - "{{ interface.name }}": sc-> "{{ exec_name }}::{{ interface.name }}" |
Copilot
AI
Oct 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The subscriber display name logic creates potential naming conflicts. Consider using a more robust naming scheme that ensures uniqueness, such as incorporating the interface type or a counter.
| {% endfor %} | ||
| {% endfor %} | ||
| {% endif %} | ||
| {% if model.actions()|length > 0 %} |
Copilot
AI
Oct 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This condition should check model.services()|length > 0 instead of model.actions()|length > 0 based on the original logic. The actions section should remain separate from the services condition.
This pull request introduces several improvements and refactorings to the ROS 2 model extraction toolchain, focusing on compatibility, usability, and maintainability. The most significant changes include enhanced runtime parsing for ROS distributions, improved handling of node and system model generation, and updates to documentation and configuration for modern ROS 2 practices.
Runtime compatibility and refactoring:
rclpy.parameter_client.AsyncParameterClientand legacyros2param.apimethods, improving compatibility across ROS 2 Humble and Rolling. [1] [2] [3] [4] [5]Node and system model generation enhancements:
RunTimeNodeandRuntimeRossystemclasses to store package/executable information and apply launch file mappings for more accurate model extraction, including new options for hidden nodes, interfaces, and robot descriptions. [1] [2] [3] [4]Documentation and usability improvements:
README.mdto clarify installation for ROS 2 Humble/Rolling, provide explicit instructions for generating node, system, and interface models, and document new command-line options and usage patterns. [1] [2]Configuration and template updates:
.pre-commit-config.yamlfor improved code quality checks.message_generator.pyto ensure correct template selection and compatibility.