Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug of traci.vehicle.moveTo and traci.vehicle.moveToVTD #1

Open
KailinTong opened this issue Jun 8, 2018 · 2 comments
Open

Bug of traci.vehicle.moveTo and traci.vehicle.moveToVTD #1

KailinTong opened this issue Jun 8, 2018 · 2 comments

Comments

@KailinTong
Copy link

Hello,

I tried traci.vehicle.moveTo with different position parameters, but the car simply did not move.

And when I ran traci.vehicle.moveToVTD, it had an error:

The class traci.constants has no Constant property or Static method named 'VAR_MOVE_TO_VTD'.

Error in traci.vehicle.moveToVTD (line 12)
traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_MOVE_TO_VTD,...

@shuowang572875852
Copy link

Hello,
I want to get the leader and follower vehicle acceleration in the target lane .So ,first I add traci.vehicle.subscribeContext
to get ego vehicle context information ,and then I add traci.vehicle.getContextSubscriptionResults(egoID) to get the surround vehicle ID, but the output “ans” is 1*1Map ,the follow is my code:

clear
close all
clc

import traci.constants
scenarioPath=['F:\software\SUMO配置文件\bin\quickstart\quickstart.sumocfg'];
system(['sumo-gui -c ' '"' scenarioPath '"' ' --remote-port 8813 --start&']);
traci.init

SIM_STEPS = [1 900];
beginTime = SIM_STEPS(1);
duration = SIM_STEPS(2);
endTime = SIM_STEPS(1) + SIM_STEPS(2) - 1;

for i = 1:duration
traci.simulation.step();
IDList{i,1} = traci.vehicle.getIDList();
for j=1:length(IDList{i,1})
accel{i,1}(j)=traci.vehicle.getAcceleration(char(IDList{i,1}(1:end,j)));
laneID{i,1}=traci.vehicle.getLaneID(char(IDList{i,1}(1:end,j)));
traci.vehicle.subscribeContext(char(IDList{i,1}(1:end,j)), traci.constants.CMD_GET_VEHICLE_VARIABLE,150,{traci.constants.VAR_POSITION, traci.constants.VAR_SPEED});
traci.vehicle.addSubscriptionFilterLeadFollow('1');
contextSubscriptionResults=traci.vehicle.getContextSubscriptionResults(char(IDList{i,1}(1:end,j)));
end
end
traci.close()

Can you give me some help and looking forward to your reply.

@skchada
Copy link

skchada commented Nov 21, 2019

Hello,

I have got the same error as mentioned above when I ran traci.vehicle.moveToVTD:

The class traci.constants has no Constant property or Static method named 'VAR_MOVE_TO_VTD'.

I checked that the 'VAR_MOVE_TO_VTD' is not present in traci.constants

Can you please help me out, how to solve this issue?

Best regards,
Sai Krishna

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants