def run(self):
if self.finished:
return TaskStatus.SUCCESS
else:
rospy.loginfo('Vacuuming the floor in the ' + str(self.room))
while self.counter > 0:
self.cmd_vel_pub.publish(self.cmd_vel_msg)
self.cmd_vel_msg.linear.x *= -1
rospy.loginfo(self.counter)
self.counter -= 1
rospy.sleep(1)
return TaskStatus.RUNNING
self.finished = True
self.cmd_vel_pub.publish(Twist())
message = "Finished vacuuming the " + str(self.room) + "!"
rospy.loginfo(message)
评论列表
文章目录