-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
35 changed files
with
1,358 additions
and
5 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 |
---|---|---|
|
@@ -19,3 +19,6 @@ build/ | |
dist/ | ||
*.so | ||
out*/ | ||
|
||
# dev | ||
ref/ |
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
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,49 @@ | ||
"""Configuration for the simulator.""" | ||
|
||
import logging | ||
from dataclasses import dataclass | ||
|
||
import yaml | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
@dataclass | ||
class SimulatorConfig: | ||
joint_id_to_name: dict[int, str] | ||
joint_name_to_id: dict[str, int] | ||
kp: float = 32.0 | ||
kd: float = 10.0 | ||
|
||
@classmethod | ||
def from_file(cls, config_path: str) -> "SimulatorConfig": | ||
"""Load config from YAML file.""" | ||
with open(config_path, "r") as f: | ||
config_data = yaml.safe_load(f) | ||
|
||
# Load joint mappings | ||
joint_name_to_id = config_data.get("joint_mappings", {}) | ||
joint_id_to_name = {v: k for k, v in joint_name_to_id.items()} | ||
|
||
# Load control parameters | ||
kp = config_data.get("control", {}).get("kp", 1.0) | ||
kd = config_data.get("control", {}).get("kd", 0.1) | ||
|
||
return cls(joint_id_to_name=joint_id_to_name, joint_name_to_id=joint_name_to_id, kp=kp, kd=kd) | ||
|
||
@classmethod | ||
def default(cls) -> "SimulatorConfig": | ||
"""Create default config with standard joint mappings.""" | ||
joint_name_to_id = { | ||
"L_hip_y": 1, | ||
"L_hip_x": 2, | ||
"L_hip_z": 3, | ||
"L_knee": 4, | ||
"L_ankle_y": 5, | ||
"R_hip_y": 6, | ||
"R_hip_x": 7, | ||
"R_hip_z": 8, | ||
"R_knee": 9, | ||
"R_ankle_y": 10, | ||
} | ||
return cls(joint_id_to_name={v: k for k, v in joint_name_to_id.items()}, joint_name_to_id=joint_name_to_id) |
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,13 @@ | ||
# URDF/XML development: | ||
1. kol run https://cad.onshape.com/documents/bc3a557e2f92bdcea4099f0d/w/09713ac603d461fc1dff6b5d/e/5a4acdbffe6f8ed7c4e34970 --config-path config_example.json # noqa: E501 | ||
2. python sim/scripts/create_fixed_torso.py | ||
3. Rotate first link | ||
<joint name="floating_base" type="fixed"> | ||
<origin rpy="-1.57 3.14 0" xyz="0 0 0"/> | ||
<parent link="base"/> | ||
<child link="body1-part"/> | ||
</joint> | ||
|
||
4. Fix left leg axes to align with expected directions | ||
5. urf2mjcf robot.urdf -o robot.xml | ||
|
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.