[ROS2] Is it possible to listen and subscribe to newly created topic in C++?
Not sure if it's possible programmatically.
ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
Not sure if it's possible programmatically.
Yes, you can dynamically create new subscriptions in c++ at run time.
Use the create_subscription
method on Node
Sure. You can get the list of topics and their types that have been discovered at any time from the API.
See http://docs.ros2.org/latest/api/rclcp... (search for “introspecting the ROS graph”)
Use the api linked above in the comment to get the list of topics and their types before you call create subscription. Or know through some other means what type you're expecting. The callback must match the type too so you're going to need to have an idea about the type beforehand anyway.
Asked: 2019-08-08 14:27:21 -0500
Seen: 1,081 times
Last updated: Aug 08 '19
ROS2 Only able to run built packages from install/
ROS in arm/v7, Docker, and Limited Storage Robot
subscription callback types ROS1 vs. ROS2
Ros 2 command line service call with array of custom msg
Using Kinect 360 in ROS 2 Foxy
[ROS2] using dynamic parameters in Python
Colcon test not running gtests
What went wrong with the installation?
[ROS2 Humble]: Error building the package: joint_trajectory_controller