Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Dead End - changeTarget/MoveToXY issues
  • From: <Maria.Armellini@xxxxxx>
  • Date: Fri, 18 Sep 2020 20:24:34 +0000
  • Accept-language: de-DE, en-US
  • Delivered-to: sumo-user@xxxxxxxxxxx
  • Ironport-phdr: 9a23:JsdiKRAuX/cXPHuy+sRZUyQJP3N1i/DPJgcQr6AfoPdwSPX/o8bcNUDSrc9gkEXOFd2Cra4d1KyO7eu5ADFIoc7Y9ixbLtoUD15NoP5VtjRoONSCB0z/IayiRA0BN+MGamVY+WqmO1NeAsf0ag6aiHSz6TkPBke3blItdaz6FYHIksu4yf259YHNbAVUnjq9Zq55IAmroQnLucQanIlvJrwtxhbIrXdEZvlayGN1Ll6Xgxrw+9288ZF+/ylRof4t69JMXaDndKkkULJUCygrPXoo78PxrxnDSgWP5noYUmoIlxdDHhbI4hLnUJrvqyX2ruVy1jWUMs3wVrA0RC+t77x3Rx/yiScILCA2/WfKgcFtlq1boRahpxtiw47IZYyeKfRzcr/Bcd4cWGFMWNtaWS5cDYOmd4YBD/QPM/tEr4fzpFUOoxmxBQiwC+zg0TJHnGP63a8g3ug9DQ3KwgotFM8OvnTOq9X1Mb8fXOeywqbS1zXDbulZ1S3h5YjSdxAuv/WMXbZxccrXyEkiDB7KjlGKqYD/IjyayP0Avm6G5OVvSeyhkXQoqx1tojex3McsjJHEi4EIx13E9ih0xIg4KMCkREN1b9OpEJ9duz+eOoZqQc4vQGFltSI1x7EatpO1cygExZsoyhDQZfGJfYaF7B3iWeuXPDx2inVleLeliBaz90it0vDzVs2u0FpQsyVKjMHAt3AK1xzO8MiHTOVy/lu71TaJyQ/T9vlIIUYqmqvVLZ4u3KIwmoAVsUvdAi/7nlj9gqyOdkg85+Sk9/7rbqjlq5KTLYN4lw/zP6c0lsChDuk0KhUCUmqF9eimyrHv4Ff1TKhIg/A3iKXVrZbXLtkBqKGjGQ9ayIMj5g66DzehzdsXg2EKLElAeBKbl4jpPEzOIOzgAfe/nVuslDBryujIMLPnDJvDIXjNnrfmc7h+7EBS0hQ/wN9Q6Z1VFLwNOvPzWknttNzCFBA1KRG7w+L9CNlny4wRR3qDAq6fMKzMrV+F/v8jL/WWaIMIuzvwJOIp6+PggHI6g1MRY6ak0YMSaH+iH/RmJ0uZYWDrgtcECWoEuRAxTPbriFKYSzJee2yyX6ci6TE/DIKmDIHDRoG2jbOc2Ce7BIdaaX1YBVyUC3fna52EW+sQaCKVOsJhiSEEVb2mS4M4yBGurxH1y6B8I+XK5iIYsZPj1MBu5+LNjx0y8iZ0D8vOm12KGjVvg2YPAiIt0bpXrEd5y0+Y3O5/mfMORvJJ4PYcBiIzL5/VicVgDt32XgPHf/+FTEzgTtjwUmJ5dc4439JbOxU1IN6llB2Whyc=
  • Ironport-sdr: J3aB6v+UANca62s07IeA4J53MWNXJQ1y8r1sxvkI66p+Ghr6gbTBGIFquATpkoH+Qj7Vfo6WjY y3HozkyYkI9g==
  • List-archive: <https://www.eclipse.org/mailman/private/sumo-user>
  • List-help: <mailto:sumo-user-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/sumo-user>, <mailto:sumo-user-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/sumo-user>, <mailto:sumo-user-request@eclipse.org?subject=unsubscribe>
  • Thread-index: AQHWjdwRqwGrkMZZu0uwP1Wir8lsz6luqOEg
  • Thread-topic: Dead End - changeTarget/MoveToXY issues

Hi,

 

