ubuntu18.04 sumo安装 及 traci通信

1. 安装

来源:https://sumo.dlr.de/docs/Downloads.html

sudo add-apt-repository ppa:sumo/stable
sudo apt-get update
sudo apt-get install sumo sumo-tools sumo-doc

添加环境变量

gedit  ~/.bashrc

文本后加: 

exprot SUMO_HOME= '/usr/share/sumo/tools'

2.  python 代码在导入 traci 之前,添加以下代码:

import sys,os,subprocess
sys.path.append('/usr/share/sumo/tools') #import traci,sumolib
sumoBinary = "/usr/bin/sumo" #sumo or sumo-gui connection

import traci
发布了36 篇原创文章 · 获赞 0 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/weixin_38102912/article/details/103202607