]> defiant.homedns.org Git - ros_wild_thumper.git/blobdiff - scripts/wt_node.py
motor_ctrl: break when going to fast
[ros_wild_thumper.git] / scripts / wt_node.py
index 3d1c972ea43a6eaf3c0bef5e4e2ad390f847b8e4..2de2f590141a0960a47d8bd6f14033accc73e0f2 100755 (executable)
@@ -79,6 +79,7 @@ class MoveBase:
                rospy.loginfo("Reset Status: 0x%x" % reset_val)
                i = 0
                while not rospy.is_shutdown():
                rospy.loginfo("Reset Status: 0x%x" % reset_val)
                i = 0
                while not rospy.is_shutdown():
+                       rospy.logdebug("Loop alive")
                        #print struct.unpack(">B", i2c_read_reg(0x50, 0xA2, 1))[0] # count test
                        self.get_motor_err()
                        self.get_odom()
                        #print struct.unpack(">B", i2c_read_reg(0x50, 0xA2, 1))[0] # count test
                        self.get_motor_err()
                        self.get_odom()
@@ -230,7 +231,9 @@ class MoveBase:
                i2c_write_reg(0x50, 0x50, struct.pack(">ff", trans, rot))
 
        def cmdVelReceived(self, msg):
                i2c_write_reg(0x50, 0x50, struct.pack(">ff", trans, rot))
 
        def cmdVelReceived(self, msg):
+               rospy.logdebug("Set new cmd_vel:", msg.linear.x, msg.angular.z)
                self.cmd_vel = (msg.linear.x, msg.angular.z) # commit speed on next update cycle
                self.cmd_vel = (msg.linear.x, msg.angular.z) # commit speed on next update cycle
+               rospy.logdebug("Set new cmd_vel done")
 
        # http://rn-wissen.de/wiki/index.php/Sensorarten#Sharp_GP2D12
        def get_dist_ir(self, num):
 
        # http://rn-wissen.de/wiki/index.php/Sensorarten#Sharp_GP2D12
        def get_dist_ir(self, num):