这个代码缩进有问题吗?还是别的有问题?

这次吧draw a square直接贴过来改,看到里面好多Tab和空格混用,照着它的格式又写一遍TAT,这次干脆什么都没有出来……这个应该不是缩进的问题吧?draw a square我是能运行的,下面是我的代码:

# -*- coding: UTF-8 -*- 
#!/usr/bin/env python


#前进1m,画边长( 0.5 )m的五边形

import rospy
from geometry_msgs.msg import Twist
from math import radians

class ROUTE():
    def __init__(self):
        # 初始化节点
        rospy.init_node('route', anonymous=False)

        # ctrl + c退出    
        rospy.on_shutdown(self.shutdown)

        self.cmd_vel = rospy.Publisher('cmd_vel_mux/input/navi', Twist, queue_size=10)

    # 5 HZ更新频率
        r = rospy.Rate(5);

    # 两个不同的Twist,转,直走

        # 0.5 m/s 前进
        move_cmd = Twist()
        move_cmd.linear.x = 0.5


        #旋转18 deg/s
        turn_cmd = Twist()
        turn_cmd.linear.x = 0
        turn_cmd.angular.z = radians(18);

    count = 0
    # 前进1M
    rospy.loginfo("前进ing")
        for x in range(0,10):
            self.cmd_vel.publish(move_cmd)
            r.sleep()
        while not rospy.is_shutdown():
        #转54度
        rospy.loginfo("转圈ing")
            for x in range(0,15):
                self.cmd_vel.publish(turn_cmd)
                r.sleep()            
        # 前进0.5M
        rospy.loginfo("前进ing")
            for x in range(0,5):
                self.cmd_vel.publish(move_cmd)
                r.sleep()
        # 转234度
        rospy.loginfo("准备拍照ing")
            for x in range(0,65):
                self.cmd_vel.publish(turn_cmd)
                r.sleep()            
        count = count + 1
        if(count == 5): 
                count = 0
        if(count == 0): 
                rospy.loginfo("是不是结束了?")

    def shutdown(self):
        # 停啦
        rospy.loginfo("停啦~")
        self.cmd_vel.publish(Twist())
        rospy.sleep(1)

if __name__ == '__main__':
    try:
        DrawASquare()
    except:
        rospy.loginfo("Bye~~")

结果不报错也没有提示语
图片说明
快疯了!!!这要还是没有加其他功能,光走一走怎么老是卡!!能不能跟我仔细讲讲到底哪里的问题!谢谢!!!

-*- coding: UTF-8 -*-

#!/usr/bin/env python

#前进1m,画边长( 0.5 )m的五边形

import rospy
from geometry_msgs.msg import Twist
from math import radians

class ROUTE():
def init(self):
# 初始化节点
rospy.init_node('route', anonymous=False)

    # ctrl + c退出    
    rospy.on_shutdown(self.shutdown)

    self.cmd_vel = rospy.Publisher('cmd_vel_mux/input/navi', Twist, queue_size=10)

# 5 HZ更新频率
    r = rospy.Rate(5);

# 两个不同的Twist,转,直走

    # 0.5 m/s 前进
    move_cmd = Twist()
    move_cmd.linear.x = 0.5


    #旋转18 deg/s
    turn_cmd = Twist()
    turn_cmd.linear.x = 0
    turn_cmd.angular.z = radians(18);

count = 0
# 前进1M
rospy.loginfo("前进ing")
for x in range(0,10):
    self.cmd_vel.publish(move_cmd)
    r.sleep()
while not rospy.is_shutdown():
    #转54度
    rospy.loginfo("转圈ing")
    for x in range(0,15):
        self.cmd_vel.publish(turn_cmd)
        r.sleep()            
    # 前进0.5M
    rospy.loginfo("前进ing")
    for x in range(0,5):
        self.cmd_vel.publish(move_cmd)
        r.sleep()
    # 转234度
    rospy.loginfo("准备拍照ing")
    for x in range(0,65):
        self.cmd_vel.publish(turn_cmd)
        r.sleep()            
    count = count + 1
    if(count == 5): 
            count = 0
    if(count == 0): 
            rospy.loginfo("是不是结束了?")

def shutdown(self):
    # 停啦
    rospy.loginfo("停啦~")
    self.cmd_vel.publish(Twist())
    rospy.sleep(1)

if name == '__main__':
try:
DrawASquare()
except:
rospy.loginfo("Bye~~")

大致帮你缩进了一下,试试行不行。
建议:
问题所在:for  语句本生不需要进一步缩进,和同级一样,
for 语句循环语句需要相对于for行有缩进,while也同样。
    1、缩进有问题,一个函数内的缩进应该是一致的。以下预计应增加缩进。
count = 0
# 前进1M
rospy.loginfo("前进ing")      
    2、ROUTE没有调用?主函数却调用DrawASquare(),这个是哪里来的?