1

I am trying to do route planning with Rinsim. And I want to take collisionAvoidance into account, So I load the map by this method (because it seems collisionAvoidance is only supported in dynamicGraph):

private static ListenableGraph<LengthData> loadGrDynamicGraph(String name){
    try {
        Graph<LengthData>  g = DotGraphIO.getLengthGraphIO(Filters.selfCycleFilter())
                .read(DDRP.class.getResourceAsStream(name));
        return new ListenableGraph<>(g);

    }catch (Exception e){

    }
    return null;
}

and I set the vehicle length as 1d and the distance Unit as SI.METER. And it ends up with the following error.

Exception in thread "main" java.lang.IllegalArgumentException: Invalid graph: the minimum connection length is 1.0, connection (3296724.2131123254,2.5725043247255992E7)->(3296782.7337179,2.5724994399343655E7) defines length data that is too short: 0.8.

at com.google.common.base.Preconditions.checkArgument(Preconditions.java:146) at com.github.rinde.rinsim.core.model.road.CollisionGraphRoadModelImpl.checkConnectionLength(CollisionGraphRoadModelImpl.java:261) at com.github.rinde.rinsim.core.model.road.RoadModelBuilders$CollisionGraphRMB.build(RoadModelBuilders.java:702) at com.github.rinde.rinsim.core.model.road.RoadModelBuilders$CollisionGraphRMB.build(RoadModelBuilders.java:606) at com.github.rinde.rinsim.core.model.DependencyResolver$Dependency.build(DependencyResolver.java:223) at com.github.rinde.rinsim.core.model.DependencyResolver$Dependency.(DependencyResolver.java:217) at com.github.rinde.rinsim.core.model.DependencyResolver.add(DependencyResolver.java:71) at com.github.rinde.rinsim.core.model.ModelManager$Builder.doAdd(ModelManager.java:231) at com.github.rinde.rinsim.core.model.ModelManager$Builder.add(ModelManager.java:212) at com.github.rinde.rinsim.core.Simulator$Builder.addModel(Simulator.java:324) at com.github.rinde.rinsim.examples.project.DDRP.run(DDRP.java:86) at com.github.rinde.rinsim.examples.project.DDRP.main(DDRP.java:60) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)

I tried to change the vehicle length, but the error still exit. Does anyone know how to overcome this error?

Thank you

yihang.zhu
  • 27
  • 4

1 Answers1

0

A graph from OpenStreetMap (such as the map of Leuven) is not meant to be used in combination with the CollisionGraphRoadModel that you are trying to use. The reason is that the CollsionGrahpRoadModel is meant for a warehouse-like environment, not a public street. This model doesn't support multiple parallel lanes which is unrealistic in a city. The WarehouseExample defines two example graphs that can be used in combination with the CollsionGrahpRoadModel.

rinde
  • 1,181
  • 1
  • 8
  • 20