用rosbag这个类读取bag包里的数据,程序编译没错,运行的时候报错:
all processes on machine have died, roslaunch will exit
std::vector<std::string> topics;
topics.push_back("/odom");
topics.push_back("/scan");
之前报错是因为odom和scan前面没加/, 加了以后就没有报错了。
(之前用std:: string scan_topic = "/scan"; topics.push_back(scan_topic);好像也报错)