Adopt the two-boolean backend convention; simplify the generator - #16
Merged
Conversation
T-K-233
force-pushed
the
feat/backend-arg-convention
branch
from
August 22, 2026 00:06
c611c3c to
581dc2b
Compare
Backend selection followed no upstream convention: a `use_sim` / `use_fake_hardware` pair plus, on the ros2_control variants, a `mode` string naming a subset of joint groups. Rename the pair to `sim_mujoco` / `use_mock_hardware`, the spelling the Universal Robots description uses (one boolean per non-real backend, real hardware as the fallback), and drop `mode` entirely -- no variant still has an optional group, and the stub-bus machinery it needed died with the arms_neck configuration. `sim_mujoco` is deliberately not called `use_sim`: it selects a hardware plugin, and nothing about the clock. `use_sim_time` remains a node parameter. With that gone, the joint macros no longer need to know which backend they are being expanded for. They previously wrapped every hardware <param> in `xacro:unless(use_sim or use_fake_hardware)`; now they always emit them, since mock_components and MujocoSystem both ignore params they do not recognise. That removes two params from every macro and two arguments from every one of the ~250 instantiations. Joints with a four-bar linkage move to their own `<robot>_linkage_joint` macro rather than carrying six defaulted params that only two joints in the repo ever set. Also in this pass, no behaviour change: - lite_biped/lite_biped_debug point at humanoid_devices_witmotion/WitImuSensor, following the driver's rename out of humanoid_devices_imu_hardware. - The MJCF writer pretty-prints the trailing <sensor>/<actuator> sections and drops the stray blank lines, so the models are reviewable as diffs instead of one 8 kB line. - urdf_to_xacro grew line-wrapping helpers (_pack, _macro_open) so generated macro signatures wrap at a column instead of being hand-spaced, which is what makes the artifact diffs here as large as they are. - Docstrings and the README/package.xml prose brought in line, including a hardware-backend table. Verified: `pytest` green (1582 passed, 6 skipped), and regenerating every variant with `--only urdf,mjcf,xacro` reproduces the committed artifacts byte-for-byte. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014oX3bCSr6vo5CwPdrRfZGX
T-K-233
force-pushed
the
feat/backend-arg-convention
branch
from
August 22, 2026 00:57
581dc2b to
df73afd
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backend args
Backend selection followed no upstream convention: a
use_sim/use_fake_hardwarepair plus, on theros2_controlvariants, amodestring naming a subset of joint groups.sim_mujoco/use_mock_hardware— the spelling the Universal Robots description uses: one boolean per non-real backend, real hardware as the fallback.modeentirely. No variant still has an optional group, and the stub-bus machinery it needed died with thearms_neckconfiguration.sim_mujocois deliberately notuse_sim: it selects a hardware plugin and says nothing about the clock.use_sim_timeremains a node parameter.Backend-agnostic joint macros
With
modegone the joint macros no longer need to know which backend they are expanded for. They previously wrapped every hardware<param>inxacro:unless(use_sim or use_fake_hardware); now they always emit them, sincemock_componentsandMujocoSystemboth ignore params they do not recognise. That removes two params from every macro and two arguments from each of the ~250 instantiations.Joints with a four-bar linkage move to their own
<robot>_linkage_jointmacro instead of carrying six defaulted params that only two joints in the repo ever set.Also in this pass (no behaviour change)
lite_biped/lite_biped_debugpoint athumanoid_devices_witmotion/WitImuSensor, following the driver's rename out ofhumanoid_devices_imu_hardware.<sensor>/<actuator>sections and drops the stray blank lines, so models are reviewable as diffs instead of one 8 kB line.urdf_to_xacrogrew line-wrapping helpers (_pack,_macro_open) so generated macro signatures wrap at a column rather than being hand-spaced — this is what makes the artifact diffs as large as they are.package.xmlprose brought in line, including a hardware-backend table.Stacked on #15 (
cad-extra) — merge that first, and this PR's base retargets tomainautomatically.Verification
uv run --extra cad pytest— 1582 passed, 6 skippedrobot-assets-generate <variant> --only urdf,mjcf,xacrofor all six variants reproduces the committed artifacts byte-for-byteDownstream
Consumers passing
use_sim:=/use_fake_hardware:=(and anymode:=) to a Lite xacro must move tosim_mujoco:=/use_mock_hardware:=.🤖 Generated with Claude Code
https://claude.ai/code/session_014oX3bCSr6vo5CwPdrRfZGX