main.py
def asserv(self, m=None):
        """Sets the speeds of the 2 motors to get the robot to its destination point
        """
        if m == None:
            m = self.m
        distance = math.sqrt(
            (m.x_goal - m.x) * (m.x_goal - m.x) + (m.y_goal - m.y) * (m.y_goal - m.y)
        ) #calcul la distance entre pos du robot et point cliqué

        dx=m.x_goal-m.x
        dy=m.y_goal-m.y 

        if dy==0 and dx==0:
            angle_diff=0
        else :
            angle_diff=math.atan2(dy,dx) #calcul de l'angle teta entre le point cliqué et la direction du robot 
            angle_diff=self.angle_diff(m.theta, angle_diff)

        local_speed= distance*0.5
        local_turn = angle_diff*-1.2
        
        m1_speed, m2_speed = m.ik(local_speed, local_turn)
        m.m1.speed = m1_speed
        m.m2.speed = m2_speed
Sets the speeds of the 2 motors to get the robot to its destination point
        
Sets the speeds of the 2 motors to get the robot to its destination point
Sets the speeds of the 2 motors to get the robot to its destination point
def asserv(self, m=None):
        if m == None:
            m = self.m
        distance = math.sqrt(
            (m.x_goal - m.x) * (m.x_goal - m.x) + (m.y_goal - m.y) * (m.y_goal - m.y)
        ) 
        dx=m.x_goal-m.x
        dy=m.y_goal-m.y 
        if dy==0 and dx==0:
            angle_diff=0
        else :
            angle_diff=math.atan2(dy,dx) 
            angle_diff=self.angle_diff(m.theta, angle_diff)
        local_speed= distance*0.5
        local_turn = angle_diff*-1.2
        m1_speed, m2_speed = m.ik(local_speed, local_turn)
        m.m1.speed = m1_speed
        m.m2.speed = m2_speed
def asserv ( self , m = None ) : if m == None : m = self . m distance = math . sqrt ( ( m . x_goal - m . x ) * ( m . x_goal - m . x ) + ( m . y_goal - m . y ) * ( m . y_goal - m . y ) ) dx = m . x_goal - m . x dy = m . y_goal - m . y if dy == 0 and dx == 0 : angle_diff = 0 else : angle_diff = math . atan2 ( dy , dx ) angle_diff = self . angle_diff ( m . theta , angle_diff ) local_speed = distance * 0.5 local_turn = angle_diff * - 1.2 m1_speed , m2_speed = m . ik ( local_speed , local_turn ) m . m1 . speed = m1_speed m . m2 . speed = m2_speed
Sets the speeds of the 2 motors to get the robot to its destination point
Sets the speeds of the 2 motors to get the robot to its destination point
"""Sets the speeds of the 2 motors to get the robot to its destination point
        """ #calcul la distance entre pos du robot et point cliqué #calcul de l'angle teta entre le point cliqué et la direction du robot 
self
m