Comments (7)
Hi, community. Do we have any detailed thoughts or designs on this feature? I would like to help
from rclpy.
@crystaldust thanks for taking it up!
I think @dirk-thomas is asking for a method to get the name of a publisher after all remap rules have been applied. I think that means adding a resolved_name()
method to the publisher class that internally calls the C function rcl_publisher_get_topic_name()
. It will need a method added to the rclpy
CPython extension. I think rclpy_get_publisher_logger_Name()
would be a good function that could be studied/copied/adapted for this.
rclpy/rclpy/src/rclpy/_rclpy.c
Lines 5443 to 5446 in 044ff46
rclpy/rclpy/src/rclpy/_rclpy.c
Lines 919 to 946 in 044ff46
Though, that doesn't show the final pure-python step. For that you can look at assert_livelines()
:
rclpy/rclpy/rclpy/publisher.py
Lines 87 to 95 in 044ff46
from rclpy.
Thanks @sloretz ! I'll look into the code and try, the info is really helpful.
from rclpy.
Hi, @sloretz , I've made a basic implementation on the resolved_name
method to call rcl_publisher_get_topic_name()
, code here.
Btw, I made a test to run a node with remapping rules calling ros2 run PKG_NAME EXECUTABLE_NAME --ros-args -r FROM:=TO
on topics, it also works.
I see there is a ros2 component design, as I understand, the component is a specific node which is loaded into a container and can receive the remapping rules at runtime, but I'm not able to find some rclpy examples to test it, for now, there is only a composition example which is in cpp and calls a RCLCPP_COMPONENTS_REGISTER_NODE
macro, and I can't find equivelent things on rclpy project. But the container/component mechanism seems to be implemented in rcl, topic names are updated in rcl lib when the remapping rules are being applied, so calling rcl_publisher_get_topic_name
should always work. Is there some demos for rclpy component that I can work with to make a test?
from rclpy.
Hi, @sloretz , I've made a basic implementation on the resolved_name method to call rcl_publisher_get_topic_name(), code here.
Fantastic 🎉
Mind opening a pull request? Then I will be able to use Github's UI to give feedback :)
Is there some demos for rclpy component that I can work with to make a test?
Not that I'm aware of. You're right there is a design for composition that was designed to allow composing Python nodes, but I don't think anyone has written a Python composable node container.
from rclpy.
I've opened the PR #568
from rclpy.
Fixed by @crystaldust in #568 🎉
from rclpy.
Related Issues (20)
- rclpy throws an exception when it is interrupted - rclpy.executors.ExternalShutdownException HOT 11
- Cannot set parameter through SetParameters HOT 1
- Clock documentation missing (rolling, iron) HOT 1
- `wait_for_message` sporadically fails on a msg_info that is None HOT 1
- StaticSingleThreadedExecutor HOT 3
- wait_for_message Accumulating CPU Load After Repeated Calls HOT 11
- Service client sometimes deadlock due to 'client will not receive response' of newly launched service server node HOT 9
- Log files are given base name `python3....` instead of node name HOT 3
- Humble has higher CPU usage compared to Foxy HOT 15
- Service Client wait_for_service incorrectly returns True HOT 4
- Ros2 Humble is installed on the Ubuntu 22.04 but I get error for no module named rclpy._rclpy_pybind11 while the package is installed (also rclpy is installed for Python 3.10 not Python 3.11) HOT 7
- Exception when instantiating ActionServer as part of ROS package tests HOT 2
- CMake Error (Non-existent Path) When Building From Source HOT 4
- Cannot log in ROS2 node after building with cython HOT 6
- ReadtheDocs page is missing a lot of documentation for API. HOT 5
- SIGINT signal on parent not terminated Turtlesim GUI application HOT 1
- ros2 topic HZ option is not predictable for report freq values when using default rmw_fastrtps_cpp rmw implementation HOT 3
- MultiThreadExecutor may throw exception after destroying subscription with non-default callback group
- Failed to send request: cannot publish data HOT 5
- Lifecycle node `Transition is not registered` exception kills 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 rclpy.