Commits

iorodeo  committed 92e0f5f

Fixed some issues with inertial trajectory mode.

  • Participants
  • Parent commits 9798ac8

Comments (0)

Files changed (6)

File software/data_loggers/nodes/inertial_logger.py

         """
         Creates hdf5 data logger. 
         """
-        super(Captive_Logger,self).create_hdf5_logger()
+        super(Inertial_Logger,self).create_hdf5_logger()
         self.logger.add_attribute(self.trial_info_path, 'mode', 'inertial trajectory')
 
 # -----------------------------------------------------------------------------

File software/gui/nodes/sled_control.py

             pass
             # ---------------------------------------------------
             # Disabled to prevent the curious for breaking shit
-            #self.startOutscan(values, 'actuator')
+            self.startOutscan(values, 'actuator')
             # ----------------------------------------------------
         else:
             raise ValueError, 'unknown startup mode'

File software/setpt_source/nodes/setpt_laser_source.py

         self.setpt_sign = rospy.get_param('laser_setpt_sign', -1.0)
         self.setpt_msg = SetptMsg()
 
+        self.distance = None
         self.velocity = None
         self.ready = False
         self.enabled = False
         Handles incoming analog input messages. Converts the analog inputs to a
         set point signal to be published on the setpt topic.
         """
-        if not self.ready or self.velocity is None:
+        if not self.ready or self.distance is None:
             return
         ain = data.values[self.ain_num] - self.laser_ain_offset
         pos = ain*self.laser_cal + self.laser_range_start
         setpt_pos = self.setpt_sign*(pos - self.setpt_offset)
 
         with self.lock:
+            distance = self.distance
             velocity = self.velocity
             enabled = self.enabled
+
+        setpt_pos = setpt_pos + distance
     
         if enabled:
             self.setpt_msg.header.stamp = rospy.get_rostime()
             self.setpt_msg.position = setpt_pos 
-            self.setpt_msg.velocity = velocity 
+            self.setpt_msg.velocity = 0.0 #velocity 
             self.setpt_pub.publish(self.setpt_msg)
 
     def handle_dist_msg(self,data):
         if not self.ready:
             return
         with self.lock:
+            self.distance = data.distance
             self.velocity = data.velocity_kalman
 
+
     def run(self):
         rospy.spin()
 

File software/utilities/src/utilities/run_converter.py

         if mode == 'position trajectory':
             self.get = self.getPositionRun
         elif mode == 'captive trajectory':
-            self.get = self.getCaptiveRun
-        elif mode == 'inertial sled':
-            self.get = self.getIntertialRun
+            self.get = self.getActuatorRun
+        elif mode == 'inertial trajectory':
+            self.get = self.getActuatorRun
         else:
             raise ValueError, 'unknown mode %s'%(mode,)
         self.dt = dt
 
         return setptValues
 
-    def getCaptiveRun(self,run,*arg):
+    def getActuatorRun(self,run,*arg):
         """
         Run converter for 'captive trajectory' mode
         """
             raise ValueError, 'unknown run type %s for mode %s'%(runType,self.mode)
         return valueArray
 
-    def getInertialRun(self,run,startPos):
-        """
-        Run convert for 'inertial sled' mode
-        """
-        pass
-
 
 def shift2StartPos(values,startPos):
     return  values - values[0] + startPos

File software/wc_config/launch/gui_devel_interial_trajectory.launch

 <launch> 
     <!-- Load parameters -->
-    <include file="$(find water_channel_params)/params.xml" />
+    <include file="$(find water_channel_params)/inertial_params.xml" />
     <include file="$(find wc_config)/params/wc_params.xml" />
 
     <!-- Launch Nodes -->

File software/wc_config/launch/gui_inertial_trajectory.launch

 <launch> 
     <!-- Load parameters -->
-    <include file="$(find water_channel_params)/params.xml" />
+    <include file="$(find water_channel_params)/inertial_params.xml" />
     <include file="$(find wc_config)/params/wc_params.xml" />
 
     <!-- Launch Nodes -->