Skip to content

Commit 4c03109

Browse files
committed
many edits, too lazy to comment
1 parent 8ada4d5 commit 4c03109

File tree

4 files changed

+447
-81
lines changed

4 files changed

+447
-81
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"mass":0.5,"centerOfMass":[0,0,0.0467],"transformation":[0.70710678,0.70710678,0,0,-0.70710678,0.70710678,0,0,0,0,1,0,0.00707107,-0.00707107,0.116,1],"inertia":[0.000466,0,0,0,0.000466,0,0,0,0.0002294]}

franka_description/meshes/visual/FTSensorPlusWiderLineEndEffector.dae

+124-69
Large diffs are not rendered by default.

franka_description/meshes/visual/FTSensorPlusWiderLineEndEffector_old.dae

+299
Large diffs are not rendered by default.

src/PlottingandVisualization/realsense_liveplot_publish_ground_truth.py

+23-12
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def apriltag_message_callback(apriltag_array):
108108
global base_in_base_pose
109109
global cam_in_base_pose
110110
global marker_pose_apriltag_frame
111-
global obj_orientation_matrix
111+
global obj_pose_homog
112112
global object_detected
113113

114114
obj_apriltag_list = [
@@ -133,7 +133,7 @@ def apriltag_message_callback(apriltag_array):
133133
obj_apriltag_in_world_pose,
134134
frame_id="base")
135135

136-
obj_orientation_matrix = ros_helper.matrix_from_pose(
136+
obj_pose_homog = ros_helper.matrix_from_pose(
137137
marker_apriltag_in_world_pose)
138138

139139
else:
@@ -390,7 +390,7 @@ def plot_hand_friction_cone(cv_image,COP_point_hand_frame,friction_parameter_dic
390390

391391
x_coord, y_coord = get_pix_easier(
392392
np.dot(contact_pose_homog, left_boundary_list),
393-
transformation_matrix)
393+
camera_transformation_matrix)
394394
cv2.polylines(cv_image, [np.vstack([x_coord, y_coord]).T],
395395
True, (0, 255, 0),
396396
thickness=2)
@@ -410,7 +410,7 @@ def plot_hand_friction_cone(cv_image,COP_point_hand_frame,friction_parameter_dic
410410

411411
x_coord, y_coord = get_pix_easier(
412412
np.dot(contact_pose_homog, right_boundary_list),
413-
transformation_matrix)
413+
camera_transformation_matrix)
414414
cv2.polylines(cv_image, [np.vstack([x_coord, y_coord]).T],
415415
True, (0, 255, 0),
416416
thickness=2)
@@ -449,12 +449,21 @@ def plot_ground_friction_cone(cv_image,COP_ground,friction_parameter_dict,camera
449449
])
450450

451451
x_coord, y_coord = get_pix_easier(
452-
BoundaryPts, transformation_matrix)
452+
BoundaryPts, camera_transformation_matrix)
453453
cv2.polylines(cv_image,
454454
[np.vstack([x_coord, y_coord]).T],
455455
False, (0, 255, 0),
456456
thickness=2)
457457

458+
def shape_overlay(cv_image,obj_pose_homog,object_vertex_array,camera_transformation_matrix):
459+
vertex_positions_world = np.dot(obj_pose_homog,object_vertex_array)
460+
x_coord, y_coord = get_pix_easier(
461+
vertex_positions_world, camera_transformation_matrix)
462+
cv2.polylines(cv_image,
463+
[np.vstack([x_coord, y_coord]).T],
464+
True, (0, 255, 0),
465+
thickness=2)
466+
458467
#def plot_force():
459468

460469
#def plot_hand_slide_arrow():
@@ -482,7 +491,7 @@ def plot_impedance_target(cv_image,hand_points,target_pose_homog,camera_transfor
482491
base_in_base_pose = None
483492
cam_in_base_pose = None
484493
marker_pose_apriltag_frame = None
485-
obj_orientation_matrix = None
494+
obj_pose_homog = None
486495
object_detected = False
487496

488497
measured_contact_wrench_list = []
@@ -521,7 +530,7 @@ def plot_impedance_target(cv_image,hand_points,target_pose_homog,camera_transfor
521530
l_contact = sys_params.object_params["L_CONTACT_MAX"]
522531

523532
object_vertex_array, apriltag_id, apriltag_pos = load_shape_data(
524-
'triangle')
533+
'big_hexagon')
525534

526535
object_vertex_array = np.vstack([
527536
object_vertex_array,
@@ -818,7 +827,9 @@ def plot_impedance_target(cv_image,hand_points,target_pose_homog,camera_transfor
818827
x_coord = int(np.round(pix_x[0]))
819828
y_coord = int(np.round(pix_y[0]))
820829

821-
current_dot_positions = np.dot(obj_orientation_matrix,
830+
shape_overlay(cv_image,obj_pose_homog,object_vertex_array,transformation_matrix)
831+
832+
current_dot_positions = np.dot(obj_pose_homog,
822833
object_vertex_array)
823834

824835
hand_tangent_world = np.dot(contact_pose_homog, hand_tangent)
@@ -879,7 +890,7 @@ def plot_impedance_target(cv_image,hand_points,target_pose_homog,camera_transfor
879890
[0., 0., 0., 1.],
880891
])
881892
desired_dot_positions = np.dot(
882-
obj_orientation_matrix,
893+
obj_pose_homog,
883894
np.dot(my_rotation, temp_vertex_array))
884895

885896
if qp_debug_dict is not None and 'err_x_pivot' in qp_debug_dict[
@@ -930,13 +941,13 @@ def plot_impedance_target(cv_image,hand_points,target_pose_homog,camera_transfor
930941
Tau_a = np.dot(
931942
np.cross(P_a[0:3] - P_e[0:3],
932943
measured_base_wrench_6D[0:3]),
933-
obj_orientation_matrix[0:3, 2])
944+
obj_pose_homog[0:3, 2])
934945
Tau_b = np.dot(
935946
np.cross(P_b[0:3] - P_e[0:3],
936947
measured_base_wrench_6D[0:3]),
937-
obj_orientation_matrix[0:3, 2])
948+
obj_pose_homog[0:3, 2])
938949
Tau_net = np.dot(measured_base_wrench_6D[3:6],
939-
obj_orientation_matrix[0:3, 2])
950+
obj_pose_homog[0:3, 2])
940951

941952
epsilon1 = (Tau_net - Tau_b) / (Tau_a - Tau_b)
942953
epsilon1 = np.max([np.min([epsilon1, 1]), 0])

0 commit comments

Comments
 (0)