Skip to content

Commit 1a13d85

Browse files
yay - works well!
1 parent 44cc5be commit 1a13d85

4 files changed

Lines changed: 75 additions & 8 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,6 @@ top-down-state-view.png
4242
# Jetbrains IDEs
4343
.idea/
4444
hand_image_failed_detection.png
45+
46+
# Spot wiping skill
47+
wipe_online_images_iphone/*

predicators/pretrained_model_interface.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ def _sample_completions(
303303
candidate_count=num_completions)
304304
if self._supports_thinking():
305305
config_kwargs["thinking_config"] = types.ThinkingConfig(
306-
thinking_budget=0)
306+
thinking_budget=128)
307307
config = types.GenerateContentConfig(**config_kwargs)
308308
with _GeminiTimeout(seconds=30):
309309
response = self._client.models.generate_content(
@@ -339,7 +339,7 @@ def _sample_completions(
339339
candidate_count=num_completions)
340340
if self._supports_thinking():
341341
config_kwargs["thinking_config"] = types.ThinkingConfig(
342-
thinking_budget=0)
342+
thinking_budget=128)
343343
config = types.GenerateContentConfig(**config_kwargs)
344344
with _GeminiTimeout(seconds=30):
345345
response = self._client.models.generate_content(
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"frame_convention": "T_hand_iphone (hand camera <- iphone camera)",
3+
"translation_m": [
4+
-0.013389742324134,
5+
-0.09071333609668566,
6+
-0.04515229560908661
7+
],
8+
"rotation_matrix": [
9+
[
10+
0.9998152515149991,
11+
0.0051358662617075794,
12+
-0.018522573140379982
13+
],
14+
[
15+
-0.0023931047569163704,
16+
0.9894048892806945,
17+
0.1451627986678386
18+
],
19+
[
20+
0.01907186114728439,
21+
-0.14509165360281362,
22+
0.9892343888923292
23+
]
24+
],
25+
"T_hand_iphone": [
26+
[
27+
0.9998152515149991,
28+
0.0051358662617075794,
29+
-0.018522573140379982,
30+
-0.013389742324134
31+
],
32+
[
33+
-0.0023931047569163704,
34+
0.9894048892806945,
35+
0.1451627986678386,
36+
-0.09071333609668566
37+
],
38+
[
39+
0.01907186114728439,
40+
-0.14509165360281362,
41+
0.9892343888923292,
42+
-0.04515229560908661
43+
],
44+
[
45+
0.0,
46+
0.0,
47+
0.0,
48+
1.0
49+
]
50+
],
51+
"std_inliers_m": [
52+
0.0013296844145321853,
53+
0.0015158110809706138,
54+
0.0005005343158977485
55+
]
56+
}

predicators/spot_utils/skills/spot_wipe_online_iphone.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
move_hand_to_relative_pose,
3333
move_hand_to_relative_pose_with_velocity,
3434
open_gripper,
35-
stow_arm,
3635
)
36+
from predicators.spot_utils.skills.spot_stow_arm import stow_arm
3737
from predicators.spot_utils.perception.spot_cameras import \
3838
_image_response_to_image
3939
from predicators.pretrained_model_interface import GoogleGeminiVLM
@@ -645,12 +645,9 @@ def get_bbox_from_gemini(
645645
List of [ymin, xmin, ymax, xmax] in pixel coordinates
646646
647647
"""
648-
# Ensure API key is set for Gemini
649-
# vlm = GoogleGeminiVLM("gemini-2.5-flash-preview-05-20")
648+
from predicators.settings import CFG
650649
print('inside the function to get the bbox from gemini')
651-
# vlm = GoogleGeminiVLM("gemini-2.5-flash")
652-
# vlm = GoogleGeminiVLM("gemini-2.0-flash")
653-
vlm = GoogleGeminiVLM("gemini-2.5-pro")
650+
vlm = GoogleGeminiVLM(CFG.vlm_model_name)
654651
def _parse_bbox_list(raw: str) -> list[float]:
655652
"""Parse a bbox dict {"bbox": [ymin, xmin, ymax, xmax]} from model output.
656653
Supports optional ```json fenced blocks. Returns raw numeric values
@@ -1055,7 +1052,18 @@ def main() -> None:
10551052
default=0.0,
10561053
help="Fraction to expand bbox in image space (e.g., 0.2 for +20%).",
10571054
)
1055+
parser.add_argument(
1056+
"--vlm_model_name",
1057+
type=str,
1058+
default="gemini-2.5-flash",
1059+
help="Gemini model name to use for VLM queries.",
1060+
)
10581061
args = parser.parse_args()
1062+
1063+
# Update CFG so get_bbox_from_gemini picks up the model name.
1064+
from predicators.settings import CFG
1065+
CFG.vlm_model_name = args.vlm_model_name
1066+
10591067
robot, lease_client, lease_keepalive = init_robot(args.hostname, "")
10601068

10611069
wipe_online(

0 commit comments

Comments
 (0)