【问题标题】:How to make the vehicles collide in SUMO?如何让车辆在相扑中发生碰撞?
【发布时间】:2020-10-28 13:38:40
【问题描述】:

我想用 SUMO 进行碰撞警告和紧急制动,但我发现我无法让两辆车在 SUMO 中发生碰撞。那么在SUMO中应该怎么做才能让两辆车相撞呢?

collision.net.xml

    <net version="1.3" junctionCornerDetail="5" limitTurnSpeed="5.50">
    <location netOffset="0.00,0.00" convBoundary="-300.00,0.00,300.00,0.00" origBoundary="10000000000.00,10000000000.00,-10000000000.00,-10000000000.00" projParameter="!"/>
    <edge id=":gneJ1_0" function="internal">
        <lane id=":gneJ1_0_0" index="0" speed=" 30" length="0.10" shape="0.00,-1.60 0.00,-1.60"/>
    </edge>
    <edge id="gneE0" from="gneJ0" to="gneJ1" priority="-1">
        <lane id="gneE0_0" index="0" speed=" 30" length="300.00" shape="-300.00,-1.60 0.00,-1.60"/>
    </edge>
    <edge id="gneE1" from="gneJ1" to="gneJ2" priority="-1">
        <lane id="gneE1_0" index="0" speed=" 30" length="300.00" shape="0.00,-1.60 300.00,-1.60"/>
    </edge>
    <junction id="gneJ0" type="dead_end" x="-300.00" y="0.00" incLanes="" intLanes="" shape="-300.00,0.00 -300.00,-3.20"/>
    <junction id="gneJ1" type="priority" x="0.00" y="0.00" incLanes="gneE0_0" intLanes=":gneJ1_0_0" shape="0.00,0.00 0.00,-3.20 0.00,0.00">
        <request index="0" response="0" foes="0" cont="0"/>
    </junction>
    <junction id="gneJ2" type="dead_end" x="300.00" y="0.00" incLanes="gneE1_0" intLanes="" shape="300.00,-3.20 300.00,0.00"/>
    <connection from="gneE0" to="gneE1" fromLane="0" toLane="0" via=":gneJ1_0_0" dir="s" state="M"/>
    <connection from=":gneJ1_0" to="gneE1" fromLane="0" toLane="0" dir="s" state="M"/>
</net>

collision.rou.xml

<routes>
    <vType sigma="0" id="t1" maxSpeed="70" minGap="0"/>
    <route edges="gneE0 gneE1" color="yellow" id="route_0"/>
    <vehicle id="vehicle_0" depart="0.00" departPos="100.00" departSpeed="0" color="red" route="route_0" type="t1"/>
    <vehicle id="vehicle_1" depart="0.00" departPos="95.00"  departSpeed="20" color="blue" route="route_0" type="t1"/>
</routes>

【问题讨论】:

    标签: veins sumo


    【解决方案1】:

    引用https://sumo.dlr.de/docs/Simulation/Safety.html#deliberately_causing_collisions:要在设定的时间强制碰撞,必须使用 TraCI。除了设置速度之外,还需要使用命令 speedMode 和 laneChangeMode 禁用安全检查。

    这在 Veins 的上下文中可能很难做到。

    【讨论】:

      【解决方案2】:

      将“--default.action-step-length”参数设置为“0.5”

      您可以创建一种方法来设置车辆的以下参数。它肯定会与任何领先的车辆相撞。 (确保 Tau 小于动作步长)

       def add_aggressive_behavior(veh_id):
          traci.vehicle.setAccel(veh_id, 10)
          traci.vehicle.setDecel(veh_id, 4)
          traci.vehicle.setEmergencyDecel(veh_id, 0.1)
          traci.vehicle.setApparentDecel(veh_id, 0.1)
          traci.vehicle.setTau(veh_id, 0.01)
      
          traci.vehicle.setImperfection(veh_id, 0.1)
          traci.vehicle.setLaneChangeMode(veh_id, 0)
      

      【讨论】:

        【解决方案3】:

        首先:setSpeedMode(0) 第二:设置足够后面的车的速度,setSpeed(100); 然后两辆车会相撞!!!

        【讨论】:

          【解决方案4】:

          如果您对开发车辆碰撞预警系统的算法感兴趣,您可能需要预测碰撞时间和地点,而不是实施它。否则,您可能会创建一个路由文件,其中包含从不同方向接近的多个流来模拟碰撞。

          【讨论】:

            猜你喜欢
            • 2022-12-23
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 2021-05-24
            • 2015-05-27
            • 2014-10-14
            • 1970-01-01
            • 1970-01-01
            相关资源
            最近更新 更多