Skip to content

Commit

Permalink
added license headers
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrePatri committed Oct 11, 2023
1 parent a092be4 commit c87d988
Show file tree
Hide file tree
Showing 18 changed files with 319 additions and 1 deletion.
File renamed without changes.
17 changes: 17 additions & 0 deletions control_cluster_utils/cluster_client/control_cluster_client.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# Copyright (C) 2023 Andrea Patrizi (AndrePatri, [email protected])
#
# This file is part of ControlClusterUtils and distributed under the General Public License version 2 license.
#
# ControlClusterUtils is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# ControlClusterUtils is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with ControlClusterUtils. If not, see <http://www.gnu.org/licenses/>.
#
import torch

from abc import ABC
Expand Down
17 changes: 17 additions & 0 deletions control_cluster_utils/cluster_server/control_cluster_srvr.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# Copyright (C) 2023 Andrea Patrizi (AndrePatri, [email protected])
#
# This file is part of ControlClusterUtils and distributed under the General Public License version 2 license.
#
# ControlClusterUtils is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# ControlClusterUtils is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with ControlClusterUtils. If not, see <http://www.gnu.org/licenses/>.
#
from abc import ABC

from control_cluster_utils.controllers.rhc import RHChild
Expand Down
17 changes: 17 additions & 0 deletions control_cluster_utils/controllers/rhc.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# Copyright (C) 2023 Andrea Patrizi (AndrePatri, [email protected])
#
# This file is part of ControlClusterUtils and distributed under the General Public License version 2 license.
#
# ControlClusterUtils is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# ControlClusterUtils is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with ControlClusterUtils. If not, see <http://www.gnu.org/licenses/>.
#
from abc import ABC, abstractmethod

import time
Expand Down
17 changes: 17 additions & 0 deletions control_cluster_utils/tests/test_shared_mem_manager_client.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# Copyright (C) 2023 Andrea Patrizi (AndrePatri, [email protected])
#
# This file is part of ControlClusterUtils and distributed under the General Public License version 2 license.
#
# ControlClusterUtils is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# ControlClusterUtils is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with ControlClusterUtils. If not, see <http://www.gnu.org/licenses/>.
#
from control_cluster_utils.utilities.shared_mem import SharedMemClient

import torch
Expand Down
17 changes: 17 additions & 0 deletions control_cluster_utils/tests/test_shared_mem_manager_server.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# Copyright (C) 2023 Andrea Patrizi (AndrePatri, [email protected])
#
# This file is part of ControlClusterUtils and distributed under the General Public License version 2 license.
#
# ControlClusterUtils is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# ControlClusterUtils is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with ControlClusterUtils. If not, see <http://www.gnu.org/licenses/>.
#
from control_cluster_utils.utilities.shared_mem import SharedMemSrvr, SharedStringArray

import torch
Expand Down
17 changes: 17 additions & 0 deletions control_cluster_utils/utilities/control_cluster_defs.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# Copyright (C) 2023 Andrea Patrizi (AndrePatri, [email protected])
#
# This file is part of ControlClusterUtils and distributed under the General Public License version 2 license.
#
# ControlClusterUtils is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# ControlClusterUtils is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with ControlClusterUtils. If not, see <http://www.gnu.org/licenses/>.
#
import torch

import time
Expand Down
17 changes: 17 additions & 0 deletions control_cluster_utils/utilities/debugger_gui/cluster_debugger.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# Copyright (C) 2023 Andrea Patrizi (AndrePatri, [email protected])
#
# This file is part of ControlClusterUtils and distributed under the General Public License version 2 license.
#
# ControlClusterUtils is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# ControlClusterUtils is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with ControlClusterUtils. If not, see <http://www.gnu.org/licenses/>.
#
from PyQt5.QtCore import QThread, pyqtSignal, Qt
from PyQt5.QtWidgets import QApplication, QMainWindow, QTabWidget, QWidget, QSlider
from PyQt5.QtWidgets import QLabel, QVBoxLayout, QHBoxLayout, QSplitter, QFrame
Expand Down
17 changes: 17 additions & 0 deletions control_cluster_utils/utilities/debugger_gui/plot_utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# Copyright (C) 2023 Andrea Patrizi (AndrePatri, [email protected])
#
# This file is part of ControlClusterUtils and distributed under the General Public License version 2 license.
#
# ControlClusterUtils is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# ControlClusterUtils is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with ControlClusterUtils. If not, see <http://www.gnu.org/licenses/>.
#
import numpy as np

from PyQt5.QtCore import Qt, QTimer
Expand Down
17 changes: 17 additions & 0 deletions control_cluster_utils/utilities/defs.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# Copyright (C) 2023 Andrea Patrizi (AndrePatri, [email protected])
#
# This file is part of ControlClusterUtils and distributed under the General Public License version 2 license.
#
# ControlClusterUtils is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# ControlClusterUtils is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with ControlClusterUtils. If not, see <http://www.gnu.org/licenses/>.
#
def aggregate_state_size(internal_jnt_number: int):

