예제 #1
0
 def test_from_file_invalid_path(self):
     with self.assertRaises(FileNotFoundError):
         Gait.from_file(
             self.gait_name,
             self.resources_folder + "/gaits",
             self.robot,
             self.gait_version_map,
         )
예제 #2
0
    def load_gaits(self):
        """Load the gaits in the specified gait directory."""
        self.loaded_gaits = list()

        for gait in self._gait_version_map:
            loaded_gait = Gait.from_file(gait, self.gait_directory, self.robot,
                                         self._gait_version_map)
            self.loaded_gaits.append(loaded_gait)
예제 #3
0
    def _load_gaits(self):
        """Loads the gaits in the specified gait directory.

        :returns dict: A dictionary mapping gait name to gait instance
        """
        gaits = {self._balance_gait.gait_name: self._balance_gait}

        for gait in self._gait_version_map:
            gaits[gait] = Gait.from_file(gait, self._gait_directory,
                                         self._robot, self._gait_version_map)

        if self._balance_gait.move_group:
            self._balance_gait.default_walk = gaits['balance_walk']

        return gaits
예제 #4
0
    def setUp(self):
        self.gait_name = 'walk'
        self.resources_folder = rospkg.RosPack().get_path(
            'march_shared_classes') + '/test/resources'
        self.robot = urdf.Robot.from_xml_file(
            rospkg.RosPack().get_path('march_description') +
            '/urdf/march4.urdf')

        self.default_yaml = self.resources_folder + '/default.yaml'
        with open(self.default_yaml, 'r') as default_yaml_file:
            default_config = yaml.load(default_yaml_file,
                                       Loader=yaml.SafeLoader)
        self.gait_version_map = default_config['gaits']

        self.gait = Gait.from_file(self.gait_name, self.resources_folder,
                                   self.robot, self.gait_version_map)
예제 #5
0
    def setUp(self):
        self.gait_name = "walk"
        self.resources_folder = (
            rospkg.RosPack().get_path("march_shared_classes") +
            "/test/resources")
        self.robot = urdf.Robot.from_xml_file(
            rospkg.RosPack().get_path("march_description") +
            "/urdf/march4.urdf")

        self.default_yaml = self.resources_folder + "/default.yaml"
        with open(self.default_yaml, "r") as default_yaml_file:
            default_config = yaml.load(default_yaml_file,
                                       Loader=yaml.SafeLoader)
        self.gait_version_map = default_config["gaits"]

        self.gait = Gait.from_file(self.gait_name, self.resources_folder,
                                   self.robot, self.gait_version_map)