【发布时间】:2019-03-20 19:33:32
【问题描述】:
我正在尝试获取机器人/扫描事件通知。 它对我有用:
// Subscribe to the simulated robot's laser scan topic
laserSub = nh.subscribe("/scan", 1, &MyObject::scanCallback, this);
但是当我将主题更改为 my_robot_name/scan 时,它不起作用:我的回调没有收到任何机器人扫描通知。
// Subscribe to the simulated robot's laser scan topic
laserSub = nh.subscribe(my_robot_name + "/scan", 1, &MyObject::scanCallback, this);
我运行“rostopic info my_robot_name/scan”,看起来根本没有 my_robot_name/scan 的发布者。
我该如何解决这个问题? 提前致谢。
【问题讨论】: