不支持 TraCI API 版本,建议使用 Sumo 版本 1.0.1 或 0.32.0

Unsupported TraCI API version, recommend using Sumo version 1.0.1 or 0.32.0

我想在 Ubuntu 20.04 中将 OMNeT++ 与 Veins 5.1、Sumo 1.8 一起使用,但我一直收到有关建议使用 Sumo 0.32 或 Sumo 1.0.1 的 setApiVersion 的错误。有什么方法可以克服这个问题并使用更高版本的 Sumo 吗?

void TraCICommandInterface::setApiVersion(uint32_t apiVersion)
{
    try {
        versionConfig = versionConfigs.at(apiVersion);
        TraCIBuffer::setTimeType(versionConfig.timeType);
    }
    catch (std::out_of_range const& exc) {
        throw cRuntimeError(std::string("TraCI server reports unsupported TraCI API version: " + std::to_string(apiVersion) + ". We recommend using Sumo version 1.0.1 or 0.32.0").c_str());
    }
}

在我的例子中,代码是为 SUMO 和 Veins 的早期版本编写的。 cc 文件使用了不同的命名空间声明,使用驼峰式而不是小写。更改为小写后,代码在 Sumo 1.8 和 Veins 5.1 中正常运行。