首页 > 解决方案 > 不支持的 TraCI API 版本,建议使用 Sumo 版本 1.0.1 或 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());
    }
}

标签: omnet++veinssumo

解决方案


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


推荐阅读