traversable_map
TraversableMap
Bases: BaseMap
Traversable scene class. Contains the functionalities for navigation such as shortest path computation
Source code in omnigibson/maps/traversable_map.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 |
|
n_floors
property
Returns:
Type | Description |
---|---|
int
|
Number of floors belonging to this map's associated scene |
__init__(map_resolution=0.1, default_erosion_radius=0.0, trav_map_with_objects=True, num_waypoints=10, waypoint_resolution=0.2)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
map_resolution
|
float
|
map resolution in meters, each pixel represents this many meters; normally, this should be between 0.01 and 0.1 |
0.1
|
default_erosion_radius
|
float
|
default map erosion radius in meters |
0.0
|
trav_map_with_objects
|
bool
|
whether to use objects or not when constructing graph |
True
|
num_waypoints
|
int
|
number of way points returned |
10
|
waypoint_resolution
|
float
|
resolution of adjacent way points |
0.2
|
Source code in omnigibson/maps/traversable_map.py
get_random_point(floor=None, reference_point=None, robot=None)
Sample a random point on the given floor number. If not given, sample a random floor number. If @reference_point is given, sample a point in the same connected component as the previous point.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
floor
|
None or int
|
floor number. None means the floor is randomly sampled Warning: if @reference_point is given, @floor must be given; otherwise, this would lead to undefined behavior |
None
|
reference_point
|
3 - array
|
(x,y,z) if given, sample a point in the same connected component as this point |
None
|
Returns:
Type | Description |
---|---|
2 - tuple
|
|
Source code in omnigibson/maps/traversable_map.py
get_shortest_path(floor, source_world, target_world, entire_path=False, robot=None)
Get the shortest path from one point to another point. If any of the given point is not in the graph, add it to the graph and create an edge between it to its closest node.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
floor
|
int
|
floor number |
required |
source_world
|
2 - array
|
(x,y) 2D source location in world reference frame (metric) |
required |
target_world
|
2 - array
|
(x,y) 2D target location in world reference frame (metric) |
required |
entire_path
|
bool
|
whether to return the entire path |
False
|
robot
|
None or BaseRobot
|
if given, erode the traversability map to account for the robot's size |
None
|
Returns:
Type | Description |
---|---|
2 - tuple
|
|