Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[sumo-user] Dead End - changeTarget/MoveToXY issues
  • From: Paul Fierro <paulfierro@xxxxxxxxxx>
  • Date: Fri, 18 Sep 2020 17:07:01 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=kubbla.com; dmarc=pass action=none header.from=kubbla.com; dkim=pass header.d=kubbla.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2/OJAldl5+/E2RmUehz3Ka6Eo2zxBdHhrw3SDsobnhI=; b=EcekE3VLuzFXcqe3+mhi6AB79SEQhxJ9nT+Y4oWFZkMTX1w4RrAqRetr7ypk8x+atdmMbVu5WMlbfYDEXq9XnTkf/wI99QzyUegF6laqUlRV0xs5ClwmCEkBed8C7w0dtjEeidievllU/UsVFzn7f9ItuN8g9dzZlvvCoLcKikqGWRY/OhNQg209aBYDuuNZdgejIRkdJ/itybKh0cUrl9jf/H9lTzj5/KwiiFqku2Qr1RDoFPeEHxqFeEWCfdFESF6Q6Ie6btNpQz64Yo2fV9KvEuzkAT5/oj2kroZIzRPNRYGqSuuo8WreD7LOd6QfhbfyHnHaYtA8xJlQeqgWOQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OTuKutpfgD0P0kwiZYJz1Z5yUxXWcc9P1fePEf8nrX33FrJ+UhIZMUwtQ3Ul9BbSs13fD5eLOn40JUX8oHcrAdfd34cVkUZDbrgyZxPZEfEQ4ROrqUsUwO851IQKIRalR9xpMhqZ5MDklwW0bqAXy9aTLXrej4uRsr8rmzKG0+xrQ7zn2yVH/L9eaoGVFF/rWoCO80ZZr08XiuzNkDzJKr7k3CE8eyQMGfzmM6xkdkPqTwS/IDIpgBUpSn7hdrRV4wDNDSakK5ARaDD2KQjy8AQxQxepUKogYs7RQs/KfdrXcB07wvtR8dggdkQ8x1V4ORgw8Rfod4rxeSumc/x1aQ==
  • Delivered-to: sumo-user@xxxxxxxxxxx
  • 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: AQHWjdwRqwGrkMZZu0uwP1Wir8lszw==
  • Thread-topic: 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













Attachment: Dead End Turn Around - Chnage Target.png
Description: Dead End Turn Around - Chnage Target.png


Back to the top