Skip to content

Commit

Permalink
Merge pull request #290 from leggedrobotics/dev/open_source_header
Browse files Browse the repository at this point in the history
Dev/open source header
  • Loading branch information
JonasFrey96 authored Feb 18, 2024
2 parents fd32604 + 403d053 commit f47c6c9
Show file tree
Hide file tree
Showing 62 changed files with 336 additions and 0 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022-2024 ETH Zurich, Matias Mattamala, Jonas Frey.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,3 +190,18 @@ Introduction to [pytest](https://github.com/pluralsight/intro-to-pytest).
```shell
pytest
```


### Open-Sourcing
Generating headers
```shell
pip3 install adheader

# If your are using zsh otherwise remove \
addheader wild_visual_navigation -t header.txt -p \*.py --sep-len 79 --comment='#' --sep=' '
addheader wild_visual_navigation_ros -t header.txt -p \*.py -sep-len 79 --comment='#' --sep=' '
addheader wild_visual_navigation_anymal -t header.txt -p \*.py --sep-len 79 --comment='#' --sep=' '

addheader wild_visual_navigation_ros -t header.txt -p \*CMakeLists.txt --sep-len 79 --comment='#' --sep=' '
addheader wild_visual_navigation_anymal -t header.txt -p \*.py -p \*CMakeLists.txt --sep-len 79 --comment='#' --sep=' '
```
5 changes: 5 additions & 0 deletions wild_visual_navigation/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#
# Copyright (c) 2022-2024, ETH Zurich, Jonas Frey, Matias Mattamala.
# All rights reserved. Licensed under the MIT license.
# See LICENSE file in the project root for details.
#
import os

WVN_ROOT_DIR = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
Expand Down
5 changes: 5 additions & 0 deletions wild_visual_navigation/cfg/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#
# Copyright (c) 2022-2024, ETH Zurich, Jonas Frey, Matias Mattamala.
# All rights reserved. Licensed under the MIT license.
# See LICENSE file in the project root for details.
#
from .global_params import get_global_env_params, GlobalEnvironmentParams
from .experiment_params import ExperimentParams
from .ros_params import RosLearningNodeParams, RosFeatureExtractorNodeParams
5 changes: 5 additions & 0 deletions wild_visual_navigation/cfg/experiment_params.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#
# Copyright (c) 2022-2024, ETH Zurich, Jonas Frey, Matias Mattamala.
# All rights reserved. Licensed under the MIT license.
# See LICENSE file in the project root for details.
#
from dataclasses import dataclass, field
from typing import List, Optional
from typing import Any
Expand Down
5 changes: 5 additions & 0 deletions wild_visual_navigation/cfg/global_params.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#
# Copyright (c) 2022-2024, ETH Zurich, Jonas Frey, Matias Mattamala.
# All rights reserved. Licensed under the MIT license.
# See LICENSE file in the project root for details.
#
from dataclasses import dataclass


Expand Down
5 changes: 5 additions & 0 deletions wild_visual_navigation/cfg/ros_params.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#
# Copyright (c) 2022-2024, ETH Zurich, Jonas Frey, Matias Mattamala.
# All rights reserved. Licensed under the MIT license.
# See LICENSE file in the project root for details.
#
from dataclasses import dataclass
from typing import Dict
from typing import Any
Expand Down
5 changes: 5 additions & 0 deletions wild_visual_navigation/feature_extractor/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#
# Copyright (c) 2022-2024, ETH Zurich, Jonas Frey, Matias Mattamala.
# All rights reserved. Licensed under the MIT license.
# See LICENSE file in the project root for details.
#
from .dino_interface import DinoInterface, run_dino_interfacer
from .torchvision_interface import TorchVisionInterface

Expand Down
5 changes: 5 additions & 0 deletions wild_visual_navigation/feature_extractor/dino_interface.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#
# Copyright (c) 2022-2024, ETH Zurich, Jonas Frey, Matias Mattamala.
# All rights reserved. Licensed under the MIT license.
# See LICENSE file in the project root for details.
#
from os.path import join
import torch.nn.functional as F
import torch
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#
# Copyright (c) 2022-2024, ETH Zurich, Jonas Frey, Matias Mattamala.
# All rights reserved. Licensed under the MIT license.
# See LICENSE file in the project root for details.
#
from wild_visual_navigation import WVN_ROOT_DIR
from os.path import join
from omegaconf import DictConfig
Expand Down
5 changes: 5 additions & 0 deletions wild_visual_navigation/feature_extractor/feature_extractor.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#
# Copyright (c) 2022-2024, ETH Zurich, Jonas Frey, Matias Mattamala.
# All rights reserved. Licensed under the MIT license.
# See LICENSE file in the project root for details.
#
from wild_visual_navigation.feature_extractor import (
StegoInterface,
DinoInterface,
Expand Down
5 changes: 5 additions & 0 deletions wild_visual_navigation/feature_extractor/segment_extractor.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#
# Copyright (c) 2022-2024, ETH Zurich, Jonas Frey, Matias Mattamala.
# All rights reserved. Licensed under the MIT license.
# See LICENSE file in the project root for details.
#
# author: Jonas Frey

import torch
Expand Down
5 changes: 5 additions & 0 deletions wild_visual_navigation/feature_extractor/stego_interface.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#
# Copyright (c) 2022-2024, ETH Zurich, Jonas Frey, Matias Mattamala.
# All rights reserved. Licensed under the MIT license.
# See LICENSE file in the project root for details.
#
from os.path import join
import torch.nn.functional as F
import torch
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#
# Copyright (c) 2022-2024, ETH Zurich, Jonas Frey, Matias Mattamala.
# All rights reserved. Licensed under the MIT license.
# See LICENSE file in the project root for details.
#
from wild_visual_navigation import WVN_ROOT_DIR
from os.path import join

Expand Down
5 changes: 5 additions & 0 deletions wild_visual_navigation/image_projector/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
#
# Copyright (c) 2022-2024, ETH Zurich, Jonas Frey, Matias Mattamala.
# All rights reserved. Licensed under the MIT license.
# See LICENSE file in the project root for details.
#
from .image_projector import ImageProjector, run_image_projector
5 changes: 5 additions & 0 deletions wild_visual_navigation/image_projector/image_projector.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#
# Copyright (c) 2022-2024, ETH Zurich, Jonas Frey, Matias Mattamala.
# All rights reserved. Licensed under the MIT license.
# See LICENSE file in the project root for details.
#
from pytictac import Timer
from os.path import join
import torch
Expand Down
5 changes: 5 additions & 0 deletions wild_visual_navigation/model/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#
# Copyright (c) 2022-2024, ETH Zurich, Jonas Frey, Matias Mattamala.
# All rights reserved. Licensed under the MIT license.
# See LICENSE file in the project root for details.
#
from .simple_mlp import SimpleMLP, DoubleMLP
from .simple_gcn import SimpleGCN
from .linear_rnvp import LinearRnvp
Expand Down
5 changes: 5 additions & 0 deletions wild_visual_navigation/model/linear_rnvp.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#
# Copyright (c) 2022-2024, ETH Zurich, Jonas Frey, Matias Mattamala.
# All rights reserved. Licensed under the MIT license.
# See LICENSE file in the project root for details.
#
import copy
import torch
from torch import nn, distributions
Expand Down
5 changes: 5 additions & 0 deletions wild_visual_navigation/model/network_register.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#
# Copyright (c) 2022-2024, ETH Zurich, Jonas Frey, Matias Mattamala.
# All rights reserved. Licensed under the MIT license.
# See LICENSE file in the project root for details.
#
from wild_visual_navigation.model import *
import inspect
import torch
Expand Down
5 changes: 5 additions & 0 deletions wild_visual_navigation/model/simple_gcn.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#
# Copyright (c) 2022-2024, ETH Zurich, Jonas Frey, Matias Mattamala.
# All rights reserved. Licensed under the MIT license.
# See LICENSE file in the project root for details.
#
import torch
import torch.nn.functional as F

Expand Down
5 changes: 5 additions & 0 deletions wild_visual_navigation/model/simple_mlp.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#
# Copyright (c) 2022-2024, ETH Zurich, Jonas Frey, Matias Mattamala.
# All rights reserved. Licensed under the MIT license.
# See LICENSE file in the project root for details.
#
import torch
from wild_visual_navigation.utils import Data

Expand Down
5 changes: 5 additions & 0 deletions wild_visual_navigation/supervision_generator/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
#
# Copyright (c) 2022-2024, ETH Zurich, Jonas Frey, Matias Mattamala.
# All rights reserved. Licensed under the MIT license.
# See LICENSE file in the project root for details.
#
from .twist_dataset import TwistDataset, TwistDataModule
from .supervision_generator import SupervisionGenerator, run_supervision_generator
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#
# Copyright (c) 2022-2024, ETH Zurich, Jonas Frey, Matias Mattamala.
# All rights reserved. Licensed under the MIT license.
# See LICENSE file in the project root for details.
#
from wild_visual_navigation import WVN_ROOT_DIR
from wild_visual_navigation.traversability_estimator.graphs import DistanceWindowGraph
from wild_visual_navigation.traversability_estimator.nodes import TwistNode
Expand Down
5 changes: 5 additions & 0 deletions wild_visual_navigation/supervision_generator/twist_dataset.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#
# Copyright (c) 2022-2024, ETH Zurich, Jonas Frey, Matias Mattamala.
# All rights reserved. Licensed under the MIT license.
# See LICENSE file in the project root for details.
#
from wild_visual_navigation import WVN_ROOT_DIR
import os
import torch
Expand Down
5 changes: 5 additions & 0 deletions wild_visual_navigation/traversability_estimator/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#
# Copyright (c) 2022-2024, ETH Zurich, Jonas Frey, Matias Mattamala.
# All rights reserved. Licensed under the MIT license.
# See LICENSE file in the project root for details.
#
from .graphs import (
BaseGraph,
TemporalWindowGraph,
Expand Down
5 changes: 5 additions & 0 deletions wild_visual_navigation/traversability_estimator/graphs.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#
# Copyright (c) 2022-2024, ETH Zurich, Jonas Frey, Matias Mattamala.
# All rights reserved. Licensed under the MIT license.
# See LICENSE file in the project root for details.
#
from .nodes import BaseNode
import networkx as nx
import random
Expand Down
5 changes: 5 additions & 0 deletions wild_visual_navigation/traversability_estimator/nodes.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#
# Copyright (c) 2022-2024, ETH Zurich, Jonas Frey, Matias Mattamala.
# All rights reserved. Licensed under the MIT license.
# See LICENSE file in the project root for details.
#
from wild_visual_navigation.image_projector import ImageProjector
from wild_visual_navigation.utils import (
make_box,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#
# Copyright (c) 2022-2024, ETH Zurich, Jonas Frey, Matias Mattamala.
# All rights reserved. Licensed under the MIT license.
# See LICENSE file in the project root for details.
#
from wild_visual_navigation.feature_extractor import FeatureExtractor
from wild_visual_navigation.image_projector import ImageProjector
from wild_visual_navigation.model import get_model
Expand Down
5 changes: 5 additions & 0 deletions wild_visual_navigation/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#
# Copyright (c) 2022-2024, ETH Zurich, Jonas Frey, Matias Mattamala.
# All rights reserved. Licensed under the MIT license.
# See LICENSE file in the project root for details.
#
from .data import Data, Batch
from .flatten_dict import flatten_dict
from .get_logger import get_logger, get_neptune_run
Expand Down
5 changes: 5 additions & 0 deletions wild_visual_navigation/utils/confidence_generator.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#
# Copyright (c) 2022-2024, ETH Zurich, Jonas Frey, Matias Mattamala.
# All rights reserved. Licensed under the MIT license.
# See LICENSE file in the project root for details.
#
from wild_visual_navigation.utils import KalmanFilter
from wild_visual_navigation import WVN_ROOT_DIR
import torch
Expand Down
5 changes: 5 additions & 0 deletions wild_visual_navigation/utils/create_experiment_folder.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#
# Copyright (c) 2022-2024, ETH Zurich, Jonas Frey, Matias Mattamala.
# All rights reserved. Licensed under the MIT license.
# See LICENSE file in the project root for details.
#
import datetime
import os
import shutil
Expand Down
5 changes: 5 additions & 0 deletions wild_visual_navigation/utils/data.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#
# Copyright (c) 2022-2024, ETH Zurich, Jonas Frey, Matias Mattamala.
# All rights reserved. Licensed under the MIT license.
# See LICENSE file in the project root for details.
#
from typing import Any, List, Optional, Type, Union
from typing_extensions import Self
import torch
Expand Down
5 changes: 5 additions & 0 deletions wild_visual_navigation/utils/flatten_dict.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#
# Copyright (c) 2022-2024, ETH Zurich, Jonas Frey, Matias Mattamala.
# All rights reserved. Licensed under the MIT license.
# See LICENSE file in the project root for details.
#
import collections

__all__ = ["flatten_dict"]
Expand Down
5 changes: 5 additions & 0 deletions wild_visual_navigation/utils/get_confidence.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#
# Copyright (c) 2022-2024, ETH Zurich, Jonas Frey, Matias Mattamala.
# All rights reserved. Licensed under the MIT license.
# See LICENSE file in the project root for details.
#
import torch.nn.functional as F
import torch

Expand Down
5 changes: 5 additions & 0 deletions wild_visual_navigation/utils/get_logger.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#
# Copyright (c) 2022-2024, ETH Zurich, Jonas Frey, Matias Mattamala.
# All rights reserved. Licensed under the MIT license.
# See LICENSE file in the project root for details.
#
from pytorch_lightning.loggers.neptune import NeptuneLogger
from pytorch_lightning.loggers import TensorBoardLogger, WandbLogger
from wild_visual_navigation.utils import flatten_dict
Expand Down
5 changes: 5 additions & 0 deletions wild_visual_navigation/utils/gpu_monitor.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#
# Copyright (c) 2022-2024, ETH Zurich, Jonas Frey, Matias Mattamala.
# All rights reserved. Licensed under the MIT license.
# See LICENSE file in the project root for details.
#
import torch
import os
import pandas as pd
Expand Down
5 changes: 5 additions & 0 deletions wild_visual_navigation/utils/kalman_filter.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#
# Copyright (c) 2022-2024, ETH Zurich, Jonas Frey, Matias Mattamala.
# All rights reserved. Licensed under the MIT license.
# See LICENSE file in the project root for details.
#
import torch
import torch.nn as nn

Expand Down
5 changes: 5 additions & 0 deletions wild_visual_navigation/utils/loading.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#
# Copyright (c) 2022-2024, ETH Zurich, Jonas Frey, Matias Mattamala.
# All rights reserved. Licensed under the MIT license.
# See LICENSE file in the project root for details.
#
import os
import yaml
from wild_visual_navigation import WVN_ROOT_DIR
Expand Down
5 changes: 5 additions & 0 deletions wild_visual_navigation/utils/loss.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#
# Copyright (c) 2022-2024, ETH Zurich, Jonas Frey, Matias Mattamala.
# All rights reserved. Licensed under the MIT license.
# See LICENSE file in the project root for details.
#
from wild_visual_navigation.utils import ConfidenceGenerator

import torch.nn.functional as F
Expand Down
5 changes: 5 additions & 0 deletions wild_visual_navigation/utils/meshes.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#
# Copyright (c) 2022-2024, ETH Zurich, Jonas Frey, Matias Mattamala.
# All rights reserved. Licensed under the MIT license.
# See LICENSE file in the project root for details.
#
import torch
from kornia.geometry.linalg import transform_points

Expand Down
5 changes: 5 additions & 0 deletions wild_visual_navigation/utils/operation_modes.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#
# Copyright (c) 2022-2024, ETH Zurich, Jonas Frey, Matias Mattamala.
# All rights reserved. Licensed under the MIT license.
# See LICENSE file in the project root for details.
#
from enum import Enum


Expand Down
5 changes: 5 additions & 0 deletions wild_visual_navigation/utils/testing.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#
# Copyright (c) 2022-2024, ETH Zurich, Jonas Frey, Matias Mattamala.
# All rights reserved. Licensed under the MIT license.
# See LICENSE file in the project root for details.
#
import os
import cv2
import torch
Expand Down
Loading

0 comments on commit f47c6c9

Please sign in to comment.