Re: [sumo-user] moveToXY change position

2020-11-01 Thread Jakob Erdmann
Moving the vehicle beyond the road boundary should work if and only if the
second bit of the keepRoute flag is set (i.e. keepRoute=2).
However, to make a vehicle park it is recommended to set a stop with
attribute parking=True instead.

Am Do., 22. Okt. 2020 um 05:08 Uhr schrieb 謝昀宸 :

> Dear Sumo team,
> I want to park the vehicle on the side of the edge.
> When the vehicle is parked in the middle of the road, use moveToXY to
> fine-tune the position of the vehicle to the far right side of the road.
>
> But when the vehicle touches the edge of the road, it will automatically
> adjust its position,  just like the attached gif.
>
> I tried various parameters of Keeproute, but it still does not improve
>
> ___
> sumo-user mailing list
> sumo-user@eclipse.org
> To unsubscribe from this list, visit
> https://www.eclipse.org/mailman/listinfo/sumo-user
>
___
sumo-user mailing list
sumo-user@eclipse.org
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/sumo-user


[sumo-user] moveToXY change position

2020-10-21 Thread 謝昀宸
Dear Sumo team,
I want to park the vehicle on the side of the edge.
When the vehicle is parked in the middle of the road, use moveToXY to
fine-tune the position of the vehicle to the far right side of the road.

But when the vehicle touches the edge of the road, it will automatically
adjust its position,  just like the attached gif.

I tried various parameters of Keeproute, but it still does not improve
___
sumo-user mailing list
sumo-user@eclipse.org
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/sumo-user


[sumo-user] moveToXY forces the car return to the center of the lane

2020-10-20 Thread 謝昀宸
Hello,
I want to park the vehicle on the side of the road, so when the vehicle is
stopped, use moveToXY to fine-tune the vehicle position
But when the vehicle hits the edge of the road, it will automatically
adjust its position, just like the attached gif
I tried various parameters of Keeproute, but it still does not improve


Many thanks,
Yo Ye
___
sumo-user mailing list
sumo-user@eclipse.org
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/sumo-user


Re: [sumo-user] moveToXY repeated execution

2020-08-27 Thread Jakob Erdmann
The mapping position should be independent of the road angle. I recommend
that you check the exact x,y position that you are mapping to (i.e. by
loading pois with these coordinates into the simulation or creating them
with traci).

Am Do., 27. Aug. 2020 um 07:24 Uhr schrieb 謝昀宸 :

> I want to let moto avoid vehicle which parked on the road instead of using
> the ChangeLane(When the simulation of avoiding parking vehicle, it is
> possible that moto and parking to be on the same lane)
>
> .
>
> An east-west horizontal road can achieve this, but when the road is
> oblique, MoveToXY will repeat until moto moves the outermost road, just
> like the attached picture, the blue circle is the effect I want to achieve,
> and the red circle is abnormal
>
>
> In the situation, even though I move the vehicle parked to the leftmost
> side of the road and close to the edge, MoveToXY will still move the moto
> to the outermost road.
>
> How can I solve this?
>
>
> Many thanks,
>
> Yun
>
>
> ___
> sumo-user mailing list
> sumo-user@eclipse.org
> To unsubscribe from this list, visit
> https://www.eclipse.org/mailman/listinfo/sumo-user
>
___
sumo-user mailing list
sumo-user@eclipse.org
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/sumo-user


[sumo-user] moveToXY repeated execution

2020-08-26 Thread 謝昀宸
I want to let moto avoid vehicle which parked on the road instead of using
the ChangeLane(When the simulation of avoiding parking vehicle, it is
possible that moto and parking to be on the same lane)

.

An east-west horizontal road can achieve this, but when the road is
oblique, MoveToXY will repeat until moto moves the outermost road, just
like the attached picture, the blue circle is the effect I want to achieve,
and the red circle is abnormal


In the situation, even though I move the vehicle parked to the leftmost
side of the road and close to the edge, MoveToXY will still move the moto
to the outermost road.

How can I solve this?


Many thanks,

Yun
___
sumo-user mailing list
sumo-user@eclipse.org
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/sumo-user


Re: [sumo-user] moveToXY

2019-12-06 Thread Jakob Erdmann
leave out constants.VAR_IDList. the surrounding vehicle ids are part of the
result object implicitly.

Am Do., 5. Dez. 2019 um 16:59 Uhr schrieb Mohsin Memon <
mohsin.l...@gmail.com>:

