21 from data_collection
import JointStateDataKraken
22 from data_collection
import ObstacleDistanceDataKraken
23 from data_collection
import TwistDataKraken
24 from data_collection
import JointVelocityDataKraken
27 if __name__==
"__main__":
28 rospy.init_node(
"collect_twist_control_eval_data")
30 base_dir =
'/home/fxm-mb/Scripts/Tests/FinalTests/' 31 if rospy.has_param(
'~base_dir'):
32 base_dir = rospy.get_param(
'~base_dir')
34 rospy.logwarn(
'Could not find parameter ~base_dir. Using default base_dir: ' + base_dir)
36 data_krakens = [JointStateDataKraken(base_dir +
'joint_state_data.csv'),
37 ObstacleDistanceDataKraken(base_dir +
'obst_dist_data.csv'),
38 TwistDataKraken(base_dir +
'twist_data.csv'),
39 JointVelocityDataKraken(base_dir +
'joint_vel_data.csv'), ]
42 for data_kraken
in data_krakens:
43 status_open = status_open
and data_kraken.open()
45 rospy.loginfo(
'Subscribers started for data collection ... \nPress CTRL+C to stop program and write data to the file.')
48 while not rospy.is_shutdown():
50 except (KeyboardInterrupt, SystemExit)
as e:
51 rospy.loginfo(
'KeyboardInterrupt / SystemExit: ' + str(e))
53 for data_kraken
in data_krakens:
54 data_kraken.writeAllData()
56 rospy.logerr(
'Else exception.')
58 for data_kraken
in data_krakens:
59 data_kraken.writeAllData()
61 rospy.logerr(
'Failed to open DataKraken files.')