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)
- Feature Request for MultiProcessExecutor HOT 2
- async wait/sleep implementation HOT 4
- KeyError in ActionServer._execute_goal HOT 5
- [Feature] Static Type Checking With ament_mypy HOT 1
- Added optional TimerInfo to timer callback
- :farmer: `test_guard_condition` failing consisntent in CycloneDDS HOT 2
- Add utility function to get datetime.datetime from Time HOT 1
- Decode ROS2 raw byte data using rclpy.serialization.deserialize_message HOT 3
- Rate object's destroy() does not destroy the underlying Timer object, leading to CPU usage explosion HOT 6
- Update the executor to not throw ExternalShutdownException
- Make nodes, publishers, subscriptions, services, clients, action servers, action clients Python context managers
- aarch64 cross compiling HOT 9
- Executors mishandle invalid waitables HOT 4
- context.on_shutdown is never called HOT 7
- Bad interaction between `torch.compile` and `MultiThreadedExecutor` HOT 1
- First Time Contributors Documentation (CONTRIBUTING.md) HOT 2
- Python message with uint32 Assertion `PyLong_Check(field)' failed HOT 2
- Memory leak in ActionServer. ```taken_data = self._handle.take_goal_request``` HOT 4
- [Bug] error when node created with rclpy.node.Node HOT 1
- Async tasks are processed in LIFO not FIFO HOT 4
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.