From 4a6d2057a1bb690ec84938a5cfb24fe8af13ff9b Mon Sep 17 00:00:00 2001 From: Maiort Date: Thu, 19 Jul 2018 14:33:10 +0200 Subject: [PATCH 1/2] fixed time_stamp accuracy only had a precision of 2 digits for the time_stamp -> now 9 --- hand_eye_calibration/bin/tf_to_csv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hand_eye_calibration/bin/tf_to_csv.py b/hand_eye_calibration/bin/tf_to_csv.py index 2e546db..a51ed04 100755 --- a/hand_eye_calibration/bin/tf_to_csv.py +++ b/hand_eye_calibration/bin/tf_to_csv.py @@ -66,7 +66,7 @@ def write_transformation_to_csv_file(bag_file, target_frame, source_frame, # Write to csv file. quaternion = np.array(hamilton_quaternion) csv_file.write( - str(single_tf.header.stamp.to_sec()) + ', ' + + str("{:.9f}".format(single_tf.header.stamp.to_nsec()/1000000000.0)) + ', ' + str(translation[0]) + ', ' + str(translation[1]) + ', ' + str(translation[2]) + ', ' + str(quaternion[0]) + ', ' + str(quaternion[1]) + ', ' + str(quaternion[2]) + ', ' + From 84805559cd2481c64189c9a976fa4cd001182dbb Mon Sep 17 00:00:00 2001 From: Maiort Date: Sun, 29 Jul 2018 12:19:58 +0200 Subject: [PATCH 2/2] to_nsec -> to_sec --- hand_eye_calibration/bin/tf_to_csv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hand_eye_calibration/bin/tf_to_csv.py b/hand_eye_calibration/bin/tf_to_csv.py index a51ed04..aac27bc 100755 --- a/hand_eye_calibration/bin/tf_to_csv.py +++ b/hand_eye_calibration/bin/tf_to_csv.py @@ -66,7 +66,7 @@ def write_transformation_to_csv_file(bag_file, target_frame, source_frame, # Write to csv file. quaternion = np.array(hamilton_quaternion) csv_file.write( - str("{:.9f}".format(single_tf.header.stamp.to_nsec()/1000000000.0)) + ', ' + + str("{:.9f}".format(single_tf.header.stamp.to_sec())) + ', ' + str(translation[0]) + ', ' + str(translation[1]) + ', ' + str(translation[2]) + ', ' + str(quaternion[0]) + ', ' + str(quaternion[1]) + ', ' + str(quaternion[2]) + ', ' +