you can use traci.lane.getAllowed(“lane id”) to check if the given lane allows your vehicle type (see https://sumo.dlr.de/docs/TraCI/Lane_Value_Retrieval.html). With traci.lane.setAllowed(“lane id”) you can change the vehicle types that are allow in the given lane (see https://sumo.dlr.de/docs/TraCI/Change_Lane_State.html).

 

I’m not sure if it Is the best solution, but you could add turnarounds in your net to avoid dead ends and allow the vehicles to turn around in the next junction. You can do this with netconvert:

netconvert –s yournet.net.xml --no-turnarounds false -o newnet.net.xml (see https://sumo.dlr.de/docs/netconvert.html)

 

Regards,

Giuliana

 

From: sumo-user-bounces@xxxxxxxxxxx [mailto:sumo-user-bounces@xxxxxxxxxxx] On Behalf Of Paul Fierro
Sent: Freitag, 18. September 2020 19:07
To: Sumo project User discussions
Subject: [sumo-user] Dead End - changeTarget/MoveToXY issues

 

 

I want to set up the problem properly and then highlight the issue I am having.

 

I have a series of people that need to be picked up by a busroute, and I see numerous capabilities to handle bus routes that I am not using as of yet.  What I am doing now is I am visiting a RoadId or route segment near the person and when the vehicle arrives the person will board and then the bus will change its Target to a new destination target to the next customer in the route.

 

at times this fails because the person is on a road segment that does Not allow vehicles to travel down, like local road/rural road/private road.  I have gotten around this by writing a radius alternative algorithm using your api too discover a nearby road that does allow vehicles.  This works fine.

 

Occasionally when the vehicle arrives to a person's nearby location, the route ends on a dead-end route.  In this case changeTarget does not turn the vehicle around, instead what may be an available destination is failed, as well as I am sure the original problem which some of the edges are not allowing vehicle's may also be failing.

 

Simply, I have tried moveToXY as a way to re orient the vehicle at angle -= 180 degrees.  This would seem to be needed a prerequisite to calling changeTarget.  This is my current thinking and strategy.  But somehow, I am calling movetoXY in manner that does not work.  It must be in lane_index, edge_id, angle, xv, yv values.  I need to turn this vehicle around so a change Target can take it to the next customer.

 

Lastly, is there a way to check if an edge allows vehicle or not, and potentially can that be changed.

 

        tmp = traci.simulation.convertRoad( XcnvTry, YcnvTry )

        destEdgeId = tmp[0]

        lane_index = tmp[2]

 

        nptabu = np.array(tabu)

        stateNotTabu = StateNotInTabu([destEdgeId], nptabu)

        if stateNotTabu:

            tabu.append([destEdgeId])

            print('Size of Tabu List:', len(tabu))

 

            try:

                traci.vehicle.changeTarget(prid, destEdgeId )

                #done = True

                headingToX = XcnvTry

                headingToY = YcnvTry

                initialChampionFound = True

                dtry = distEuclid( XcnvTry, YcnvTry, XCustcnv, YCustcnv )

                if dtry < chDfrmOrig:

                    chEdgeId = destEdgeId

                    chDfrmOrig = dtry

                    chXtry = XcnvTry

                    chYtry = YcnvTry

                    print( "NEW CHAMPION - Base Radius stRadius:", stRadius ," cnt:", cnt, " ch:", chDfrmOrig, chXtry , chYtry  )

                    if circularMove:

                        break

            except:

                pass

 

    return chEdgeId, chXtry, chYtry, cnt

 

Could not make Bold work:

 

#     route_id = traci.vehicle.getRouteID(prid)

# edge_id = traci.vehicle.getRoadID(prid)

# lane_index = traci.vehicle.getLaneIndex(prid)

# position = traci.vehicle.getPosition(prid)

# xv = tuple(position)[0]

# yv = tuple(position)[1]

# angle = traci.vehicle.getAngle(prid)

# angle -= 180.0

#

# fndMinus = edge_id.find('-')

# if fndMinus >= 0:

#     edge_id = edge_id[1:]

# else:

#     edge_id = '-' + edge_id

#

# traci.vehicle.moveToXY(prid, edge_id, lane_index, xv + 50, yv + 50, angle, keepRoute=2)

# try:

#     traci.vehicle.changeTarget(prid, destEdgeId)

#     # done = True

#     headingToX = XcnvTry

#     headingToY = YcnvTry

#     initialChampionFound = True

#     dtry = distEuclid(XcnvTry, YcnvTry, XCustcnv, YCustcnv)

#     if dtry < chDfrmOrig:

#         chEdgeId = destEdgeId

 

 

 

 

 

 

 

 

 

 

 

 


Back to the top