> Hi Jakob,
>
> Thank you very much for your quick response.
>
> I want to retrieve the vehicle IDs of the surrounding vehicles and for that
> my code is as follows:
>
> traci.vehicle.subscribeContext('1100',
> traci.constants.CMD_GET_VEHICLE_VARIABLE,250 {traci.constants.VAR_IDList,
> traci.constants.VAR_SPEED});
> traci.vehicle.addSubscriptionFilterLeadFollow('1');
> [M] = traci.vehicle.getContextSubscriptionResults('1100');
>
> I am just getting the count of vehicles as output.
>
> How to get the list of vehicle IDs?
>
> I am eagerly waiting for your response.
>
> Thank you very much in advance.
>
>
>
>
>
> --
> Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
> ___
> sumo-user mailing list
> sumo-user@eclipse.org
> To change your delivery options, retrieve your password, or unsubscribe
> from this list, visit
> https://www.eclipse.org/mailman/listinfo/sumo-user
>
___
sumo-user mailing list
sumo-user@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user


Re: [sumo-user] moveToXY

2019-12-05 Thread Mohsin Memon
Hi Jakob,

Thank you very much for your quick response.

I want to retrieve the vehicle IDs of the surrounding vehicles and for that
my code is as follows:

traci.vehicle.subscribeContext('1100',
traci.constants.CMD_GET_VEHICLE_VARIABLE,250 {traci.constants.VAR_IDList,
traci.constants.VAR_SPEED});
traci.vehicle.addSubscriptionFilterLeadFollow('1');
[M] = traci.vehicle.getContextSubscriptionResults('1100');

I am just getting the count of vehicles as output.

How to get the list of vehicle IDs?

I am eagerly waiting for your response.

Thank you very much in advance.





--
Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
___
sumo-user mailing list
sumo-user@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user


Re: [sumo-user] moveToXY

2019-12-05 Thread Mohsin Memon
Hi Jakob,

I am eagerly waiting for your reply for above query regarding context
subscription.

I would be very much grateful if you reply me.



--
Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
___
sumo-user mailing list
sumo-user@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user


Re: [sumo-user] moveToXY

2019-12-04 Thread Mohsin Memon
Hi Jakob,

I have defined the vehicle route in advance and now the leader vehicle is
detected.

Now my task is to generate random traffic in sumo and get the surrounding
vehicle IDs,position and velocity and transfer it to IPG Traffic objects.

I have already generated random traffic of 1000 vehicles in network.

I tried subscribeContext and addsubsciptionfilter to get the surrounding
vehicles data as follows:
 
"traci.vehicle.subscribeContext('125','CMD_GET_VEHICLE_VARIABLE',1);
traci.vehicle.addSubscriptionFilterLeadFollow(0);
[M] = traci.vehicle.getContextSubscriptionResults('1100');

I am getting the warning in SUMO : 

Warning: addSubscriptionFilter: No previous vehicle context subscription
exists to apply the context filter.

>From this, I understood that I am doing some mistakes in add vehicle context
subscription.

I want to know, what inputs are required and mandatory to add vehicle
context subscription and how to apply filter to get vehicle moving in
certain radius of my EGO vehicle.

And what is domain, cmdID, objID,varIDs in function subscribeContext(cmdID,
subscriptionBegin, subscriptionEnd, objID, domain, dist, varIDs).

I would be very much grateful if you please guide or help me in this matter.

Thank you very much in advance.











--
Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
___
sumo-user mailing list
sumo-user@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user


Re: [sumo-user] moveToXY

2019-12-04 Thread Mohsin Memon
Hi Jakob,

Thank you very much for your reply.

I will try as you suggested. I have one query regarding Pedestrain crossing
IDs, Pedestrian XY coordinates information using TraCI.

