我试图从主类commander.py
初始化一个类ModuleLMPC
。我得到以下错误
File "D:\CARLA\PythonAPI\examples\fnc\commander.py", line 89, in __init__
self.LMPC = ModuleLMPC(self.dt, self.LapTime, self.maxLaps, self.Map)
TypeError: 'module' object is not callable
我将^{cd1>}导入为:
from ModuleLMPC import ModuleLMPC
我正在尝试从ModuleLMPC.py
文件导入ModuleLMPC
。他们有相同的名字。
前几行ModuleLMPC
看起来像:
from SysModel import Simulator, PID
from Classes import ClosedLoopData, LMPCprediction
from PathFollowingLTVMPC import PathFollowingLTV_MPC
from PathFollowingLTIMPC import PathFollowingLTI_MPC
from LMPC import ControllerLMPC
from Utilities import Regression
import numpy as np
import pdb
import pickle
class ModuleLMPC(object):
def __init(self, dt, Time, maxlaps, map):
# ======================================================================================================================
# ============================ Choose which controller to run ==========================================================
# ======================================================================================================================
self.RunPID = 1
self.RunMPC = 1
我将{
self.LMPC = ModuleLMPC(self.dt, self.LapTime, self.maxLaps, self.Map)
我甚至把所有东西都放在了同一个文件夹里。我不知道这个错误是什么意思
目前没有回答
相关问题 更多 >
编程相关推荐