ROS话题工具Topic Tool

throttle —— 节流阀

http://wiki.ros.org/topic_tools/throttle

throttle is a ROS node that subscribes to a topic and republishes incoming data to another topic, either at a maximum bandwidth or maximum message rate. It’s mainly useful for limiting bandwidth usage, e.g., over a wireless link. It can work with any message type.

功能:
订阅到一个现有节点,将进来的数据转化成另一个话题,常见的是 话题名_throttle,
注意,原来的话题正常发布不会改变,多了一个调整过的话题, 默认为intopic_throttle!

  1. 改变频率
# throttle messages <intopic> <msgs_per_sec> [outtopic]
rosrun topic_tools throttle messages base_scan 1.0

message 指代了修改话题发布消息的频率,不可替换。
【output】 可以不加指定

  1. 改变数据量bytes(bandwidth)
# throttle bytes <intopic> <bytes_per_sec> <window> [outtopic]
rosrun topic_tools throttle bytes base_scan 1024 1.0

relay —— 继电器(转播)

relay is ROS node that subscribes to a topic and republishes all incoming data to another topic. It can work with any message type.

rosrun topic_tools relay base_scan my_base_scan

注意: 原来话题不变;增加一个输出话题,默认为 intopic_relay;
相当于话题映射工具

drop —— 降低,终止
drop is a ROS node that can subscribe to a topic and republish incoming data to another topic, dropping X out of every Y incoming messages. It’s mainly useful for limiting bandwidth usage, e.g., over a wireless link. It can work with any message type.

功能: 从订阅的话题每Y条消息,扔掉X条,减小数据量

rosrun topic_tools drop base_scan 1 2

transform —— 转换

transform is a ROS node that subscribes to a topic, or a topic field, and publishes incoming data to another topic, after applying a given Python expression. It’s mainly useful for simple message transformation, like computing the norm of a vector or quaternion, or even converting a quaternion to Euler angles. It can work with any message type.

# transform <input> <output_topic> <output_type> [<expression>] [--import <module> [<module> ...]]
rosrun topic_tools transform /imu/orientation /norm std_msgs/Float64 'numpy.linalg.norm([m.x, m.y, m.z, m.w])'

用于简单的运算,还是直接写节点吧

猜你喜欢

转载自blog.csdn.net/qq_35508344/article/details/80361271