-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Aidan Curtis
committed
May 1, 2024
1 parent
444149d
commit 4eac104
Showing
5 changed files
with
73 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
"""Scan the scene using only the gripper camera, segment the scene with an | ||
image scene segmentation network, project the segmentations into a 3d | ||
pointcloud, and visualize the segmented pointcloud.""" | ||
|
||
from spot_utils.controllers.startup import DEFAULT_SPOT_IP, RobotClient | ||
from spot_utils.perception.capture import capture_rgbd, save_rgbd | ||
import bosdyn | ||
from bosdyn.client.image import ImageClient | ||
import os | ||
import time | ||
|
||
if __name__ == "__main__": | ||
|
||
cameras = ["frontleft", "frontright"] | ||
print("setting up robot") | ||
bosdyn.client.util.setup_logging(False) | ||
sdk = bosdyn.client.create_standard_sdk("RobotClient") | ||
robot = sdk.create_robot(DEFAULT_SPOT_IP) | ||
|
||
bosdyn.client.util.authenticate(robot) | ||
robot.time_sync.wait_for_sync() | ||
|
||
save_dir = "./outputs_ood" | ||
os.makedirs(save_dir, exist_ok=True) | ||
|
||
while(True): | ||
input("Capture image?") | ||
time_str = str(time.time()) | ||
for camera_name in cameras: | ||
image_client = robot.ensure_client(ImageClient.default_service_name) | ||
robot_client = RobotClient(robot=robot, sdk=sdk, image_client=image_client) | ||
rgbd = capture_rgbd(robot_client, camera=camera_name) | ||
save_rgbd(rgbd=rgbd, save_name=time_str, save_dir=os.path.join(save_dir, camera_name)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters