eclipse-sumo / sumo

Eclipse SUMO is an open source, highly portable, microscopic and continuous traffic simulation package designed to handle large networks. It allows for intermodal simulation including pedestrians and comes with a large set of tools for scenario creation.
https://eclipse.dev/sumo
Eclipse Public License 2.0
2.55k stars 1.43k forks source link

what's the parameters in traci.vehicle.setstop accurately refers to ? #6872

Closed xiang-zhe closed 4 years ago

xiang-zhe commented 4 years ago

the description is like: Lets the vehicle stop at the given edge, at the given position and lane. The vehicle will stop for the given duration. Re-issuing a stop command with the same lane and position allows changing the duration. Setting the duration to 0 cancels an existing stop. and the define like:

setStop(self, vehID, edgeID, pos=1.0, laneIndex=0, duration=-1073741824.0, flags=0, startPos=-1073741824.0, until=-1073741824.0)
setStop(string, string, double, integer, double, integer, double, double) -> None

Adds or modifies a stop with the given parameters. The duration and the until attribute are
in seconds.

for vehID, edgeID, laneIndex..., they are easy to understood; bur for i can't know "pos" exactly, is it mean the "endpos"? or "length of lane"; in fact, for startpos, refer to the start pos of stoparea in lane; and i get a error like:

Error: Answered with error to command 0xc4: stop for vehicle 'el_1507' on lane ':1634975412_5_0' has an invalid position.
Error: tcpip::Socket::recvAndCheck @ recv: peer shutdown
Quitting (on error).

but i ddn't found the description for the params of setstop? any helps? thanks

m-kro commented 4 years ago

I think "pos" corresponds to "endpos" in the SUMO docs. Did you choose a position beyond the lane length? What does happen if you call setStop whithout specifying "startPos"?

xiang-zhe commented 4 years ago

@m-kro thank you,the same err when whithout specifying "startPos" or whithout specifying "Pos"; no err when whithout specifying both, but i didn't think it's the result that i wanted; additonally, i saw pos corresponds to "startpos" in e2 detector

<additional>
   <laneAreaDetector id="<ID>" lanes="<LANE_ID1> <LANE_ID2> ... <LANE_IDN>" 
   pos="<START_POSITION_ON_FIRST_LANE>" endPos="<END_POSITION_ON_LAST_LANE>" 
   friendlyPos="<BOOL>" freq="<AGGREGATION_TIME>" file="<OUTPUT_FILE>" 
   timeThreshold="<FLOAT>" speedThreshold="<FLOAT>" jamThreshold="<FLOAT>"
   tl="<TRAFFIC_LIGHT_ID>"  to="<LANE_ID>"/>  
</additional>
namdre commented 4 years ago

pos is the default position where the vehicle stops (corresponding to the 'endPos' attribute in an xml stop definition). The default value for pos is 1 which may be invalid if the lane is shorter than 1m. This can easily happen for an internal lane (lane id starts with ':').