Ejemplo n.º 1
0
    def test_no_duplicate_duration_in_transition_subgait(self):
        #  Test if the TransitionSubgait is created without an error
        transition_subgait = TransitionSubgait.from_subgait_names(
            self.gait_selection, 'walk_small', 'walk_medium', 'right_swing')

        for joint in transition_subgait.joints:
            durations = [setpoint.time for setpoint in joint.setpoints]

            self.assertLessEqual(
                len(durations),
                len(set(durations)),
                msg='Duplicate timestamps found in setpoints.')
Ejemplo n.º 2
0
 def test_transition_stairs_up_walk_small_right_swing(self):
     #  Test if the TransitionSubgait is created without an error
     TransitionSubgait.from_subgait_names(self.gait_selection, 'stairs_up',
                                          'walk_small', 'right_swing')
Ejemplo n.º 3
0
 def test_invalid_gait_selection(self):
     # check if wrong gait selection module
     with self.assertRaises(GaitError):
         TransitionSubgait.from_subgait_names('wrong', 'walk_small',
                                              'walk_medium', 'right_swing')
Ejemplo n.º 4
0
 def test_walk_transition_medium_to_small_right_swing(self):
     #  Test if the TransitionSubgait is created without an error
     TransitionSubgait.from_subgait_names(self.gait_selection,
                                          'walk_medium', 'walk_small',
                                          'right_swing')
Ejemplo n.º 5
0
 def test_invalid_subgait_name(self):
     # check if wrong subgait name causes right error
     with self.assertRaises(GaitError):
         TransitionSubgait.from_subgait_names(self.gait_selection,
                                              'walk_small', 'walk_medium',
                                              'wrong')