Skip to content

Commit ac12e8e

Browse files
authored
Merge pull request #45 from LucaKro/robot_view_checkup
Robot view checkup
2 parents 0ea72fb + a1f390f commit ac12e8e

11 files changed

Lines changed: 810 additions & 609 deletions

File tree

src/semantic_world/adapters/urdf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ def parse(self) -> World:
9494
links = [self.parse_link(link, PrefixedName(link.name, self.parsed.name)) for link in self.parsed.links]
9595
root = [link for link in links if link.name.name == self.parsed.get_root()][0]
9696
world = World()
97+
world.name = self.prefix
9798
world.add_body(root)
9899

99100
with world.modify_world():

src/semantic_world/graph_of_convex_sets.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@
66

77
from .geometry import BoundingBox, BoundingBoxCollection
88
from .variables import SpatialVariables
9-
from .views import MultiBodyView
109
from .world import World
11-
from .world_entity import View
10+
from .world_entity import View, EnvironmentView
1211

1312
logger = logging.getLogger(__name__)
1413

@@ -225,8 +224,7 @@ def obstacles_of_world(cls, world: World, search_space: Optional[BoundingBoxColl
225224
226225
:return: An event representing the obstacles in the search space.
227226
"""
228-
world_view = MultiBodyView()
229-
[world_view.add_body(body) for body in world.bodies]
227+
world_view = EnvironmentView(root=world.root)
230228
return cls.obstacles_from_views(world_view, search_space=search_space, bloat_obstacles=bloat_obstacles)
231229

232230

@@ -360,8 +358,7 @@ def free_space_from_world(cls, world: World, tolerance=.001, search_space: Optio
360358
:return: The connectivity graph.
361359
"""
362360

363-
view = MultiBodyView()
364-
[view.add_body(body) for body in world.bodies]
361+
view = EnvironmentView(root=world.root, _world=world)
365362

366363
return cls.free_space_from_view(view, tolerance=tolerance, search_space=search_space,
367364
bloat_obstacles=bloat_obstacles)
@@ -437,8 +434,7 @@ def navigation_map_from_world(cls, world: World, tolerance=.001,
437434
:return: The connectivity graph.
438435
"""
439436

440-
view = MultiBodyView()
441-
[view.add_body(body) for body in world.bodies]
437+
view = EnvironmentView(root=world.root, _world=world)
442438

443439
return cls.navigation_map_from_view(view, tolerance=tolerance, search_space=search_space,
444440
bloat_obstacles=bloat_obstacles)

src/semantic_world/orm/ormatic_interface.py

Lines changed: 241 additions & 259 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)