I have developed a scenario in SUMO, in which, the pedestrians have been
generated randomly using randomtrips.py and are moving along the sidewalks
and are crossing a priority zebra crossing. My ego-vehicle in SUMO halts in
front of the zebra crossing after detecting walking pedestrians.
I would like to obtain the following information using TraCI,
1) Immediate zebra crossing ID
2) Pedestrian ID’s walking on that corresponding crossing
3) Pedestrian X,Y co-ordinates and velocity
I have tried the functions mentioned in this example, but was unsuccessful
in obtaining the above
information(https://sumo.dlr.de/docs/Tutorials/TraCIPedCrossing.html).
I am using traci4matlab as my interface with SUMO. I would be grateful if
you could please suggest me which functions would be appropriate to be used
to solve my problem?


Regards,
Mohsin Memon 



--
Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
___
sumo-user mailing list
sumo-user@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user


Re: [sumo-user] moveToXY

2019-12-03 Thread Jakob Erdmann
When moving a vehicle continuously with moveToXY without setting the
vehicle route in advance, then the route will always consist of a single
edge (updated every time moveToXY moves the vehicle to a new edge). This
precludes leader search beyond the current edge.
There are plans to make this more convenient (
https://github.com/eclipse/sumo/issues/4250,
https://github.com/eclipse/sumo/issues/6284) but right now,
to avoid this, the vehicle route must be defined in advance so that it
reaches as far as the desired leader distance.



Am Di., 3. Dez. 2019 um 16:48 Uhr schrieb Mohsin Memon <
mohsin.l...@gmail.com>:

> Hi Jakob,
>
> In my query, different lane ID means "lane id value" . For ex:
> "-25637754#2_0" and "-25637754#3_0"... This both values are on the same
> lane...
>
> Problem is : I have one vehicle on lane ID : -25637754#2_0 in front of my
> EGO vehicle which is on lane ID value :  -25637754#3_0... and the distance
> between them is 50m, So i have set distance argument to 100 m but still it
> does not detect any vehicle although it is the range and also in front of
> ego vehicle.
>
> How to solve this problem?
>
> <
> http://sumo-user-mailing-list.90755.n8.nabble.com/file/t206/leader_different_lane.jpg>
>
>
> <
> http://sumo-user-mailing-list.90755.n8.nabble.com/file/t206/leader_same_lane.jpg>
>
>
>
> Thanks and regards,
> Mohammed Mohsin Memon
>
>
>
> --
> Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
> ___
> sumo-user mailing list
> sumo-user@eclipse.org
> To change your delivery options, retrieve your password, or unsubscribe
> from this list, visit
> https://www.eclipse.org/mailman/listinfo/sumo-user
>
___
sumo-user mailing list
sumo-user@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user


Re: [sumo-user] moveToXY

2019-12-03 Thread Mohsin Memon
Hi Jakob,

In my query, different lane ID means "lane id value" . For ex:
"-25637754#2_0" and "-25637754#3_0"... This both values are on the same
lane...

Problem is : I have one vehicle on lane ID : -25637754#2_0 in front of my
EGO vehicle which is on lane ID value :  -25637754#3_0... and the distance
between them is 50m, So i have set distance argument to 100 m but still it
does not detect any vehicle although it is the range and also in front of
ego vehicle.

How to solve this problem?


 


 


Thanks and regards,
Mohammed Mohsin Memon



--
Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
___
sumo-user mailing list
sumo-user@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user


Re: [sumo-user] moveToXY

2019-12-03 Thread Jakob Erdmann
- to check directly neighboring lanes you can use vehicle.getRightLeaders,
vehicle.getLeftLeaders
- to get all vehicles in a given radius, you can use context subscriptions:
https://sumo.dlr.de/docs/TraCI/Interfacing_TraCI_from_Python.html#context_subscriptions
and
https://sumo.dlr.de/docs/TraCI/Interfacing_TraCI_from_Python.html#context_subscription_filters

Am Di., 3. Dez. 2019 um 12:50 Uhr schrieb Mohsin Memon <
mohsin.l...@gmail.com>:

> Hi Jakob,
>
> thank you very much for your reply, now it worked perfectly fine.
>
> Regarding leader vehicle, now the vehicle is been detected but only when it
> is in the same lane ID and when it is in different lane , it does not show
> any value although distance argument is satisfying.
>
> When the leader vehicle leaves the lane of ego vehicle, it disappears and
> sumo does not show any vehicle detected.
>
> How to solve this problem?
>
> I am hereby attaching screenshots of both the scenario (different lanes and
> same lanes).
>
> <
> http://sumo-user-mailing-list.90755.n8.nabble.com/file/t206/leader_different_lane.jpg>
>
>
> <
> http://sumo-user-mailing-list.90755.n8.nabble.com/file/t206/leader_same_lane.jpg>
>
>
> I want to detect the leader vehicle and get the position and velocity of
> that vehicle and then transfer it ti IPG traffic objects.
>
> Any information about this would be a great help for me.
>
>
> Thank you in advance.
>
>
>
> --
> Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
> ___
> sumo-user mailing list
> sumo-user@eclipse.org
> To change your delivery options, retrieve your password, or unsubscribe
> from this list, visit
> https://www.eclipse.org/mailman/listinfo/sumo-user
>
___
sumo-user mailing list
sumo-user@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user


Re: [sumo-user] moveToXY

2019-12-03 Thread Mohsin Memon
Hi Jakob,

thank you very much for your reply, now it worked perfectly fine.

Regarding leader vehicle, now the vehicle is been detected but only when it
is in the same lane ID and when it is in different lane , it does not show
any value although distance argument is satisfying.

When the leader vehicle leaves the lane of ego vehicle, it disappears and
sumo does not show any vehicle detected.

How to solve this problem?

I am hereby attaching screenshots of both the scenario (different lanes and
same lanes).


 


 

I want to detect the leader vehicle and get the position and velocity of
that vehicle and then transfer it ti IPG traffic objects.

Any information about this would be a great help for me.


Thank you in advance.



--
Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
___
sumo-user mailing list
sumo-user@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user


Re: [sumo-user] moveToXY

2019-12-02 Thread Jakob Erdmann
A1: if you use keepRoute=2 then the exact vehicle coordinate is used.
Possibly, the networks in your two simulations do not exactly line up. This
might happen if there is lots of spacing from non-driving lanes in your
OpenDRIVE network and these lanes are not imported by netconvert. (check
netconvert options and typemap).

A2: when used without distance argument, getLeader only looks as far as the
braking distance of the vehicle. Use the distance argument.

regards,
Jakob

Am Mo., 2. Dez. 2019 um 21:56 Uhr schrieb Mohsin Memon <
mohsin.l...@gmail.com>:

> Hi Jakob,
>
>
> I have one more query regarding moveToXY:
>
> I am now able to control my vehicle successfully using IPG ego vehicle
> position.
>
> I am calling function like this every timestep :
>
> traci.vehicle.moveToXY('125','',1,X,Y,angle,2);
>
> The query is : vehicle is running offset to the lane and not on the middle
> of the lane. I am hereby attaching the screenshot of sumo gui. I would be
> very much obliged if you please let me know the reason behind such kind of
> behaviour.
>
> 
>
>
>
> Another query is regarding leading vehicle position:
>
> I want to get the position of leading vehicle every time step in sumo so
> that i can update the traffic data in IPG from sumo.
>
>
> I am using function in matlab as follows:
>
> [A,B] = traci.vehicle.getLeader('125');
>
> But every timestep, the value of A is always empty(''). There is no error
> shown too.
>
>
> Could you please help me to get the leading vehicle data in sumo?
>
>
> Thanks and regards,
> Mohammed Mohsin Memon
>
>
>
>
>
> --
> Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
> ___
> sumo-user mailing list
> sumo-user@eclipse.org
> To change your delivery options, retrieve your password, or unsubscribe
> from this list, visit
> https://www.eclipse.org/mailman/listinfo/sumo-user
>
___
sumo-user mailing list
sumo-user@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user


Re: [sumo-user] moveToXY

2019-12-02 Thread Mohsin Memon
Hi Jakob, 


I have one more query regarding moveToXY:

I am now able to control my vehicle successfully using IPG ego vehicle
position.

I am calling function like this every timestep : 

traci.vehicle.moveToXY('125','',1,X,Y,angle,2);

The query is : vehicle is running offset to the lane and not on the middle
of the lane. I am hereby attaching the screenshot of sumo gui. I would be
very much obliged if you please let me know the reason behind such kind of
behaviour.

 



Another query is regarding leading vehicle position:

I want to get the position of leading vehicle every time step in sumo so
that i can update the traffic data in IPG from sumo.


I am using function in matlab as follows:

[A,B] = traci.vehicle.getLeader('125');

But every timestep, the value of A is always empty(''). There is no error
shown too.


Could you please help me to get the leading vehicle data in sumo?


Thanks and regards,
Mohammed Mohsin Memon





--
Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
___
sumo-user mailing list
sumo-user@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user


Re: [sumo-user] moveToXY

2019-11-27 Thread Jakob Erdmann
For conversion, use traci.simulation.convertGeo
also see https://sumo.dlr.de/docs/Geo-Coordinates.html

The angle can be set to traci constant INVALID_DOUBLE_VALUE to indicate
that the vehicle should assume the angle of the road. If you set it to
another value, it will determine vehicle yaw.

Am Mi., 27. Nov. 2019 um 14:24 Uhr schrieb Mohsin Memon <
mohsin.l...@gmail.com>:

> Hi Jakob,
>
> Thank you very much for your reply.
>
> I have one more query regarding angle and x,y position values:
>
> I tried angle argument for moveToXY to be left blank("") as EdgeID argument
> but it didn't work. I think it is mandatory and cannot be left blank.
>
> Regarding angle argument, I just want to confirm, the angle in sumo is
> vehicle yaw angle right?
>
> Position X,Y :
>
> Is there any function,I can give GCS geo co ordinates: long. and lat.(Ex :
> 7.765482, 49.4585412) to moveToXY function because I am getting GCS
> co-ordinates from IPG carmaker.
>
> If not, Do we have any traci function to convert geo to absolute values?
>
> Thank you in advance.
>
>
>
>
>
>
>
>
> --
> Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
> ___
> sumo-user mailing list
> sumo-user@eclipse.org
> To change your delivery options, retrieve your password, or unsubscribe
> from this list, visit
> https://www.eclipse.org/mailman/listinfo/sumo-user
>
___
sumo-user mailing list
sumo-user@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user


Re: [sumo-user] moveToXY

2019-11-27 Thread Mohsin Memon
Hi Jakob,

Thank you very much for your reply.

I have one more query regarding angle and x,y position values:

I tried angle argument for moveToXY to be left blank("") as EdgeID argument
but it didn't work. I think it is mandatory and cannot be left blank.

Regarding angle argument, I just want to confirm, the angle in sumo is
vehicle yaw angle right?

Position X,Y :

Is there any function,I can give GCS geo co ordinates: long. and lat.(Ex :
7.765482, 49.4585412) to moveToXY function because I am getting GCS
co-ordinates from IPG carmaker.

If not, Do we have any traci function to convert geo to absolute values?

Thank you in advance.








--
Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
___
sumo-user mailing list
sumo-user@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user


Re: [sumo-user] moveToXY

2019-11-26 Thread Jakob Erdmann
The edgeID argument for moveToXY can be left blank (""). It is only needed
for disambiguation on intersections when there are many lanes on top of
each other.

Am Di., 26. Nov. 2019 um 16:26 Uhr schrieb Mohsin Memon <
mohsin.l...@gmail.com>:

> Hi Jakob,
>
> Thank you very much for your help. I can see the vehicle in sumo network
> now.
>
> I have one doubt here:
>
> I want to control my EGO vehicle using moveToXY getting data from IPG
> Carmaker every timesteps,
>
> For edgeID, I want to give input from SUMO itself as there is no such
> parameter in IPG Carmaker.
>
> For that, i have thought of giving future or next edgeID of my ego vehicle
> every timesteps to my ego vehicle itself to run co-simulation.
>
> I went through all functions in traci4matlab and found one :function
> nextEdge = getNextEdge(personID).
>
> I want the same for Vehicle ID, is there any such functions? please let me
> know if any.
>
> Thanks in advance.
>
>
>
>
>
> --
> Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
> ___
> sumo-user mailing list
> sumo-user@eclipse.org
> To change your delivery options, retrieve your password, or unsubscribe
> from this list, visit
> https://www.eclipse.org/mailman/listinfo/sumo-user
>
___
sumo-user mailing list
sumo-user@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user


Re: [sumo-user] moveToXY

2019-11-26 Thread Mohsin Memon
Hi Jakob,

Thank you very much for your help. I can see the vehicle in sumo network
now.

I have one doubt here:

I want to control my EGO vehicle using moveToXY getting data from IPG
Carmaker every timesteps,

For edgeID, I want to give input from SUMO itself as there is no such
parameter in IPG Carmaker.

For that, i have thought of giving future or next edgeID of my ego vehicle
every timesteps to my ego vehicle itself to run co-simulation.

I went through all functions in traci4matlab and found one :function
nextEdge = getNextEdge(personID).

I want the same for Vehicle ID, is there any such functions? please let me
know if any.

Thanks in advance.





--
Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
___
sumo-user mailing list
sumo-user@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user


Re: [sumo-user] moveToXY

2019-11-25 Thread Jakob Erdmann
my mistake. The call should be:
traci.vehicle.add(veh_ID, "")
For adding vehicles with route file, see
https://sumo.dlr.de/docs/Definition_of_Vehicles,_Vehicle_Types,_and_Routes.html#vehicles_and_routes
https://sumo.dlr.de/docs/NETEDIT.html#demand_specific_modes

Am Mo., 25. Nov. 2019 um 14:53 Uhr schrieb Mohsin Memon <
mohsin.l...@gmail.com>:

> Hi Jakob,
>
> I tried adding vehicle with ID '125' but again I am getting an error :
>
>
> Error in traci.vehicle.add (line 44)
> p.parse(vehID, routeID, varargin{:})
>
>
> I am just calling traci.vehicle.add(veh_ID); in matlab.
> veh_ID = '125'
>
> I would be very much obliged if you reply me in this matter.
>
> And I want to know how to add vehicle with ID '125' in sumo network using
> route file: it shows : vehicle 125 has no route.
>
> here is my code :
>
> clear
> close all
> clc
>
> import traci.constants
>
> scenarioPath=['C:\Users\m_memon\Desktop\SUMO\CS.sumocfg'];
> system(['sumo-gui -c' '"' scenarioPath '"' ' --remote-port 8813
> --start&']);
> traci.init
>
>
> traci.vehicle.moveToXY(vehID, edgeID, lane, x, y, angle, keepRoute);
> traci.vehicle.add(veh_ID);
> traci.simulationStep();
>
> maybe I am doing some mistakes in this, could you please help me with this.
>
>
>
> --
> Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
> ___
> sumo-user mailing list
> sumo-user@eclipse.org
> To change your delivery options, retrieve your password, or unsubscribe
> from this list, visit
> https://www.eclipse.org/mailman/listinfo/sumo-user
>
___
sumo-user mailing list
sumo-user@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user


Re: [sumo-user] moveToXY

2019-11-25 Thread Mohsin Memon
Hi Jakob,

I tried adding vehicle with ID '125' but again I am getting an error :


Error in traci.vehicle.add (line 44)
p.parse(vehID, routeID, varargin{:})


I am just calling traci.vehicle.add(veh_ID); in matlab.
veh_ID = '125'

I would be very much obliged if you reply me in this matter.

And I want to know how to add vehicle with ID '125' in sumo network using
route file: it shows : vehicle 125 has no route.

here is my code :

clear
close all
clc

import traci.constants

scenarioPath=['C:\Users\m_memon\Desktop\SUMO\CS.sumocfg'];
system(['sumo-gui -c' '"' scenarioPath '"' ' --remote-port 8813 --start&']);
traci.init


traci.vehicle.moveToXY(vehID, edgeID, lane, x, y, angle, keepRoute);
traci.vehicle.add(veh_ID);
traci.simulationStep();

maybe I am doing some mistakes in this, could you please help me with this.



--
Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
___
sumo-user mailing list
sumo-user@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user


Re: [sumo-user] moveToXY

2019-11-23 Thread Jakob Erdmann
if you plan to control a vehicle with moveToXY, you can add it with am
empty routeID
:traci.vehicle.add(vehicleID)

Am Sa., 23. Nov. 2019 um 18:14 Uhr schrieb Mirko Barthauer <
m.bartha...@t-online.de>:

> You can only move already existing vehicles, just as the function name
> suggests and what can be deduced from the error message you got. Please
> add first vehicle "125" and then call moveToXY.
>
> Regards
> Mirko
>
> Am 23.11.2019 um 17:19 schrieb Mohsin Memon:
> > Do I need to first insert a vehicle with ID '125' into the network or I
> can
> > directly place a new vehicle with ID '125' into the sumo network by
> giving
> > its position ?
> ___
> sumo-user mailing list
> sumo-user@eclipse.org
> To change your delivery options, retrieve your password, or unsubscribe
> from this list, visit
> https://www.eclipse.org/mailman/listinfo/sumo-user
>
___
sumo-user mailing list
sumo-user@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user


Re: [sumo-user] moveToXY

2019-11-23 Thread Mirko Barthauer
You can only move already existing vehicles, just as the function name 
suggests and what can be deduced from the error message you got. Please 
add first vehicle "125" and then call moveToXY.


Regards
Mirko

Am 23.11.2019 um 17:19 schrieb Mohsin Memon:

Do I need to first insert a vehicle with ID '125' into the network or I can
directly place a new vehicle with ID '125' into the sumo network by giving
its position ?

___
sumo-user mailing list
sumo-user@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user


Re: [sumo-user] moveToXY

2019-11-23 Thread Mohsin Memon
Hi Jakob,

I have one doubt here : the function moveToXY in matlab will move the
existing vehicle in the network OR it will place a new vehicle in network??

Do I need to first insert a vehicle with ID '125' into the network or I can
directly place a new vehicle with ID '125' into the sumo network by giving
its position ?

Actually right now I am just checking moveToXY function in matlab by giving
just one value to each variables for just first simulation step.

Do u have any example of moveToXY so that I can see how to use it in correct
way?

My thesis task is to place an EGO vehicle into SUMO network from IPG
Carmaker.

I would be very much grateful if you please guide me in this matter.


Thanks in advance.






--
Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
___
sumo-user mailing list
sumo-user@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user


Re: [sumo-user] moveToXY

2019-11-22 Thread Jakob Erdmann
This error is helpfully telling you that vehicle '125' is not yet in the
simulation and therefore cannot be moved.
You can catch this error and keep trying or check beforehand for the
presence of the vehicle (i.e. using traci.vehicle.getIDList).

Am Fr., 22. Nov. 2019 um 19:17 Uhr schrieb Mohsin Memon <
mohsin.l...@gmail.com>:

> Hi Jakob,
>
> Thanks for your reply, I have followed the link you sent but getting an
> error:
>
>
>
> <
> http://sumo-user-mailing-list.90755.n8.nabble.com/file/t206/traci_error.png
> >
>
> <
> http://sumo-user-mailing-list.90755.n8.nabble.com/file/t206/traci_error1.png>
>
>
>
>
> --
> Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
> ___
> sumo-user mailing list
> sumo-user@eclipse.org
> To change your delivery options, retrieve your password, or unsubscribe
> from this list, visit
> https://www.eclipse.org/mailman/listinfo/sumo-user
>
___
sumo-user mailing list
sumo-user@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user


Re: [sumo-user] moveToXY

2019-11-22 Thread Mohsin Memon
Hi Jakob,

Thanks for your reply, I have followed the link you sent but getting an
error: 





 



--
Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
___
sumo-user mailing list
sumo-user@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user


Re: [sumo-user] moveToXY

2019-11-21 Thread Jakob Erdmann
Why can you not use the function from traci4matlab?
https://github.com/pipeacosta/traci4matlab/blob/master/%2Btraci/%2Bvehicle/moveToXY.m

Am Fr., 22. Nov. 2019 um 02:17 Uhr schrieb Mohsin Memon <
mohsin.l...@gmail.com>:

> Hi.. I am working on moveToXY to place ego vehicle in SUMO, but
> unfortunately
> I am getting error in traci.beginMessage (line 15)
> message.queue = [message.queue uint8(sscanf(cmdID,'%x'))];
>
> Error in moveToXY (line 39)
> traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE,
> constants.MOVE_TO_XY,...
>
> I am attaching here the matlab code and my sumocfg file and network file.
>
> I would be very much obliged if someone please help me solving this error.
>
> moveToXY.m
> 
>
> CS.sumocfg
> 
>
> CS.xml 
>
>
> CS.xml 
>
>
>
>
>
> --
> Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
> ___
> sumo-user mailing list
> sumo-user@eclipse.org
> To change your delivery options, retrieve your password, or unsubscribe
> from this list, visit
> https://www.eclipse.org/mailman/listinfo/sumo-user
>
___
sumo-user mailing list
sumo-user@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user


[sumo-user] moveToXY

2019-11-21 Thread Mohsin Memon
Hi.. I am working on moveToXY to place ego vehicle in SUMO, but unfortunately
I am getting error in traci.beginMessage (line 15)
message.queue = [message.queue uint8(sscanf(cmdID,'%x'))];

Error in moveToXY (line 39)
traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE,
constants.MOVE_TO_XY,...

I am attaching here the matlab code and my sumocfg file and network file.

I would be very much obliged if someone please help me solving this error.

moveToXY.m
  

CS.sumocfg
  

CS.xml   

CS.xml   




--
Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
___
sumo-user mailing list
sumo-user@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user


Re: [sumo-user] moveToXY and FatalTraCIError: connection closed by SUMO

2019-01-11 Thread Jakob Erdmann
Hello,
thanks to your example I was able to find and fix the bug that was causing
the crash (https://github.com/eclipse/sumo/issues/5029).
However, I also found another issue so I recommend you use
changeLaneRelative to move your vehicle back onto the forward lane (see
https://github.com/eclipse/sumo/issues/5031)

You can also use changeLaneRelative to trigger the change to the opposite
side, but be aware of https://github.com/eclipse/sumo/issues/5030

also you can scale the safety desire using vType parameter lcOpposite

The code for computing the timing is in MSLaneChanger::computeOvertakingTime

regards,
Jakob

Am Fr., 11. Jan. 2019 um 10:25 Uhr schrieb Zheya :

> Hi, Jacok,
>
> I'm reading the model description of opposite direction driving, and the
> assumed duration for overtaking the leading vehicle is taken into making
> the
> decision. I wonder how you estimate the assumed duration, like using the
> max
> speed of oncoming vehicles to calculate the time to overtake?
> Is it possible that I set the lanechangemode to take over making decisions?
>
> I've sent the scenario and traci files to you, not sure whether you have
> received them or not:)
>
> Thank you!!
>
> Zheya
>
>
>
> --
> Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
> ___
> sumo-user mailing list
> sumo-user@eclipse.org
> To change your delivery options, retrieve your password, or unsubscribe
> from this list, visit
> https://www.eclipse.org/mailman/listinfo/sumo-user
>
___
sumo-user mailing list
sumo-user@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user


Re: [sumo-user] moveToXY and FatalTraCIError: connection closed by SUMO

2019-01-11 Thread Zheya
Hi, Jacok,

I'm reading the model description of opposite direction driving, and the
assumed duration for overtaking the leading vehicle is taken into making the
decision. I wonder how you estimate the assumed duration, like using the max
speed of oncoming vehicles to calculate the time to overtake?
Is it possible that I set the lanechangemode to take over making decisions?

I've sent the scenario and traci files to you, not sure whether you have
received them or not:)

Thank you!!

Zheya



--
Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
___
sumo-user mailing list
sumo-user@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user


Re: [sumo-user] moveToXY and FatalTraCIError: connection closed by SUMO

2019-01-10 Thread Jakob Erdmann
This looks as if sumo crashed. Please zip up your scenario files and traci
script and send them to me so I can  reproduce the problem. Please remove
all vehicles and all traci code that is not needed to show the problem.

regards,
Jakob

Am Do., 10. Jan. 2019 um 00:04 Uhr schrieb Zheya :

> Hi all,
>
> I encountered "connection closed by SUMO" error when using moveToXY.
>
> My scenario is that ego vehicle is moving on the lateral lane of opposite
> direction(edgeID = "2to1") due to lane change resulted from front obstacle.
> Now I want it to move back to the perivous lane(edgeID = "1to2") when its
> position is 10m ahead of a stopped bus. The code is like this,
>
>  if lanechanged == True and
> ego_pos>traci.vehicle.getPosition("bus1")[0]+10:
> traci.vehicle.moveToXY(vehID = "0", edgeID = "1to2", x =
> ego_pos+3, y = 3, lane = 0, keepRoute = 1)
> print("moved!!!",TIME)
>
> I got error instantly after running the above piece of code and no error
> when I skipped the above code. So I guess something wrong with the moveToXY
> part.
>
> Here is the error.
>
> FatalTraCIError   Traceback (most recent call
> last)
>  in ()
>  16 print("start")
>  17 while traci.simulation.getMinExpectedNumber() > 0 and
> traci.vehicle.getPosition("0")[0]<950:
> ---> 18 traci.simulationStep()
>  19 ego_speed = traci.vehicle.getSpeed("0")
>  20 ego_pos = traci.vehicle.getPosition("0")[0]
>
> E:\_software\SUMO\tools\traci\__init__.py in simulationStep(step)
> 125 """
> 126 global _stepListeners
> --> 127 responses = _connections[""].simulationStep(step)
> 128
> 129 # manage stepListeners
>
> E:\_software\SUMO\tools\traci\connection.py in simulationStep(self, step)
> 321 self._queue.append(tc.CMD_SIMSTEP)
> 322 self._string += struct.pack("!BBd", 1 + 1 + 8,
> tc.CMD_SIMSTEP, step)
> --> 323 result = self._sendExact()
> 324 for subscriptionResults in
> self._subscriptionMapping.values():
> 325 subscriptionResults.reset()
>
> E:\_software\SUMO\tools\traci\connection.py in _sendExact(self)
>  97 self._socket.close()
>  98 del self._socket
> ---> 99 raise FatalTraCIError("connection closed by SUMO")
> 100 for command in self._queue:
> 101 prefix = result.read("!BBB")
>
> FatalTraCIError: connection closed by SUMO
>
>
> Is this because this kind of movement is invalid in sumo? if so, how can I
> move the car back to the perivous lane?
>
> Thanks in advance!
>
>
>
> --
> Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
> ___
> sumo-user mailing list
> sumo-user@eclipse.org
> To change your delivery options, retrieve your password, or unsubscribe
> from this list, visit
> https://www.eclipse.org/mailman/listinfo/sumo-user
>
___
sumo-user mailing list
sumo-user@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user


[sumo-user] moveToXY and FatalTraCIError: connection closed by SUMO

2019-01-09 Thread Zheya
Hi all, 

I encountered "connection closed by SUMO" error when using moveToXY. 

My scenario is that ego vehicle is moving on the lateral lane of opposite
direction(edgeID = "2to1") due to lane change resulted from front obstacle.
Now I want it to move back to the perivous lane(edgeID = "1to2") when its
position is 10m ahead of a stopped bus. The code is like this, 

 if lanechanged == True and ego_pos>traci.vehicle.getPosition("bus1")[0]+10: 
traci.vehicle.moveToXY(vehID = "0", edgeID = "1to2", x =
ego_pos+3, y = 3, lane = 0, keepRoute = 1) 
print("moved!!!",TIME)   

I got error instantly after running the above piece of code and no error
when I skipped the above code. So I guess something wrong with the moveToXY
part. 

Here is the error. 

FatalTraCIError   Traceback (most recent call last) 
 in () 
 16 print("start") 
 17 while traci.simulation.getMinExpectedNumber() > 0 and 
traci.vehicle.getPosition("0")[0]<950: 
---> 18 traci.simulationStep() 
 19 ego_speed = traci.vehicle.getSpeed("0") 
 20 ego_pos = traci.vehicle.getPosition("0")[0] 

E:\_software\SUMO\tools\traci\__init__.py in simulationStep(step) 
125 """ 
126 global _stepListeners 
--> 127 responses = _connections[""].simulationStep(step) 
128 
129 # manage stepListeners 

E:\_software\SUMO\tools\traci\connection.py in simulationStep(self, step) 
321 self._queue.append(tc.CMD_SIMSTEP) 
322 self._string += struct.pack("!BBd", 1 + 1 + 8,
tc.CMD_SIMSTEP, step) 
--> 323 result = self._sendExact() 
324 for subscriptionResults in
self._subscriptionMapping.values(): 
325 subscriptionResults.reset() 

E:\_software\SUMO\tools\traci\connection.py in _sendExact(self) 
 97 self._socket.close() 
 98 del self._socket 
---> 99 raise FatalTraCIError("connection closed by SUMO") 
100 for command in self._queue: 
101 prefix = result.read("!BBB") 

FatalTraCIError: connection closed by SUMO 


Is this because this kind of movement is invalid in sumo? if so, how can I
move the car back to the perivous lane? 

Thanks in advance!



--
Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
___
sumo-user mailing list
sumo-user@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user