refactor: split control blueprints + added env variables#1601
refactor: split control blueprints + added env variables#1601ruthwikdasyam merged 16 commits intodevfrom
Conversation
Greptile SummaryThis PR refactors the monolithic The split is clean and the public API is fully preserved via Key findings:
Confidence Score: 4/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
ENV["default.env\nXARM7_IP / XARM6_IP / CAN_PORT"]
subgraph PKG["dimos/control/blueprints/ (package)"]
INIT["__init__.py\n(re-exports all)"]
HW["_hardware.py\nfactories: mock_arm, xarm7, xarm6, piper, mock_twist_base\nmodel paths: PIPER, XARM6, XARM7"]
BASIC["basic.py\ncoordinator_basic\ncoordinator_mock\ncoordinator_xarm7\ncoordinator_xarm6\ncoordinator_piper"]
DUAL["dual.py\ncoordinator_dual_mock\ncoordinator_dual_xarm\ncoordinator_piper_xarm"]
MOBILE["mobile.py\ncoordinator_mock_twist_base\ncoordinator_mobile_manip_mock"]
TELEOP["teleop.py\ncoordinator_teleop_xarm6\ncoordinator_velocity_xarm6\ncoordinator_combined_xarm6\ncoordinator_cartesian_ik_mock\ncoordinator_cartesian_ik_piper\ncoordinator_teleop_xarm7\ncoordinator_teleop_piper\ncoordinator_teleop_dual"]
end
ENV --> HW
HW --> BASIC
HW --> DUAL
HW --> MOBILE
HW --> TELEOP
BASIC --> INIT
DUAL --> INIT
MOBILE --> INIT
TELEOP --> INIT
INIT --> CLI["dimos run coordinator-*"]
Last reviewed commit: "fix: pre-commit chec..." |
default.env
Outdated
| ROBOT_IP= | ||
| XARM7_IP= | ||
| XARM6_IP= | ||
| CAN_PORT=can0 |
There was a problem hiding this comment.
shouldn't the can_port also be blank in the interest of standardization?
I do realize for pretty much most can based interface can_port is can0. just a nitpick
dimos/control/blueprints/teleop.py
Outdated
| tick_rate=100.0, | ||
| publish_joint_state=True, | ||
| joint_state_frame_id="coordinator", |
There was a problem hiding this comment.
tick_rate/publish_joint_state/joint_state_frame_id are always using the default values. Why always specify them if it's always the default?
dimos/control/blueprints/dual.py
Outdated
| tick_rate=100.0, | ||
| publish_joint_state=True, | ||
| joint_state_frame_id="coordinator", |
There was a problem hiding this comment.
In this file you're also always using defaults.
| ) | ||
| from dimos.utils.data import LfsPath | ||
|
|
||
| XARM7_IP = os.getenv("XARM7_IP") |
There was a problem hiding this comment.
I think this could be nicer if these vars were properties on global_config like robot_ip is so that you can pass them as env vars or on the cli (e.g. --robot-ip=...).
Just something to think about.
2d8ec35
Problem
The monolithic dimos/control/blueprints.py was difficult to navigate,
and had hardcoded IP addresses scattered throughout
Closes DIM-639
Solution
Breaking Changes
None
How to Test
dimos run _blueprint_name_worksContributor License Agreement