Skip to content

Commit

Permalink
success! it works!
Browse files Browse the repository at this point in the history
  • Loading branch information
NishanthJKumar committed Jul 26, 2023
1 parent f9bba6a commit 7db4069
Show file tree
Hide file tree
Showing 3 changed files with 344 additions and 379 deletions.
6 changes: 3 additions & 3 deletions predicators/envs/spot_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,20 +313,20 @@ def _build_observation(self,
may vary per environment.
"""
# Get the camera images.
rgb_img_dict, rgb_img_response_dict, _, depth_img_response_dict = self._spot_interface.get_camera_images(
rgb_img_dict, rgb_img_response_dict, depth_img_dict, depth_img_response_dict = self._spot_interface.get_camera_images(
)

# Detect objects using AprilTags (which we need for surfaces anyways).
object_names_in_view_by_camera = {}
object_names_in_view_by_camera_apriltag = \
self._spot_interface.get_objects_in_view_by_camera\
(from_apriltag=True, rgb_image_dict=rgb_img_dict, rgb_image_response_dict=rgb_img_response_dict, depth_image_response_dict=depth_img_response_dict)
(from_apriltag=True, rgb_image_dict=rgb_img_dict, rgb_image_response_dict=rgb_img_response_dict, depth_image_dict=depth_img_dict, depth_image_response_dict=depth_img_response_dict)
object_names_in_view_by_camera.update(
object_names_in_view_by_camera_apriltag)
# Additionally, if we're using SAM, then update using that.
if CFG.spot_grasp_use_sam:
object_names_in_view_by_camera_sam = self._spot_interface.\
get_objects_in_view_by_camera(from_apriltag=False, rgb_image_dict=rgb_img_dict, rgb_image_response_dict=rgb_img_response_dict, depth_image_response_dict=depth_img_response_dict)
get_objects_in_view_by_camera(from_apriltag=False, rgb_image_dict=rgb_img_dict, rgb_image_response_dict=rgb_img_response_dict, depth_image_dict=depth_img_dict, depth_image_response_dict=depth_img_response_dict)
# Combine these together to get all objects in view.
for k, v in object_names_in_view_by_camera.items():
v.update(object_names_in_view_by_camera_sam[k])
Expand Down
Loading

0 comments on commit 7db4069

Please sign in to comment.