ros_sugar.robot.ros_outputs#
Publishing plugin feedback on ROS.
Feedback decoded from a non-ROS transport lives on the plugin feedback bus,
where components read it. A stock ROS node the plugin starts cannot: it
subscribes to ROS topics. FeedbackRosOutputs publishes that feedback on the
topics such nodes read, from the plugin host’s own node, and broadcasts TF for a
feedback that declares publish_tf. What to publish, and where, comes from
ProcessSpec.inputs.
The host’s node is not usable when the host opens. The launcher hands over the Monitor, whose rclpy node is only initialized once the launch system runs it, after every plugin is attached. Publishers are therefore created on the first message decoded after the node is up. Messages decoded before then are dropped: nothing can have subscribed to them yet.
Module Contents#
Classes#
The ROS topics, and TF, one plugin host publishes its feedback on. |
API#
- class ros_sugar.robot.ros_outputs.FeedbackRosOutputs(node: Any)#
The ROS topics, and TF, one plugin host publishes its feedback on.
Called from the transports’ receive threads, so nothing here raises: a failed output is logged and dropped, and the feedback bus is unaffected.
- Parameters:
node – The host’s rclpy node.
Nonein standalone and test hosts, where nothing is published and that is said once.
- add(feedback: ros_sugar.robot.feedback.Feedback, topic: str) None#
Publish
feedbackontopictoo. Call before any message flows.
- property topics: Dict[str, List[str]]#
Feedback key -> ROS topics it is published on.
- publish(feedback: ros_sugar.robot.feedback.Feedback, msg: Any) None#
Publish one decoded message wherever its feedback is wanted on ROS.
- close() None#
Release the publishers. Nothing is published afterwards.