Skip to content

Commit

Permalink
fix serialization for PrimitiveObject, initialize visual markers for …
Browse files Browse the repository at this point in the history
…nav task
  • Loading branch information
ChengshuLi committed Oct 22, 2022
1 parent 014b2a3 commit 129b28e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions igibson/objects/primitive_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,3 +356,12 @@ def _deserialize(self, state):
state_dict["height"] = state[idx + 1]
state_dict["size"] = state[idx + 2]
return state_dict, idx + 3

def _serialize(self, state):
# Run super first
state_flat = super()._serialize(state=state)

return np.concatenate([
state_flat,
np.array([state["radius"], state["height"], state["size"]]),
])
3 changes: 3 additions & 0 deletions igibson/tasks/point_navigation_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ def _load_visualization_markers(self, env):
# Store waypoints
self._waypoint_markers = waypoints

# Take one sim step to initialize all the markers
ig.sim.step()

def _sample_initial_pose_and_goal_pos(self, env, max_trials=100):
"""
Potentially sample the robot initial pos / ori and target pos, based on whether we're using randomized
Expand Down

0 comments on commit 129b28e

Please sign in to comment.