Thanks for the clarification, I didn't realise that.

However that doesn't help me with my problem ;)

If I can't use setRoute(), and setStop() by itself also fails, how do I
make a vehicle just stop where it is?

On Mon, Nov 21, 2016 at 8:17 PM, sumo.mahei <[email protected]>
wrote:

> From:
>
> "
> http://www.sumo.dlr.de/wiki/TraCI/Change_Vehicle_State#
> Command_0xc4:_Change_Vehicle_State
>
> change route (0x57) stringList (ids of edges to pass) Assigns the list of
> edges as the vehicle's new route assuming the first edge given is the one
> the vehicle is curently at(1)(2).
>
> Please note:
>
>    1. The first occurrence of the edge is currently at is searched within
>    the new route; the vehicle continues the route from this point in the route
>    from. If the edge the vehicle is currently does not exist within the new
>    route, an error is generated.
>    2. changing the route works only if the vehicle is not within an
>    intersection.
>
> "
>
> -> caused a horrible night hunting the bug years ago.
>
> Best
> Marek Heinrich
> simoserv GmbH
>
> Am 21.11.2016 um 19:03 schrieb Green Mind:
>
> Doesn't seem right, could be the cause for the bug?
>
> >>> traci.vehicle.getRoute('13')
> ['L16', 'L162', 'L11', 'L1', 'D1', 'L19', 'D4', 'L4', 'L14', 'L16',
> 'L162', 'L11', 'L1', 'D1', 'L19', 'D4', 'L4', 'L14', 'L16', 'L162', 'L11',
> 'L1', 'D1', 'L19', 'D4', 'L4', 'L14', 'L16', 'L162', 'L11', 'L1', 'D1',
> 'L19', 'D4', 'L4', 'L14', 'L16', 'L162', 'L11', 'L1', 'D1', 'L19', 'D4',
> 'L4', 'L14', 'L16', 'L162', 'L11', 'L1', 'D1', 'L19', 'D4', 'L4', 'L14',
> 'L16', 'L162', 'L11', 'L1', 'D1', 'L19', 'D4', 'L4', 'L14', 'L16', 'L162',
> 'L11', 'L1', 'D1', 'L19', 'D4', 'L4', 'L14', 'L16', 'L162', 'L11', 'L1',
> 'D1', 'L19', 'D4', 'L4', 'L14', 'L16', 'L162', 'L11', 'L1', 'D1', 'L19',
> 'D4', 'L4', 'L14']
> >>>
> >>> traci.vehicle.setRoute('13',['L14'])
> >>>
> >>> traci.vehicle.getRoute('13')
> ['L16', 'L162', 'L11', 'L1', 'D1', 'L19', 'D4', 'L4', 'L14']
> >>>
> >>> traci.vehicle.setStop('13',"L14")
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "C:\Program Files (x86)\DLR\Sumo\tools\traci\_vehicle.py", line
> 594, in setStop
>     self._connection._sendExact()
>   File "C:\Program Files (x86)\DLR\Sumo\tools\traci\connection.py", line
> 109, in _sendExact
>     raise TraCIException(prefix[1], _RESULTS[prefix[2]], err)
> traci.exceptions.TraCIException: Stop for vehicle '13' on lane 'L14_0' is
> not downstream the current route.
>
> On Mon, Nov 21, 2016 at 3:43 PM, sumo.mahei <[email protected]>
> wrote:
>
>> What does :
>>
>> traci.vehicle.getRoute('13')
>>
>> return before and after setting the route?
>>
>> don't forget the speed down the vehicle - else wise it might
>> pass the stop point in the next sim step.
>>
>> Best
>> Marek Heinrich
>> simoserv GmbH
>>
>> Am 21.11.2016 um 14:39 schrieb Green Mind:
>>
>> Thanks, but that doesn't work unfortunately - still getting the same
>> error.
>>
>> On Mon, Nov 21, 2016 at 2:15 PM, sumo.mahei < <[email protected]>
>> [email protected]> wrote:
>>
>>> Hi,
>>>
>>> maybe it's because of the wrong lane number.
>>>
>>> traci.vehicle.getLaneID('13')
>>> lane_index = traci.vehicle.getLaneIndex('13')
>>> traci.vehicle.setRoute('13',['L14'])
>>> traci.vehicle.setStop('13','L14', laneIndex=lane_index)
>>>
>>> Best Marek Heinrich
>>> simoserv GmbH
>>>
>>> Am 21.11.2016 um 13:02 schrieb Green Mind:
>>>
>>>> I'm trying to make a vehicle stop where it is. I do this by checking the
>>>> vehicle's current edge, then modifying the route to contain only that
>>>> edge,
>>>> then add a stop in that edge.
>>>>
>>>> However, this throws an error. What am I doing wrong?
>>>>
>>>> traci.vehicle.getLaneID('13')
>>>>>>>
>>>>>> 'L14_2'
>>>>
>>>> traci.vehicle.setRoute('13',['L14'])
>>>>>>> traci.vehicle.setStop('13','L14')
>>>>>>>
>>>>>> Traceback (most recent call last):
>>>>    File "<stdin>", line 1, in <module>
>>>>    File "C:\Program Files (x86)\DLR\Sumo\tools\traci\_vehicle.py",
>>>> line 594,
>>>> in setStop
>>>>      self._connection._sendExact()
>>>>    File "C:\Program Files (x86)\DLR\Sumo\tools\traci\connection.py",
>>>> line
>>>> 109, in _sendExact
>>>>      raise TraCIException(prefix[1], _RESULTS[prefix[2]], err)
>>>> traci.exceptions.TraCIException: *Stop for vehicle '13' on lane
>>>> 'L14_0' is
>>>> not downstream the current route.*
>>>>
>>>> TIA
>>>> ------------------------------------------------------------
>>>> ------------------
>>>> _______________________________________________
>>>> sumo-user mailing list
>>>> [email protected]
>>>> https://lists.sourceforge.net/lists/listinfo/sumo-user
>>>>
>>>
>>>
>>
>>
>
>
------------------------------------------------------------------------------
_______________________________________________
sumo-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sumo-user

Reply via email to