# root p, q, v, omega + jnt q, v respectively
Expand Down
17 changes: 17 additions & 0 deletions control_cluster_utils/utilities/homing.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# Copyright (C) 2023 Andrea Patrizi (AndrePatri, [email protected])
#
# This file is part of ControlClusterUtils and distributed under the General Public License version 2 license.
#
# ControlClusterUtils is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# ControlClusterUtils is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with ControlClusterUtils. If not, see <http://www.gnu.org/licenses/>.
#
import numpy as np

import xml.etree.ElementTree as ET
Expand Down
17 changes: 17 additions & 0 deletions control_cluster_utils/utilities/keyboard_cmds.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# Copyright (C) 2023 Andrea Patrizi (AndrePatri, [email protected])
#
# This file is part of ControlClusterUtils and distributed under the General Public License version 2 license.
#
# ControlClusterUtils is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# ControlClusterUtils is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with ControlClusterUtils. If not, see <http://www.gnu.org/licenses/>.
#
import torch

from pynput import keyboard
Expand Down
63 changes: 63 additions & 0 deletions control_cluster_utils/utilities/math_utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Copyright (C) 2023 Andrea Patrizi (AndrePatri, [email protected])
#
# This file is part of ControlClusterUtils and distributed under the General Public License version 2 license.
#
# ControlClusterUtils is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# ControlClusterUtils is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with ControlClusterUtils. If not, see <http://www.gnu.org/licenses/>.
#
import torch
from typing import List

def incremental_rotate(q_initial: torch.Tensor,
d_angle: float,
axis: List) -> torch.Tensor:
"""
Incrementally rotate a quaternion `q_initial` by `d_angle` radians about `axis`.
Parameters:
- q_initial (torch.Tensor): Initial quaternion.
- d_angle (float): Angle by which to rotate, in radians.
- axis (torch.Tensor): Axis about which to rotate.
Returns:
- torch.Tensor: Resulting quaternion after rotation.
"""
d_angle_tensor = torch.tensor(d_angle)
# Compute the quaternion representation of the incremental rotation
q_incremental = torch.tensor([torch.cos(d_angle_tensor / 2),
axis[0] * torch.sin(d_angle_tensor / 2),
axis[1] * torch.sin(d_angle_tensor / 2),
axis[2] * torch.sin(d_angle_tensor / 2)])

# Normalize the quaternion
q_incremental /= torch.linalg.norm(q_incremental)

# Compute the final orientation of the base by multiplying the quaternions
q_result = quaternion_multiply(q_incremental, q_initial)

return q_result

def quaternion_multiply(q1: torch.Tensor,
q2: torch.Tensor):

"""
Multiply two quaternions q1 and q2.
Assumes quaternions are represented as 1D tensors: [w, x, y, z].
"""
w1, x1, y1, z1 = q1
w2, x2, y2, z2 = q2

w = w1*w2 - x1*x2 - y1*y2 - z1*z2
x = w1*x2 + x1*w2 + y1*z2 - z1*y2
y = w1*y2 + y1*w2 + z1*x2 - x1*z2
z = w1*z2 + z1*w2 + x1*y2 - y1*x2

return torch.tensor([w, x, y, z])
17 changes: 17 additions & 0 deletions control_cluster_utils/utilities/pipe_utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# Copyright (C) 2023 Andrea Patrizi (AndrePatri, [email protected])
#
# This file is part of ControlClusterUtils and distributed under the General Public License version 2 license.
#
# ControlClusterUtils is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# ControlClusterUtils is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with ControlClusterUtils. If not, see <http://www.gnu.org/licenses/>.
#
import os

import yaml
Expand Down
17 changes: 17 additions & 0 deletions control_cluster_utils/utilities/rhc_defs.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# Copyright (C) 2023 Andrea Patrizi (AndrePatri, [email protected])
#
# This file is part of ControlClusterUtils and distributed under the General Public License version 2 license.
#
# ControlClusterUtils is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# ControlClusterUtils is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with ControlClusterUtils. If not, see <http://www.gnu.org/licenses/>.
#
import torch

from typing import TypeVar, List
Expand Down
17 changes: 17 additions & 0 deletions control_cluster_utils/utilities/shared_mem.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# Copyright (C) 2023 Andrea Patrizi (AndrePatri, [email protected])
#
# This file is part of ControlClusterUtils and distributed under the General Public License version 2 license.
#
# ControlClusterUtils is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# ControlClusterUtils is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with ControlClusterUtils. If not, see <http://www.gnu.org/licenses/>.
#
import torch

import numpy as np
Expand Down
17 changes: 17 additions & 0 deletions control_cluster_utils/utilities/sysutils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# Copyright (C) 2023 Andrea Patrizi (AndrePatri, [email protected])
#
# This file is part of ControlClusterUtils and distributed under the General Public License version 2 license.
#
# ControlClusterUtils is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# ControlClusterUtils is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with ControlClusterUtils. If not, see <http://www.gnu.org/licenses/>.
#
import os

class PathsGetter:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ version = "0.1.0"
description = ""
authors = [{name = "AndrePatri", email = "[email protected]"}]
readme = "README.md"
license = {file = "LICENSE"}
license = {file = "LICENSE.md"}
classifiers = ["License :: OSI Approved :: MIT License"]

0 comments on commit c87d988

Please sign in to comment.