Hi Robbin,

Thanks for your answer. However, specifying the lane with its string identifier 
is not working for me. Did you actually insert a vehicle in an edge other than 
the first one of the route?

The following call works, inserting the vehicle on lane 1 (2nd one) of the 
first edge in the route:

traci.vehicle.add('block', routes[0], depart=0, pos=20, speed=0,lane=1)

However, if I specify the lane with a string, so that I can insert it to an 
edge other than the first one, with:

traci.vehicle.add('block', routes[0], depart=0, pos=20, speed=0,lane='AtoB_1')

I get the following error:

Traceback (most recent call last):
 [omitted]
  File "c:\XXXXXX\sumo-0.23.0\tools\traci\vehicle.py", line 874, in add
    traci._message.string += struct.pack("!BB", tc.TYPE_BYTE, lane)
struct.error: cannot convert argument to integer

Looking into traci\vehicle.py in the add method, there is:

traci._message.string += struct.pack("!BB", tc.TYPE_BYTE, lane)

so it seems that it is actually expecting "lane" to be an integer (i.e. 
TYPE_BYTE) and not a TYPE_STRING.

If tried to use addFull, since the parameters are string:

traci.vehicle.addFull('block', routes[0], departPos="20", 
departSpeed="0",departLane='AtoB_1')

but then I get the following error regarding the "departLane":

traci.TraCIException: Invalid departLane definition for vehicle 'block';
 must be one of ("random", "free", "allowed", "best", "first", or an int>=0)

Any way around it?

Thanks


Didac Busquets PhD
Senior Technologist

Transport Systems Catapult
3rd Floor, The Pinnacle
170 Midsummer Boulevard
Milton Keynes
MK9 1BP

Tel:  +44 (0)1908 359999 Ext: 1126
Email: [email protected]
Web: ts.catapult.org.uk

To learn more about the Transport Systems Catapult, watch our video



-----Original Message-----
From: Robbin Blokpoel [mailto:[email protected]]
Sent: 09 July 2015 16:36
To: Didac Busquets; [email protected]
Subject: RE: Adding a vehicle at a given edge/lane/position

Hi Didac,

I recently used this Traci command. The whole command specification includes a 
position and laneID as well, so you can just specify which lane you want the 
vehicle to start (a lane is even more precise than an edge, when an edge has 
multiple lanes). The route is needed by SUMO so it knows where the vehicle has 
to go after it leaves the lane where you injected it.
http://sumo.dlr.de/wiki/TraCI/Add_Vehicle

Regards,

Robbin Blokpoel MSc.
Senior Traffic Engineering Researcher
T. +31 33 454 1731  | M. +31 6 2940 9806 | E. [email protected]


-----Original Message-----
From: Didac Busquets [mailto:[email protected]]
Sent: donderdag 9 juli 2015 17:18
To: [email protected]
Subject: [sumo-user] Adding a vehicle at a given edge/lane/position

Hi,

I'd like to add a vehicle (to simulate a lane block) to a given position of a 
given lane of a given edge.

I've seen that TraCI has the vehicle.add(...) method, but it only mentions 
routeID, not edgeID.

How can I do so?

Thanks,

                Didac



Didac Busquets PhD
Senior Technologist

Transport Systems Catapult
3rd Floor, The Pinnacle
170 Midsummer Boulevard
Milton Keynes
MK9 1BP

Tel:  +44 (0)1908 359999 Ext: 1126
Email: 
[email protected]<mailto:[email protected]>
Web: ts.catapult.org.uk<http://ts.catapult.org.uk/>

To learn more about the Transport Systems Catapult, watch our 
video<http://bit.ly/TSCVideo>

[cid:[email protected]]

The Transport Systems Catapult is one of a network of elite technology and 
innovation centres established by Innovate UK as a long-term investment in the 
UK's economic capability. Applying business-led research, Catapults help 
businesses transform great ideas into valuable products and services to compete 
in the global markets of tomorrow. Transport Systems Catapult is a company 
limited by guarantee, registered in England and Wales with company number 
08041919. Registered office: The Pinnacle, Midsummer Boulevard, Milton Keynes, 
Bucks, MK9 1BP. This email and any attachments are confidential and intended 
solely for the use of the recipient(s) to whom they are addressed. If you have 
received it in error, please destroy all copies and inform the sender.
The Transport Systems Catapult is one of a network of elite technology and 
innovation centres established by Innovate UK as a long-term investment in the 
UK’s economic capability. Applying business-led research, Catapults help 
businesses transform great ideas into valuable products and services to compete 
in the global markets of tomorrow. Transport Systems Catapult is a company 
limited by guarantee, registered in England and Wales with company number 
08041919. Registered office: The Pinnacle, Midsummer Boulevard, Milton Keynes, 
Bucks, MK9 1BP. This email and any attachments are confidential and intended 
solely for the use of the recipient(s) to whom they are addressed. If you have 
received it in error, please destroy all copies and inform the sender.
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
sumo-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sumo-user

Reply via email to