Commits

iorodeo committed 134302f

Added logger for inertial trajectory mode.

Comments (0)

Files changed (7)

software/data_loggers/launch/inertial_logger.launch

+<launch>
+  <node name="inertial_logger" pkg="data_loggers" type="inertial_logger.py"/>
+</launch>

software/data_loggers/nodes/captive_logger.py

 
     def create_hdf5_logger(self):
         """
-        Creates hdf5 data logger, adds all groups, datasets and attributes 
-        except the analog input dataset which because of its possibly variable
-        size is created on the first callback of the analog input message.
+        Creates hdf5 data logger. 
         """
         super(Captive_Logger,self).create_hdf5_logger()
 
+        self.logger.add_attribute(self.trial_info_path, 'mode', 'captive trajectory')
+
         # Set mass and damping parameters
         rospy.wait_for_service('get_dynam_params')
         try: 

software/data_loggers/nodes/inertial_logger.py

+#!/usr/bin/env python
+"""
+Data logger for inertial trajectory mode. 
+"""
+import roslib 
+roslib.load_manifest('data_loggers')
+import rospy
+import os
+import os.path
+from position_logger import Position_Logger
+
+class Inertial_Logger(Position_Logger):
+
+    def create_hdf5_logger(self):
+        """
+        Creates hdf5 data logger. 
+        """
+        super(Captive_Logger,self).create_hdf5_logger()
+        self.logger.add_attribute(self.trial_info_path, 'mode', 'inertial trajectory')
+
+# -----------------------------------------------------------------------------
+if __name__ == '__main__':
+
+    logger = Inertial_Logger()
+    logger.init_node()
+    try:
+        logger.run()
+    except rospy.ROSInterruptException:
+        pass
+
+
+
+
+
+        

software/data_loggers/nodes/position_logger.py

 
     def create_hdf5_logger(self):
         """
-        Creates hdf5 data logger, adds all groups, datasets and attributes 
-        except the analog input dataset which because of its possibly variable
-        size is created on the first callback of the analog input message.
+        Creates hdf5 data logger. 
         """
         super(Position_Logger,self).create_hdf5_logger()
 

software/gui/nodes/gui_constants.py

 ALLOWED_STARTUP_MODES = [
         'captive trajectory',
         'position trajectory',
-        'inertial sled',
+        'inertial trajectory',
         ]
 
 # Timer update rates (ms)

software/wc_config/launch/gui_devel_interial_trajectory.launch

     <include file="$(find setpt_source)/launch/setpt_action_server.launch"/>
     <include file="$(find actuator_source)/launch/actuator_action_server.launch"/>
 
-    <include file="$(find data_loggers)/launch/position_logger.launch" />
+    <include file="$(find data_loggers)/launch/inertial_logger.launch" />
     <include file="$(find sled_io)/launch/sled_io.launch" />
 </launch>

software/wc_config/launch/gui_inertial_trajectory.launch

+<launch> 
+    <!-- Load parameters -->
+    <include file="$(find water_channel_params)/params.xml" />
+    <include file="$(find wc_config)/params/wc_params.xml" />
+
+    <!-- Launch Nodes -->
+    <include file="$(find distance_118x)/launch/distance_sensor.launch" />
+    <include file="$(find safety)/launch/bounds_checker.launch" />
+    <include file="$(find safety)/launch/watchdog_pulse.launch" />
+    <include file="$(find setpt_source)/launch/setpt_rel_to_abs.launch" />
+    <include file="$(find setpt_source)/launch/setpt_laser_source.launch" />
+    <include file="$(find motor_cmd_source)/launch/position_controller.launch"/>
+    <include file="$(find motor_cmd_source)/launch/joystick.launch"/>
+    <include file="$(find setpt_source)/launch/setpt_action_server.launch"/>
+    <include file="$(find actuator_source)/launch/actuator_action_server.launch"/>
+    <include file="$(find data_loggers)/launch/inertial_logger.launch" />
+    <include file="$(find sled_io)/launch/sled_io.launch" />
+    <include file="$(find gui)/launch/gui.launch">
+        <arg name="startup_mode" value="'inertial trajectory'" />
+    </include>
+</launch>