Find paths indoors
The background regarding the navigation system is explained here.
Generating navigation graphs from images
If your environment is codified as an image, generating a navigation graph is straight-forward. All you have to do is mark the areas of the environment where to plant initial seeds in blue (RGB #0000FF). In the image below you can see the generation of a navigation graph. The blue regions in the original image indicate where to plant initial seeds. These are then grown and crossings are found between them.
Once you have your image ready for the generation of the navigation graph, you can exploit the
ImageEnvironmentWithGraph
class to produce it for you.
This will read your image, extract the positions you marked blue and pass them to the NaviGator algorithm.
Examples
Click to show / hide code
incarnation: protelis
environment:
type: ImageEnvironmentWithGraph
parameters: [images/building-planimetry.png, 0.1]
seeds:
scenario: 0
simulation: 1
_reactions: &behavior
- time-distribution:
type: DiracComb
parameters: [3.0]
type: PrioritySteering
actions:
- type: CognitiveAgentReachDestination
parameters: [135, 15]
deployments:
- type: Point
parameters: [15, 15]
properties:
- type: CircularArea
- type: Orienting2D
parameters: [1.0]
- type: Pedestrian
- type: Social
programs:
- *behavior
Click to show / hide code
incarnation: protelis
environment:
type: ImageEnvironmentWithGraph
parameters: [images/congestion-avoidance.png, 0.1]
seeds:
scenario: 0
simulation: 2
_reactions: &behavior
- time-distribution:
type: DiracComb
parameters: [1.0]
type: PrioritySteering
actions:
- type: CognitiveAgentReachKnownDestination
parameters: [10, 55]
deployments:
- type: Point
parameters: [70, 50]
properties:
- type: CircularArea
- type: Orienting2D
parameters: [1.0]
- type: Pedestrian
- type: Social
programs:
- *behavior
- type: Grid
parameters: [27, 52, 56, 58, 0.5, 0.5, 0.3, 0.3]
properties:
- type: Pedestrian
- type: Perceptive2D
- type: CircularArea
- type: Social
- type: Grid
parameters: [30, 40, 50, 45, 0.5, 0.5, 0.3, 0.3]
properties:
- type: Pedestrian
- type: Perceptive2D
- type: CircularArea
- type: Social
Click to show / hide code
incarnation: protelis
environment:
type: ImageEnvironmentWithGraph
parameters: [images/building-planimetry.png, 0.1]
seeds:
scenario: 0
simulation: 1
_reactions: &behavior
- time-distribution:
type: DiracComb
parameters: [3.0]
type: PrioritySteering
actions:
- type: CognitiveAgentExplore
deployments:
- type: Point
parameters: [15, 15]
properties:
- type: CircularArea
- type: Orienting2D
parameters: [0.0]
- type: Pedestrian
- type: Social
programs:
- *behavior
Click to show / hide code
incarnation: protelis
environment:
type: ImageEnvironmentWithGraph
parameters: [images/building-planimetry.png, 0.1]
seeds:
scenario: 0
simulation: 1
_reactions: &behavior
- time-distribution:
type: DiracComb
parameters: [3.0]
type: PrioritySteering
actions:
- type: CognitiveAgentFollowRoute
parameters: [40, 15, 60, 80, 70, 105, 85, 80]
deployments:
type: Point
parameters: [15, 15]
properties:
- type: CircularArea
- type: Orienting2D
parameters: [0.0]
- type: Pedestrian
- type: Social
programs: *behavior
Click to show / hide code
incarnation: protelis
environment:
type: ImageEnvironmentWithGraph
parameters: [images/congestion-avoidance.png, 0.1, 12, 60]
seeds:
scenario: 0
simulation: 2
_reactions: &behavior
- time-distribution:
type: DiracComb
parameters: [1.0]
type: OrientingBehavior2D
deployments:
- type: Circle
parameters: [130, 70, 52, 5]
nodes:
type: HomogeneousOrientingPedestrian2D
parameters: [1.0]
programs:
- *behavior
- type: Grid
parameters: [27, 52, 56, 58, 0.5, 0.5, 0.3, 0.3]
nodes:
type: HomogeneousPedestrian2D
- type: Grid
parameters: [30, 40, 50, 45, 0.5, 0.5, 0.3, 0.3]
nodes:
type: HomogeneousPedestrian2D
Click to show / hide code
incarnation: protelis
environment:
type: ImageEnvironmentWithGraph
parameters: [images/building-planimetry.png, 0.1]
seeds:
scenario: 0
simulation: 1
_reactions: &behavior
- time-distribution:
type: DiracComb
parameters: [3.0]
type: PrioritySteering
actions:
- type: CognitiveAgentReachDestination
parameters: [103, 99]
# destination is unknown as pedestrian's cognitive map is empty
deployments:
- type: Point
parameters: [108, 88]
properties:
- type: CircularArea
- type: Orienting2D
parameters: [0.0]
- type: Pedestrian
- type: Social
programs:
- *behavior
Click to show / hide code
incarnation: protelis
environment:
type: ImageEnvironmentWithGraph
parameters: [images/building-planimetry.png, 0.1]
seeds:
scenario: 0
simulation: 1
_reactions: &behavior
- time-distribution:
type: DiracComb
parameters: [3.0]
type: PrioritySteering
actions:
- type: CognitiveAgentReachDestination
parameters: [135, 15]
# destination is unknown as pedestrian's cognitive map is empty
deployments:
- type: Point
parameters: [15, 15]
properties:
- type: CircularArea
- type: Orienting2D
parameters: [0.0]
- type: Pedestrian
- type: Social
programs:
- *behavior
Click to show / hide code
incarnation: protelis
environment:
type: ImageEnvironmentWithGraph
parameters: [images/building-planimetry.png, 0.1]
seeds:
scenario: 0
simulation: 4
_reactions: &behavior
- time-distribution:
type: DiracComb
parameters: [3.0]
type: PrioritySteering
actions:
- type: CognitiveAgentReachKnownDestination
parameters: [135, 15]
deployments:
- type: Point
parameters: [15, 15]
properties:
- type: CircularArea
- type: Orienting2D
parameters: [0.3]
- type: Pedestrian
- type: Social
programs:
- *behavior
Click to show / hide code
incarnation: protelis
environment:
type: ImageEnvironmentWithGraph
parameters: [images/building-planimetry.png, 0.1]
seeds:
scenario: 0
simulation: 1
_reactions: &behavior
- time-distribution:
type: DiracComb
parameters: [3.0]
type: PrioritySteering
actions:
- type: CognitiveAgentPursue
parameters: [135, 15]
# Pursuing assumes the destination is known (despite the pedestrian's cognitive map is empty)
deployments:
type: Point
parameters: [15, 15]
properties:
- type: CircularArea
- type: Orienting2D
parameters: [0.0]
- type: Pedestrian
- type: Social
programs: *behavior
Click to show / hide code
incarnation: protelis
environment:
type: ImageEnvironmentWithGraph
parameters: [images/building-planimetry.png, 0.1]
seeds:
scenario: 0
simulation: 1
_reactions: &behavior
- time-distribution:
type: DiracComb
parameters: [3.0]
type: PrioritySteering
actions:
- type: CognitiveAgentReachDestination
parameters: [60, 40, 85, 15]
# (85, 15) will be known, (60, 40) won't be known but will be reached because found along the way to the former
deployments:
- type: Point
parameters: [15, 15]
properties:
- type: CircularArea
- type: Orienting2D
parameters: [0.4]
- type: Pedestrian
- type: Social
programs:
- *behavior
Click to show / hide code
incarnation: protelis
environment:
type: ImageEnvironmentWithGraph
parameters:
path: planimetry.png
zoom: 0.05
_reactions: &behavior
- time-distribution:
type: DiracComb
parameters: [1.0]
type: CognitiveBehavior
deployments:
- type: Point
parameters: [2, 2]
properties:
- type: Human
parameters: ["adult", "male"]
- type: Perceptive2D
- type: CognitivePedestrian
- type: Cognitive2D
- type: Orienting2D
parameters: [0.5]
programs:
- *behavior
Click to show / hide code
incarnation: protelis
environment:
type: ImageEnvironmentWithGraph
parameters:
path: planimetry.png
zoom: 0.05
deployments:
- type: Point
parameters: [2, 2]
properties:
- type: Pedestrian
- type: CircularArea
- type: Orienting2D
parameters: [0.5]
Click to show / hide code
incarnation: protelis
environment:
type: EnvironmentWithDynamics
parameters:
path: planimetry.png
zoom: 0.05
deployments:
- type: Point
parameters: [2, 2]
properties:
- type: Pedestrian
- type: PhysicalPedestrian2D
- type: Perceptive2D
- type: CircularArea
- type: Social
programs:
- time-distribution:
type: DiracComb
parameters: [1.0]
type: PhysicalBlendedSteering
actions:
- type: CognitiveAgentSeek
parameters: [1000, 500]
- type: CognitiveAgentFlee
parameters: [500, -500]