Пример #1
0
    def get_squat_lower_limps_angles_set__with_tilted_torso_effect(self):
        squat_left_lower_limp_angles = self._get_one_lower_limp_angles__with__both_tilted_torso_and_hip_offset_effect(
            get_initial_foot_position(is_left=True), is_left=True)
        squat_right_lower_limp_angles = self._get_one_lower_limp_angles__with__both_tilted_torso_and_hip_offset_effect(
            get_initial_foot_position(is_left=False), is_left=False)

        return squat_left_lower_limp_angles, squat_right_lower_limp_angles
    def walk(self):
        self.draw_natural_pose()
        # self.draw_some_points()

        is_swing_leg_left = True
        initial_position = Point(get_initial_foot_position(is_left=is_swing_leg_left))
        lift_up_front_position, lift_up_front_forward_position, put_down_position = self.get_walk_trajectory_three_positions(is_swing_leg_left=True, step_length=self.step_length / 2, current_position_relative_to_initial_foot_position=Point((0, 0, 0)))

        lift_up_front_trajectory_section = LineSegment(initial_position, lift_up_front_position)
        lift_up_front_forward_trajectory_section = LineSegment(lift_up_front_position, lift_up_front_forward_position)
        put_down_trajectory_section = LineSegment(lift_up_front_forward_position, put_down_position)


        print('initial_position', initial_position)
        print('lift_up_front_position', lift_up_front_position)
        print('lift_up_front_forward_position', lift_up_front_forward_position)
        print('put_down_position', put_down_position)
        self.painter.draw_point(initial_position, color='r.')
        self.painter.draw_point(lift_up_front_position, color='r.')
        self.painter.draw_point(lift_up_front_forward_position, color='r.')
        self.painter.draw_point(put_down_position, color='r.')

        self.painter.draw_line(initial_position, lift_up_front_position, color='b-')
        self.painter.draw_line(lift_up_front_position, lift_up_front_forward_position, color='b-')
        self.painter.draw_line(lift_up_front_forward_position, put_down_position, color='b-')


        self._take_one_step(is_swing_leg_left, lift_up_front_trajectory_section, lift_up_front_forward_trajectory_section, put_down_trajectory_section)

        self.painter.show()
    def walk(self):
        self.draw_some_points()

        # self.draw_robot(*self.get_squat_with_tilted_torso_lower_limp_angles())

        lower_limps_angle_set_for_lift_up_front_position, lower_limps_angle_set_for_lift_up_front_forward_position, lower_limps_angle_set_for_put_down_position\
            = self.get_feet_positions_set__with__both_tilted_torso_and_hip_offset_effect(is_swing_leg_left=True, step_length=self.step_length/2, current_position_relative_to_initial_foot_position=Point((0, 0, 0)))
        self.draw_robot(*lower_limps_angle_set_for_lift_up_front_position)
        self.draw_robot(*lower_limps_angle_set_for_lift_up_front_forward_position)
        self.draw_robot(*lower_limps_angle_set_for_put_down_position)

        # lower_limps_angle_set_for_lift_up_front_position, lower_limps_angle_set_for_lift_up_front_forward_position, lower_limps_angle_set_for_put_down_position\
        #     = self.get_lower_limps_angles_set__with__both_tilted_torso_and_hip_offset_effect(is_swing_leg_left=False, step_length=self.step_length, current_position_relative_to_initial_foot_position=Point((-self.step_length/2, 0, 0)))
        # self.draw_robot(*lower_limps_angle_set_for_lift_up_front_position)
        # self.draw_robot(*lower_limps_angle_set_for_lift_up_front_forward_position)
        # self.draw_robot(*lower_limps_angle_set_for_put_down_position)

        is_swing_leg_left = True
        initial_position = Point(get_initial_foot_position(is_left=is_swing_leg_left))
        lift_up_front_position, lift_up_front_forward_position, put_down_position = self.get_walk_trajectory_three_positions(is_swing_leg_left=True, step_length=self.step_length / 2, current_position_relative_to_initial_foot_position=Point((0, 0, 0)))

        self.painter.draw_line(initial_position, lift_up_front_position, color='b-')
        self.painter.draw_line(lift_up_front_position, lift_up_front_forward_position, color='b-')
        self.painter.draw_line(lift_up_front_forward_position, put_down_position, color='b-')

        self.painter.show()
    def _get_is_swing_leg_left_and_walk_trajectory_four_positions__with_current_working_set(self, index):

        current_walking_set = self.walking_sets[index]

        is_swing_leg_left = current_walking_set['is_swing_leg_left']
        step_length = current_walking_set['step_length']
        current_position_relative_to_initial_foot_position = current_walking_set['current_position_relative_to_initial_foot_position']

        initial_foot_position = Point(get_initial_foot_position(is_left=is_swing_leg_left))

        initial_position = initial_foot_position.translate(current_position_relative_to_initial_foot_position.x, current_position_relative_to_initial_foot_position.y, current_position_relative_to_initial_foot_position.z)
        lift_up_front_position, lift_up_front_forward_position, put_down_position\
            = self._lower_limp_kinematics_engine.get_walk_trajectory_three_positions(is_swing_leg_left=is_swing_leg_left, step_length=step_length, current_position_relative_to_initial_foot_position=current_position_relative_to_initial_foot_position)

        return is_swing_leg_left, initial_position, lift_up_front_position, lift_up_front_forward_position, put_down_position
