Пример #1
0
 def set_rotate_time(self):
     """Sets the time duration for which the robot should rotate in order to
     be facing the next point."""
     new_heading = self.next_point_angle()
     delta = equiv_angle(new_heading - self.heading)
     self.rot_dir = 1 if delta > 0 else -1
     self.go_for = self.angle_to_time(rad_to_deg(self.rot_dir * delta))
     self.heading = new_heading
     self.delta_angle = delta
Пример #2
0
 def set_rotate_time(self):
     """Sets the time duration for which the robot should rotate in order to
     be facing the next point."""
     new_heading = self.next_point_angle()
     delta = equiv_angle(new_heading - self.heading)
     self.rot_dir = 1 if delta > 0 else -1
     self.go_for = self.angle_to_time(rad_to_deg(self.rot_dir * delta))
     self.heading = new_heading
     self.delta_angle = delta
Пример #3
0
 def status(self):
     """Return the status message that should be displayed at the beginning
     of the current mode."""
     if self.mode == 0:
         return "impossible"
     if self.mode == 'halt':
         return "finished drawing"
     if self.mode == 'drive':
         return "drive {:.2f} cm".format(self.delta_pos)
     if self.mode == 'rotate':
         return "rotate {:.2f} degrees".format(rad_to_deg(self.delta_angle))
Пример #4
0
 def status(self):
     """Return the status message that should be displayed at the beginning
     of the current mode."""
     if self.mode == 0:
         return "impossible"
     if self.mode == 'halt':
         return "finished drawing"
     if self.mode == 'drive':
         return "drive {:.2f} cm".format(self.delta_pos)
     if self.mode == 'rotate':
         return "rotate {:.2f} degrees".format(rad_to_deg(self.delta_angle))