You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
Sorry to bother you,I want to add some new functions to traci4matlab in the same way as traci-python: such as getNeighbors(vehID, mode).
1、I add VAR_NEIGHBORS = '0xbf' to constants.m
2、add traci.constants.VAR_NEIGHBORS,... and {'traci.vehicle.readNeighbors'} to RETURN_VALUE_FUNC.m
3、write readNeighbors.m
function [vehID, dist] = readNeighbors(result)
%读取周围车辆相关信息
N=result.readInt();
neighs = [];
for i =1:N
vehID = result.readString();
dist = result.readDouble();
neighs.append(vehID,dist);
end
But when i run getNeighbors.m , the matlab commandline get follow errors:
error use traci.sendExact (line 46)
64 164 255 Error Get Vehicle Variable: unsupported variable 0xbf specified
The sumo-gui error:
Error: Answered with error to command 0xa4: Get Vehicle Variable: unsupported variable 0xbf specified
So how can i do for it ?Can you give me some help?Looking forward to your reply.
The text was updated successfully, but these errors were encountered:
Hello,
Sorry to bother you,I want to add some new functions to traci4matlab in the same way as traci-python: such as getNeighbors(vehID, mode).
1、I add VAR_NEIGHBORS = '0xbf' to constants.m
2、add traci.constants.VAR_NEIGHBORS,... and {'traci.vehicle.readNeighbors'} to RETURN_VALUE_FUNC.m
3、write readNeighbors.m
function [vehID, dist] = readNeighbors(result)
%读取周围车辆相关信息
N=result.readInt();
neighs = [];
for i =1:N
vehID = result.readString();
dist = result.readDouble();
neighs.append(vehID,dist);
end
function [vehicleID, dist] = getNeighbors(vehID, mode)
import traci.constants
global message
traci.beginMessage(constants.CMD_GET_VEHICLE_VARIABLE,constants.VAR_NEIGHBORS,...
vehID, 2);
message.string = [message.string uint8(sscanf(constants.TYPE_UBYTE,'%x'))...
uint8(mode)];
[vehicleID, dist] = traci.vehicle.readNeighbors(traci.checkResult(...
constants.CMD_GET_VEHICLE_VARIABLE, constants.VAR_NEIGHBORS, vehID));
But when i run getNeighbors.m , the matlab commandline get follow errors:
error use traci.sendExact (line 46)
64 164 255 Error Get Vehicle Variable: unsupported variable 0xbf specified
The sumo-gui error:
Error: Answered with error to command 0xa4: Get Vehicle Variable: unsupported variable 0xbf specified
So how can i do for it ?Can you give me some help?Looking forward to your reply.
The text was updated successfully, but these errors were encountered: