1、rosbag play filename.bag /foo:=/bar foo是原始topic,bar是要变成的目标topic
2、在launch文件中更改,使用remap功能(remap的 ROS官方文档)
<remap from="chatter" to="hello"/>
一个实用例子:
<launch>
<node pkg="test" type="talker" name="talker" output="screen">
<!--talker节点发布的topic为/chatter-->
<!--将talker节点发布的话题/chatter映射到/hello的名字上-->
<remap from="/chatter" to="/hello" />
</node>
</launch>
参考链接: