{"id":30110331,"url":"https://github.com/leggedrobotics/physical_terrain_parameter_learning","last_synced_at":"2025-08-10T04:44:38.083Z","repository":{"id":302110049,"uuid":"849414253","full_name":"leggedrobotics/physical_terrain_parameter_learning","owner":"leggedrobotics","description":null,"archived":false,"fork":false,"pushed_at":"2025-07-12T19:04:30.000Z","size":16407,"stargazers_count":24,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-12T21:13:02.024Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leggedrobotics.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-08-29T14:52:30.000Z","updated_at":"2025-07-12T19:04:34.000Z","dependencies_parsed_at":"2025-06-30T16:55:16.713Z","dependency_job_id":null,"html_url":"https://github.com/leggedrobotics/physical_terrain_parameter_learning","commit_stats":null,"previous_names":["leggedrobotics/physical_terrain_parameter_learning"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/leggedrobotics/physical_terrain_parameter_learning","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leggedrobotics%2Fphysical_terrain_parameter_learning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leggedrobotics%2Fphysical_terrain_parameter_learning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leggedrobotics%2Fphysical_terrain_parameter_learning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leggedrobotics%2Fphysical_terrain_parameter_learning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leggedrobotics","download_url":"https://codeload.github.com/leggedrobotics/physical_terrain_parameter_learning/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leggedrobotics%2Fphysical_terrain_parameter_learning/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269677517,"owners_count":24457858,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-08-10T04:44:35.060Z","updated_at":"2025-08-10T04:44:38.034Z","avatar_url":"https://github.com/leggedrobotics.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Physical Terrain Parameters Learning\n\n![Framework Overview](.docs/header_figure.jpg)\n\nThis repository accompanies the paper \"Identifying Terrain Physical Parameters from Vision - Towards Physical-Parameter-Aware Locomotion and Navigation\". Check project website [here](https://bit.ly/3Xo5AA8)\n\nThe repo mainly contains three parts: \n1. Stand-alone pre-trained physical decoder\n2. Physical decoder training module\n3. Self-supervised visual decoder learning\n\n\n**Maintainer**: Jiaqi Chen \n**Affiliation**: ETH Zurich  \n**Contact**: chenjiaq@student.ethz.ch \n\nIf this code supports your research, please consider citing the following work. We also welcome feedback or collaboration opportunities:\n```\n@ARTICLE{Chen24physical,\n  author={Chen, Jiaqi and Frey, Jonas and Zhou, Ruyi and Miki, Takahiro and Martius, Georg and Hutter, Marco},\n  journal={IEEE Robotics and Automation Letters}, \n  title={Identifying Terrain Physical Parameters From Vision - Towards Physical-Parameter-Aware Locomotion and Navigation}, \n  year={2024},\n  volume={9},\n  number={11},\n  pages={9279-9286},\n  doi={10.1109/LRA.2024.3455788}}\n\n```\n\n## Codebase Overview\n![Codebase Overview](.docs/codebase.png)\n\n## 1. Stand-alone Pre-trained Physical Decoder (Folder: [physical_decoder](physical_decoder/))\nYou can try out our pre-trained physical decoder as follows:\n\n\n### Installation\nFirst, clone this repository to your local machine and install the dependencies.\n```shell\ncd physical_decoder/\n\n# Install the dependencies\npip install -r requirements.txt\n\n# Install the package\npip install -e .\n```\n\n### Explanation\nThis two decoders use sequence data as input and output a physical parameters sequence (friction or stiffness), where we extract the last sequence position as the prediction for the current timestamp. \nThe main architecture is GRU+Self-Attention with a parallel structure.\nThe model_pth is automatically loaded from the package folder. \n\n#### ⚠️ Important: Shared Decoder Configuration\n\n\u003e **The file [`physical_decoder/physical_decoder/decoder_config.py`](physical_decoder/physical_decoder/decoder_config.py) is the **single source of truth** for decoder configurations.**\n\nThis file is used by **both**:\n- `base_wvn`\n- `physical_decoder_training`\n\n✅ Make sure to **verify and modify configurations here** when changing model behavior for either component.\n\n### Usage\nBelow we showcase how to use the decoders during deployment (e.g. in ros), you can also check the `base_wvn` folder for detailed ros usage.\n\n```python\nfrom physical_decoder import DeploymentWrapper\n\n# Initializing\nphysical_decoder = DeploymentWrapper()\n\n# Main loop\nwhile True:\n    # In deployment, the input data is usually an observation tensor per step with shape (batch_size, feature_dim)\n    fric_pred, stiff_pred = physical_decoder.predict(input_data)\n    # each output prediction is a tensor with shape (batch_size, priv_size = 4 feet)\n\n```\n\n## 2. Physical Decoder Training (Folder: [physical_decoder_training](physical_decoder_training/))\n\n### Installation\n```bash\ncd physical_decoder_training\npip install -r requirements.txt\n```\n\nSet your Neptune API token, username and project name in the system file `.bashrc`:\n```bash\nexport NEPTUNE_API_TOKEN=\"your_neptune_api_token\"\nexport NEPTUNE_USERNAME=\"your_neptune_username\"\nexport NEPTUNE_PROJECT=\"your_neptune_username/your_neptune_project_name\"\n```\n### Training \u0026 Evaluation\n\n1. Configure run parameters in [`physical_decoder_training/training_utils/run_config.py`](physical_decoder_training/training_utils/run_config.py). This includes:\n    - `mode`: Set to 'train' for training+evaluation or 'eval' for evaluation-only.\n    - `train_data_directory`, `val_data_directory`: Specify paths to your training and validation datasets.\n    - `max_epochs`, `batch_size`, etc.: Adjust as needed.\n\n2. Configure the decoder model settings in [`physical_decoder/physical_decoder/decoder_config.py`](physical_decoder/physical_decoder/decoder_config.py). This includes:\n    - `seq_length`: Length of input sequences for RNNs.\n    - `input_type`: Type of selected input features (e.g., 'pro', 'pro+exte', 'all').\n    - `output_type`: Type of output parameter ('fric' for friction or 'stiff' for stiffness).\n    - `device`: Set to 'cuda' for GPU training/inference or 'cpu' for CPU.\n    - model architecture settings like `hidden_size`, etc.\n    \n3. The main training \u0026 evaluation loop is in `physical_decoder_training/train_eval.py`\n\nBe advised that the datasets are seperated for friction and stiffness prediction, and the training is also seperated. Change the `output_type` in the decoder config for different decoders training. For detailed information, please refer to code.\n\nYou may use our pre-collected dataset for training. Download the `dataset` folder from [this link](https://drive.google.com/drive/folders/1GiX66anCw4DuOGTlS3FzBez0hATTrJbL?usp=drive_link). Specify the paths for training and validation data in the configuration file.\n\n\n### Usage\n```bash\npython physical_decoder_training/train_eval.py\n```\n## 3. Self-supervised Visual Decoder Learning (Folder: [base_wvn](base_wvn/))\n\nPlease check the Readme in `base_wvn` folder for detailed instructions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleggedrobotics%2Fphysical_terrain_parameter_learning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleggedrobotics%2Fphysical_terrain_parameter_learning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleggedrobotics%2Fphysical_terrain_parameter_learning/lists"}