4 from geometry_msgs.msg
import PoseStamped
12 return concatenate_matrices(translation_matrix([pose.position.x,
15 quaternion_matrix([pose.orientation.x,
24 global f, initial_pose, world_pose
25 if world_pose ==
None:
26 rospy.loginfo(
"calibrating world coordinates")
29 C = concatenate_matrices(A, inverse_matrix(B))
33 new_A = concatenate_matrices(world_pose, pose)
35 diff_pos = translation_from_matrix(diff)
36 diff_rot = quaternion_from_matrix(diff)
37 f.write(
"%f, %f, %f, %f, %f, %f, %f\n" % (diff_pos[0], diff_pos[1],
44 if __name__ ==
"__main__":
45 rospy.init_node(
"dump_mocap")
46 file_name = rospy.get_param(
"~file_name",
"output.csv")
49 f = open(file_name,
"w")
50 sub = rospy.Subscriber(
"/Robot_1/pose", PoseStamped, callback)
def poseMsgToMatrix(pose)