-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a092be4
commit c87d988
Showing
18 changed files
with
319 additions
and
1 deletion.
There are no files selected for viewing
File renamed without changes.
17 changes: 17 additions & 0 deletions
17
control_cluster_utils/cluster_client/control_cluster_client.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
17 changes: 17 additions & 0 deletions
17
control_cluster_utils/cluster_server/control_cluster_srvr.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
17 changes: 17 additions & 0 deletions
17
control_cluster_utils/tests/test_shared_mem_manager_client.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
17 changes: 17 additions & 0 deletions
17
control_cluster_utils/tests/test_shared_mem_manager_server.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
17 changes: 17 additions & 0 deletions
17
control_cluster_utils/utilities/debugger_gui/cluster_debugger.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
17 changes: 17 additions & 0 deletions
17
control_cluster_utils/utilities/debugger_gui/plot_utils.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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"] |