Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[sumo-user] moving on opposite side

Good afternoon!

I made 2 edge road, each edge has 1 lane. Edges have opposite directions. Lanes of the edges are connected with <neigh lane= ... > 

I created 1 car on each edge and control their movements with traci commands.  
I want one of them to move on the opposite edge, but to keep the previous direction of movement and then return to its original edge. 

I tried to do it with traci.vehicle.moveToXY( ..., keepRoute=0). ANd then set a speed with raci.vehicle.setSpeed. But vehicle turns around and starts driving in the direction of the new lane. 

Could you please tell me, how can I make car to move on the opposite edge with its initial direction and speed?

My edge file: 

<edges>
 <edge id="CE" from="C" to="E" numLanes="1" speed="10.00" _oneway_="no">
   <lane index="CE_0" allow="all" spreadType="center" width="7.00"/>
 </lane>
 </edge>

 <edge id="EC" from="E" to="C" numLanes="1" speed="10.00" _oneway_="no">
   <lane index="EC_0" allow="all" spreadType="center" width="7.00"/>
 </lane>

</edges>


My net file:

    <location netOffset="0.00,0.00" convBoundary="0.00,0.00,1000.00,0.00" origBoundary="0.00,0.00,1000.00,0.00" projParameter="!"/>

    <edge id="CE" from="C" to="E" priority="-1">
    <lane id="CE_0" index="0" speed="10.00" length="1000.00" width="7.00" shape="0.00,-3.55 1000.00,-3.55">
<neigh lane="EC_0"/>
</lane>

    </edge>
    <edge id="EC" from="E" to="C" priority="-1">
    <lane id="EC_0" index="1" speed="10.00" length="1000.00" width="7.00" shape="1000.00,3.55 0.00,3.55">
<neigh lane="CE_0"/>
    </lane>
    </edge>

    <junction id="C" type="dead_end" x="0.00" y="0.00" incLanes="EC_0" intLanes="" shape="0.00,-0.05 0.00,-7.05 0.00,7.05 0.00,0.05"/>
    <junction id="E" type="unregulated" x="1000.00" y="0.00" incLanes="CE_0" intLanes="" shape="1000.00,0.05 1000.00,7.05 1000.00,-7.05 1000.00,-0.05"/>

</net>

Best regards, Menzorova Kseniia.

Back to the top