Пример #5
0
    def walk(self):
        self.draw_some_points()

        # self.draw_robot(*self.get_squat_with_tilted_torso_lower_limp_angles())

        lower_limps_angle_set_for_lift_up_front_position, lower_limps_angle_set_for_lift_up_front_forward_position, lower_limps_angle_set_for_put_down_position\
            = self.get_feet_positions_set__with__both_tilted_torso_and_hip_offset_effect(is_swing_leg_left=True, step_length=self.step_length/2, current_position_relative_to_initial_foot_position=Point((0, 0, 0)))
        self.draw_robot(*lower_limps_angle_set_for_lift_up_front_position)
        self.draw_robot(
            *lower_limps_angle_set_for_lift_up_front_forward_position)
        self.draw_robot(*lower_limps_angle_set_for_put_down_position)

        # lower_limps_angle_set_for_lift_up_front_position, lower_limps_angle_set_for_lift_up_front_forward_position, lower_limps_angle_set_for_put_down_position\
        #     = self.get_lower_limps_angles_set__with__both_tilted_torso_and_hip_offset_effect(is_swing_leg_left=False, step_length=self.step_length, current_position_relative_to_initial_foot_position=Point((-self.step_length/2, 0, 0)))
        # self.draw_robot(*lower_limps_angle_set_for_lift_up_front_position)
        # self.draw_robot(*lower_limps_angle_set_for_lift_up_front_forward_position)
        # self.draw_robot(*lower_limps_angle_set_for_put_down_position)

        is_swing_leg_left = True
        initial_position = Point(
            get_initial_foot_position(is_left=is_swing_leg_left))
        lift_up_front_position, lift_up_front_forward_position, put_down_position = self.get_walk_trajectory_three_positions(
            is_swing_leg_left=True,
            step_length=self.step_length / 2,
            current_position_relative_to_initial_foot_position=Point(
                (0, 0, 0)))

        self.painter.draw_line(initial_position,
                               lift_up_front_position,
                               color='b-')
        self.painter.draw_line(lift_up_front_position,
                               lift_up_front_forward_position,
                               color='b-')
        self.painter.draw_line(lift_up_front_forward_position,
                               put_down_position,
                               color='b-')

        self.painter.show()
    def get_squat_lower_limps_angles_set__with_tilted_torso_effect(self):
        squat_left_lower_limp_angles = self._get_one_lower_limp_angles__with__both_tilted_torso_and_hip_offset_effect(get_initial_foot_position(is_left=True), is_left=True)
        squat_right_lower_limp_angles = self._get_one_lower_limp_angles__with__both_tilted_torso_and_hip_offset_effect(get_initial_foot_position(is_left=False), is_left=False)

        return squat_left_lower_limp_angles, squat_right_lower_limp_angles