Skip to content

Commit

Permalink
fix[urdfenvs]: Assumes sphere type for obstacles, as the type cannot …
Browse files Browse the repository at this point in the history
…be wrapped as a observation. Wait for fix in urdfenvs.
  • Loading branch information
maxspahn committed May 10, 2023
1 parent 2b31076 commit 5e603c5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion examples/panda_robot_with_obstacles.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def initalize_environment(cfg):
# sense both
sensor = FullSensor(
goal_mask=["position"],
obstacle_mask=["position", "velocity", "type", "size"],
obstacle_mask=["position", "velocity", "size"],
variance=0.0,
)
env.add_sensor(sensor, [0])
Expand Down
25 changes: 13 additions & 12 deletions examples/point_robot_with_obstacle.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,18 @@ def initalize_environment(cfg) -> UrdfEnv:
sphereObst = SphereObstacle(name="simpleSphere", content_dict=obst1Dict)
env.add_obstacle(sphereObst)

obst2Dict = {
"type": "box",
"geometry": {
"position": [1.0, 2.0, 0.0],
"width": 0.3,
"height": 0.2,
"length": 1.0,
},
}
boxObst = BoxObstacle(name="simpleBox", content_dict=obst2Dict)
env.add_obstacle(boxObst)
# TODO: Allow for non-sphere obstacles. Wait for update of urdfenvs.
# obst2Dict = {
# "type": "box",
# "geometry": {
# "position": [1.0, 2.0, 0.0],
# "width": 0.3,
# "height": 0.2,
# "length": 1.0,
# },
# }
# boxObst = BoxObstacle(name="simpleBox", content_dict=obst2Dict)
# env.add_obstacle(boxObst)
goal_dict = {
"weight": 1.0,
"is_primary_goal": True,
Expand All @@ -108,7 +109,7 @@ def initalize_environment(cfg) -> UrdfEnv:
# sense both
sensor = FullSensor(
goal_mask=["position"],
obstacle_mask=["position", "velocity", "type", "size"],
obstacle_mask=["position", "velocity", "size"],
variance=0.0,
)
env.add_sensor(sensor, [0])
Expand Down
2 changes: 1 addition & 1 deletion mppiisaac/planner/isaacgym_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ def update_root_state_tensor_by_obstacles(self, obstacles):
for i, obst in enumerate(list(obstacles.values())):
pos = obst['position']
vel = obst['velocity']
o_type = obst['type']
o_type = 'sphere'
o_size = obst['size']
name = f"{o_type}{i}"
try:
Expand Down

0 comments on commit 5e603c5

Please sign in to comment.