Skip to content

Commit 5419c1f

Browse files
authored
Remove impedance control since it seems to break anything (#28)
1 parent 29562ed commit 5419c1f

File tree

2 files changed

+27
-33
lines changed

2 files changed

+27
-33
lines changed

spot_tools/examples/test_spot.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -440,20 +440,20 @@ def save_images_constant_rate(spot, object_name, folder_name, rate=1.0):
440440
spot.stand()
441441
# stow_arm(spot)
442442

443-
input("Make sure it's in a good position")
444-
pose = math_helpers.SE3Pose(
445-
x=0.2,
446-
y=0,
447-
z=0,
448-
rot=math_helpers.Quat.from_pitch(0) * math_helpers.Quat.from_roll(0),
449-
)
443+
# input("Make sure it's in a good position")
444+
# pose = math_helpers.SE3Pose(
445+
# x=0.2,
446+
# y=0,
447+
# z=0,
448+
# rot=math_helpers.Quat.from_pitch(0) * math_helpers.Quat.from_roll(0),
449+
# )
450450

451-
move_hand_to_relative_pose(spot, pose)
451+
# move_hand_to_relative_pose(spot, pose)
452452

453453
# _run_open_door_test(spot, yoloworld_model_path)
454454
# _run_walking_test(spot)
455455
# _run_gaze_test(spot)
456-
# _run_place_test(spot)
456+
_run_place_test(spot)
457457
# _run_traj_test(spot)
458458
# _run_grasp_test(spot)
459459
# _run_segment_test(spot)

spot_tools/src/spot_skills/grasp_utils.py

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,18 @@
1212
import bosdyn.client.lease
1313
import bosdyn.client.util
1414
import cv2
15-
import numpy as np
1615
from bosdyn.api import (
1716
geometry_pb2,
1817
manipulation_api_pb2,
1918
robot_state_pb2,
2019
)
2120
from bosdyn.client.frame_helpers import (
22-
ODOM_FRAME_NAME,
2321
VISION_FRAME_NAME,
2422
get_vision_tform_body,
2523
math_helpers,
2624
)
2725
from bosdyn.client.robot_command import RobotCommandBuilder, block_until_arm_arrives
2826

29-
from spot_skills.arm_impedance_control_helpers import (
30-
apply_force_at_current_position,
31-
get_root_T_ground_body,
32-
)
3327
from spot_skills.arm_utils import (
3428
arm_to_carry,
3529
arm_to_drop,
@@ -123,26 +117,26 @@ def object_place(spot, semantic_class="bag", position=None):
123117
stow_arm(spot)
124118
arm_to_drop(spot)
125119

126-
odom_T_task = get_root_T_ground_body(
127-
robot_state=spot.get_state(), root_frame_name=ODOM_FRAME_NAME
128-
)
129-
wr1_T_tool = math_helpers.SE3Pose(
130-
0.23589, 0, -0.03943, math_helpers.Quat.from_pitch(-np.pi / 2)
131-
)
132-
force_dir_rt_task = math_helpers.Vec3(0, 0, -1) # adjust downward force here
133-
robot_cmd = apply_force_at_current_position(
134-
force_dir_rt_task_in=force_dir_rt_task,
135-
force_magnitude=8,
136-
robot_state=spot.get_state(),
137-
root_frame_name=ODOM_FRAME_NAME,
138-
root_T_task=odom_T_task,
139-
wr1_T_tool_nom=wr1_T_tool,
140-
)
120+
# odom_T_task = get_root_T_ground_body(
121+
# robot_state=spot.get_state(), root_frame_name=ODOM_FRAME_NAME
122+
# )
123+
# wr1_T_tool = math_helpers.SE3Pose(
124+
# 0.23589, 0, -0.03943, math_helpers.Quat.from_pitch(-np.pi / 2)
125+
# )
126+
# force_dir_rt_task = math_helpers.Vec3(0, 0, -1) # adjust downward force here
127+
# robot_cmd = apply_force_at_current_position(
128+
# force_dir_rt_task_in=force_dir_rt_task,
129+
# force_magnitude=8,
130+
# robot_state=spot.get_state(),
131+
# root_frame_name=ODOM_FRAME_NAME,
132+
# root_T_task=odom_T_task,
133+
# wr1_T_tool_nom=wr1_T_tool,
134+
# )
141135

142136
# Execute the impedance command
143-
cmd_id = spot.command_client.robot_command(robot_cmd)
144-
spot.robot.logger.info("Impedance command issued")
145-
block_until_arm_arrives(spot.command_client, cmd_id, 10.0)
137+
# cmd_id = spot.command_client.robot_command(robot_cmd)
138+
# spot.robot.logger.info("Impedance command issued")
139+
# block_until_arm_arrives(spot.command_client, cmd_id, 10.0)
146140
input("Did impedance work")
147141

148142
open_gripper(spot)

0 commit comments

Comments
 (0)