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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ],
80 [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ],
81 [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ],
82 [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ],
86 coordinates[2][0] = (coordinates[1][0] + coordinates[1][3] + coordinates[3][0]) / 2
87 coordinates[2][1] = coordinates[3][1]
88 coordinates[2][2] = (coordinates[1][2] + coordinates[3][2] + coordinates[3][5]) / 2
89 coordinates[2][3] = (coordinates[1][0] + coordinates[1][3] - coordinates[3][0]) / 2
91 coordinates[2][5] = (coordinates[1][2] - coordinates[3][2] - coordinates[3][5]) / 2
93 coordinates[2][i] = coordinates[3][i]
97 coordinates[dest] = list(coordinates[src])
98 coordinates[dest][2] = -coordinates[dest][2]
99 coordinates[dest][5] = -coordinates[dest][5]
101 coordinates[dest][6] = -coordinates[dest][6]
102 coordinates[dest][7] = -coordinates[dest][7]
111 coordinates[dest] = list(coordinates[src])
113 coordinates[dest][i] = coordinates[dest][i] + 2 * dir * coordinates[dest][i + 3 * k]
118 for i
in range(10, 22):
122 for i
in range(0,22):
124 coordinates[i][0] = coordinates[i][0] - 4
125 coordinates[i][1] = coordinates[i][1] - 15
127 coordinates[i][2] = -coordinates[i][2]
128 coordinates[i][5] = -coordinates[i][5]
129 coordinates[i][6] = -coordinates[i][6]
130 coordinates[i][7] = -coordinates[i][7]
133 for i
in range(0, len(data)):
134 data[i].y = data[i].y * ori
135 data[i].z = data[i].z * ori
139 for j
in range(0,len(coordinates)):
141 v.x = coordinates[j][i] / 1000.;
142 v.y = coordinates[j][i+1] / 1000.;
143 v.z = coordinates[j][i+2] / 1000.;
148 msg = PressureInfoElement()
149 msg.frame_id = frame_id
150 msg.force_per_unit = force_per_unit_table
def multorientation(data, ori)
def pressureInformation(frame_id, orientation)
def translate(src, dest, dir, k)