auto_driver.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:ardrone_fira 作者: HubFire 项目源码 文件源码
def drive(self):
        start_time =rospy.get_rostime()
        while not rospy.is_shutdown():
            curent = rospy.get_rostime()
            if (curent - start_time) <  rospy.Duration(1,0):
                self.controller.SendTakeoff()
                self.status =0

            elif (curent - start_time) <  rospy.Duration(22,0):
                self.controller.SetCommand(pitch=1)
                self.status =1

            elif (curent - start_time) <  rospy.Duration(23,0):
                self.controller.SetCommand(pitch=0)
                self.status =2

            elif (curent - start_time) <  rospy.Duration(24,0):
                #self.controller.SetCommand(yaw_velocity=2) 
                self.turnLeft()
                self.status =3 
                rate =rospy.Rate(1)
            elif (curent - start_time) <  rospy.Duration(40.5,0):
                self.controller.SetCommand(pitch=1)  
                self.status =4
            else:
                 self.controller.SetCommand(pitch=0)
                 self.controller.SendLand()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号