You must call ros::init() before creating the first NodeHandle
[复制链接]
ubuntu 16.04 ros. 运行出现
You must call ros::init() before creating the first NodeHandle
Couldn't find an AF_INET address for []
main函数中。ros::init在ros::NodeHandle 之前。
找其他地方。
main函数外。有一个 image_transport::TransportHints 创建对象的语句。把它放到main里面,就不再出现错误。
看TransportHints的实现。ros::NodeHandle作为了函数的参数。于是运行时,先创建对象,发生冲突。
此内容由EEWORLD论坛网友ienglgge原创,如需转载或用于商业用途需征得作者同意并注明出处
|