Multiple Paths



  • Hi,

    We are trying to create a scenario where we have two vehicles and two paths. If we have the following:

    trackVeh = anv.CreateObject('HMMWV2', 'Tracking', 0, Point3(-113.72, -110.75, -0.32144400000000001), Euler(0, 0, 0), True)
    
    roamVeh = anv.CreateObject('Generic 4x4', 'Roaming', 0, Point3(-107.669, -184.566, -0.48190300000000003), Euler(0, 0, 0), True)
    
    trackPath=anv.CreatePath('TrackingPath', trackingPath())
    roamPath=anv.CreatePath('RoamingPath', roamingPath())
    
    anv.FollowPathVehicle( roamVeh.id, roamPath.id, 6)
    anv.FollowPathVehicle( trackVeh.id, trackPath.id, 6)
    #anv.FollowPathAI( rmvh.id, roamPath.id, 6)
    
    anv.SetSimulationState(SimulationState.RUNNING_REALTIME)
    

    I get the following error:
    Traceback (most recent call last):
    File "example.py", line 109, in <module>
    anv.FollowPathVehicle( trackVeh.id, trackPath.id, 6)
    File "/usr/ANVEL/API/python/src/AnvelApi/AnvelControlService.py", line 2345, in FollowPathVehicle
    self.recv_FollowPathVehicle()
    File "/usr/ANVEL/API/python/src/AnvelApi/AnvelControlService.py", line 2371, in recv_FollowPathVehicle
    raise result.oknf
    AnvelApi.ttypes.ObjectKeyNotFound: ObjectKeyNotFound(objectKey=293601339)

    Now if I comment out the line in question it works just fine. Also if I comment out the line above it where I tell the roamVeh to follow the path, it works just fine.

    Is it possible to have two vehicles driving on two different paths through the API? I know this works in the GUI. Do I have to tell the first vehicle to follow the path then define the second vehicle then tell it to follow its path then start the simulation?

    Thank you for your help.



  • Hi,

    I should add we have tried it multiple different ways. Do I need to add a controller? At one point I did but I was getting the same error. However, I might have been adding the wrong one. We are still actively working on this. I will post if we find anything else.

    Thanks.



  • @jmk479 said in Multiple Paths:

    Hi,

    We are trying to create a scenario where we have two vehicles and two paths. If we have the following:

    trackVeh = anv.CreateObject('HMMWV2', 'Tracking', 0, Point3(-113.72, -110.75, -0.32144400000000001), Euler(0, 0, 0), True)
    
    roamVeh = anv.CreateObject('Generic 4x4', 'Roaming', 0, Point3(-107.669, -184.566, -0.48190300000000003), Euler(0, 0, 0), True)
    
    trackPath=anv.CreatePath('TrackingPath', trackingPath())
    roamPath=anv.CreatePath('RoamingPath', roamingPath())
    
    anv.FollowPathVehicle( roamVeh.id, roamPath.id, 6)
    anv.FollowPathVehicle( trackVeh.id, trackPath.id, 6)
    #anv.FollowPathAI( rmvh.id, roamPath.id, 6)
    
    anv.SetSimulationState(SimulationState.RUNNING_REALTIME)
    

    I get the following error:
    Traceback (most recent call last):
    File "example.py", line 109, in <module>
    anv.FollowPathVehicle( trackVeh.id, trackPath.id, 6)
    File "/usr/ANVEL/API/python/src/AnvelApi/AnvelControlService.py", line 2345, in FollowPathVehicle
    self.recv_FollowPathVehicle()
    File "/usr/ANVEL/API/python/src/AnvelApi/AnvelControlService.py", line 2371, in recv_FollowPathVehicle
    raise result.oknf
    AnvelApi.ttypes.ObjectKeyNotFound: ObjectKeyNotFound(objectKey=293601339)

    Now if I comment out the line in question it works just fine. Also if I comment out the line above it where I tell the roamVeh to follow the path, it works just fine.

    Is it possible to have two vehicles driving on two different paths through the API? I know this works in the GUI. Do I have to tell the first vehicle to follow the path then define the second vehicle then tell it to follow its path then start the simulation?

    Thank you for your help.

    @jmk479,

    Unfortunately, it looks like you've found another issue in ANVEL. We were able to reproduce the issue using your script, where the second FollowPathVehicle call does not have the intended effect and throws ObjectKeyNotFound. We've added it to the list of fixes for version 3.0 (scheduled to come out in May).

    Regards,
    ANVEL Support



  • Now that ANVEL 3.0 is out, the issue found here has been fixed.

    trackVeh = anv.CreateObject('HMMWV2', 'Tracking', 0, Point3(-113.72, -110.75,0.32144400000000001), Euler(0, 0, 0), True)
    roamVeh = anv.CreateObject('Generic 4x4', 'Roaming', 0, Point3(-107.669, -184.566, -0.48190300000000003), Euler(0, 0, 0), True)
    
    trackPath = anv.CreatePath('TrackingPath', trackingPath())
    roamPath = anv.CreatePath('RoamingPath', roamingPath())
    
    anv.SendStringCommandParamList('FollowPath', [str(roamVeh.objectKey), str(roamPath.objectKey), '6'])
    anv.SendStringCommandParamList('FollowPath', [str(trackVeh.objectKey), str(trackPath.objectKey),'6'])
    
    
    anv.SetSimulationState(SimulationState.RUNNING_REALTIME)
    

    Here is the above script slightly modified to run in the new ANVEL 3.0. This is confirmed to work with no exception thrown.

    Regards,
    ANVEL Support


Log in to reply
 

Looks like your connection to ANVEL Forum was lost, please wait while we try to reconnect.