-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add basic numpy conversions * Add unittests | Fix bugs * Add .gitignore * Fix feedforward in unittests * Fix docstrings
- Loading branch information
Showing
6 changed files
with
630 additions
and
0 deletions.
There are no files selected for viewing
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,17 @@ | ||
# Byte-compiled / optimized / DLL files | ||
**/__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Linter cache | ||
*.ruff_cache | ||
|
||
# Colcon custom files | ||
COLCON_IGNORE | ||
AMENT_IGNORE | ||
|
||
# VS Code | ||
.vscode |
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
Empty file.
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,54 @@ | ||
from typing import Annotated, List, Literal | ||
from dataclasses import dataclass | ||
import numpy as np | ||
import numpy.typing as npt | ||
|
||
np_array6 = Annotated[npt.NDArray[np.float64], Literal[6]] | ||
np_array7 = Annotated[npt.NDArray[np.float64], Literal[7]] | ||
|
||
|
||
@dataclass | ||
class JointState: | ||
"""Structure containing JointState information similarly to ROS message | ||
sensor_msgs.msg.JointState. | ||
""" | ||
|
||
name: List[str] | ||
position: npt.NDArray[np.float64] | ||
velocity: npt.NDArray[np.float64] | ||
effort: npt.NDArray[np.float64] | ||
|
||
|
||
@dataclass | ||
class Contact: | ||
"""Structure containing Contact information similarly to ROS message | ||
linear_feedback_controller_msgs.msg.Contact. | ||
""" | ||
|
||
active: bool | ||
name: str | ||
wrench: np_array6 | ||
pose: np_array7 | ||
|
||
|
||
@dataclass | ||
class Sensor: | ||
"""Structure containing Sensor information similarly to ROS message | ||
linear_feedback_controller_msgs.msg.Sensor. | ||
""" | ||
|
||
base_pose: np_array7 | ||
base_twist: np_array6 | ||
joint_state: JointState | ||
contacts: List[Contact] | ||
|
||
|
||
@dataclass | ||
class Control: | ||
"""Structure containing Control information similarly to ROS message | ||
linear_feedback_controller_msgs.msg.Control. | ||
""" | ||
|
||
feedback_gain: npt.NDArray[np.float64] | ||
feedforward: npt.NDArray[np.float64] | ||
initial_state: Sensor |
Oops, something went wrong.