imt-ring 1.6.27__tar.gz → 1.6.29__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. {imt_ring-1.6.27 → imt_ring-1.6.29}/PKG-INFO +5 -1
  2. {imt_ring-1.6.27 → imt_ring-1.6.29}/pyproject.toml +1 -1
  3. {imt_ring-1.6.27 → imt_ring-1.6.29}/readme.md +4 -0
  4. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/imt_ring.egg-info/PKG-INFO +5 -1
  5. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/__init__.py +4 -1
  6. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/algorithms/generator/base.py +10 -1
  7. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/base.py +4 -3
  8. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/io/xml/to_xml.py +4 -3
  9. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/maths.py +13 -0
  10. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/rendering/mujoco_render.py +9 -2
  11. {imt_ring-1.6.27 → imt_ring-1.6.29}/setup.cfg +0 -0
  12. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/imt_ring.egg-info/SOURCES.txt +0 -0
  13. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/imt_ring.egg-info/dependency_links.txt +0 -0
  14. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/imt_ring.egg-info/requires.txt +0 -0
  15. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/imt_ring.egg-info/top_level.txt +0 -0
  16. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/algebra.py +0 -0
  17. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/algorithms/__init__.py +0 -0
  18. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/algorithms/_random.py +0 -0
  19. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/algorithms/custom_joints/__init__.py +0 -0
  20. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/algorithms/custom_joints/rr_imp_joint.py +0 -0
  21. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/algorithms/custom_joints/rr_joint.py +0 -0
  22. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/algorithms/custom_joints/rsaddle_joint.py +0 -0
  23. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/algorithms/custom_joints/suntay.py +0 -0
  24. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/algorithms/dynamics.py +0 -0
  25. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/algorithms/generator/__init__.py +0 -0
  26. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/algorithms/generator/batch.py +0 -0
  27. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/algorithms/generator/finalize_fns.py +0 -0
  28. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/algorithms/generator/motion_artifacts.py +0 -0
  29. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/algorithms/generator/pd_control.py +0 -0
  30. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/algorithms/generator/setup_fns.py +0 -0
  31. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/algorithms/generator/types.py +0 -0
  32. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/algorithms/jcalc.py +0 -0
  33. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/algorithms/kinematics.py +0 -0
  34. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/algorithms/sensors.py +0 -0
  35. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/io/__init__.py +0 -0
  36. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/io/examples/branched.xml +0 -0
  37. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/io/examples/exclude/knee_trans_dof.xml +0 -0
  38. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/io/examples/exclude/standard_sys.xml +0 -0
  39. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/io/examples/exclude/standard_sys_rr_imp.xml +0 -0
  40. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/io/examples/inv_pendulum.xml +0 -0
  41. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/io/examples/knee_flexible_imus.xml +0 -0
  42. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/io/examples/spherical_stiff.xml +0 -0
  43. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/io/examples/symmetric.xml +0 -0
  44. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/io/examples/test_all_1.xml +0 -0
  45. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/io/examples/test_all_2.xml +0 -0
  46. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/io/examples/test_ang0_pos0.xml +0 -0
  47. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/io/examples/test_control.xml +0 -0
  48. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/io/examples/test_double_pendulum.xml +0 -0
  49. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/io/examples/test_free.xml +0 -0
  50. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/io/examples/test_kinematics.xml +0 -0
  51. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/io/examples/test_morph_system/four_seg_seg1.xml +0 -0
  52. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/io/examples/test_morph_system/four_seg_seg3.xml +0 -0
  53. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/io/examples/test_randomize_position.xml +0 -0
  54. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/io/examples/test_sensors.xml +0 -0
  55. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/io/examples/test_three_seg_seg2.xml +0 -0
  56. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/io/examples.py +0 -0
  57. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/io/test_examples.py +0 -0
  58. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/io/xml/__init__.py +0 -0
  59. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/io/xml/abstract.py +0 -0
  60. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/io/xml/from_xml.py +0 -0
  61. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/io/xml/test_from_xml.py +0 -0
  62. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/io/xml/test_to_xml.py +0 -0
  63. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/ml/__init__.py +0 -0
  64. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/ml/base.py +0 -0
  65. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/ml/callbacks.py +0 -0
  66. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/ml/ml_utils.py +0 -0
  67. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/ml/optimizer.py +0 -0
  68. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/ml/params/0x13e3518065c21cd8.pickle +0 -0
  69. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/ml/params/0x1d76628065a71e0f.pickle +0 -0
  70. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/ml/ringnet.py +0 -0
  71. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/ml/rnno_v1.py +0 -0
  72. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/ml/train.py +0 -0
  73. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/ml/training_loop.py +0 -0
  74. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/rendering/__init__.py +0 -0
  75. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/rendering/base_render.py +0 -0
  76. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/rendering/vispy_render.py +0 -0
  77. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/rendering/vispy_visuals.py +0 -0
  78. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/sim2real/__init__.py +0 -0
  79. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/sim2real/sim2real.py +0 -0
  80. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/spatial.py +0 -0
  81. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/sys_composer/__init__.py +0 -0
  82. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/sys_composer/delete_sys.py +0 -0
  83. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/sys_composer/inject_sys.py +0 -0
  84. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/sys_composer/morph_sys.py +0 -0
  85. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/utils/__init__.py +0 -0
  86. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/utils/backend.py +0 -0
  87. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/utils/batchsize.py +0 -0
  88. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/utils/colab.py +0 -0
  89. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/utils/dataloader.py +0 -0
  90. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/utils/dataloader_torch.py +0 -0
  91. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/utils/hdf5.py +0 -0
  92. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/utils/normalizer.py +0 -0
  93. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/utils/path.py +0 -0
  94. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/utils/randomize_sys.py +0 -0
  95. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/utils/register_gym_envs/__init__.py +0 -0
  96. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/utils/register_gym_envs/saddle.py +0 -0
  97. {imt_ring-1.6.27 → imt_ring-1.6.29}/src/ring/utils/utils.py +0 -0
  98. {imt_ring-1.6.27 → imt_ring-1.6.29}/tests/test_algebra.py +0 -0
  99. {imt_ring-1.6.27 → imt_ring-1.6.29}/tests/test_base.py +0 -0
  100. {imt_ring-1.6.27 → imt_ring-1.6.29}/tests/test_custom_joints.py +0 -0
  101. {imt_ring-1.6.27 → imt_ring-1.6.29}/tests/test_dynamics.py +0 -0
  102. {imt_ring-1.6.27 → imt_ring-1.6.29}/tests/test_generator.py +0 -0
  103. {imt_ring-1.6.27 → imt_ring-1.6.29}/tests/test_jcalc.py +0 -0
  104. {imt_ring-1.6.27 → imt_ring-1.6.29}/tests/test_jit.py +0 -0
  105. {imt_ring-1.6.27 → imt_ring-1.6.29}/tests/test_kinematics.py +0 -0
  106. {imt_ring-1.6.27 → imt_ring-1.6.29}/tests/test_maths.py +0 -0
  107. {imt_ring-1.6.27 → imt_ring-1.6.29}/tests/test_ml_utils.py +0 -0
  108. {imt_ring-1.6.27 → imt_ring-1.6.29}/tests/test_motion_artifacts.py +0 -0
  109. {imt_ring-1.6.27 → imt_ring-1.6.29}/tests/test_pd_control.py +0 -0
  110. {imt_ring-1.6.27 → imt_ring-1.6.29}/tests/test_quickstart_example.py +0 -0
  111. {imt_ring-1.6.27 → imt_ring-1.6.29}/tests/test_random.py +0 -0
  112. {imt_ring-1.6.27 → imt_ring-1.6.29}/tests/test_randomize.py +0 -0
  113. {imt_ring-1.6.27 → imt_ring-1.6.29}/tests/test_rcmg.py +0 -0
  114. {imt_ring-1.6.27 → imt_ring-1.6.29}/tests/test_render.py +0 -0
  115. {imt_ring-1.6.27 → imt_ring-1.6.29}/tests/test_sensors.py +0 -0
  116. {imt_ring-1.6.27 → imt_ring-1.6.29}/tests/test_sim2real.py +0 -0
  117. {imt_ring-1.6.27 → imt_ring-1.6.29}/tests/test_sys_composer.py +0 -0
  118. {imt_ring-1.6.27 → imt_ring-1.6.29}/tests/test_train.py +0 -0
  119. {imt_ring-1.6.27 → imt_ring-1.6.29}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: imt-ring
3
- Version: 1.6.27
3
+ Version: 1.6.29
4
4
  Summary: RING: Recurrent Inertial Graph-based Estimator
5
5
  Author-email: Simon Bachhuber <simon.bachhuber@fau.de>
6
6
  Project-URL: Homepage, https://github.com/SimiPixel/ring
@@ -38,6 +38,10 @@ Requires-Dist: nbmake; extra == "dev"
38
38
  # Recurrent Inertial Graph-based Estimator (RING)
39
39
  <img src="https://raw.githubusercontent.com/simon-bachhuber/ring/main/docs/img/coverage_badge.svg" height="20" />
40
40
 
41
+ > **ℹ️ Tip:**
42
+ >
43
+ > Check out my new plug-and-play interface for inertial motion tracking (RING included) [here](https://github.com/simon-bachhuber/imt.git).
44
+
41
45
  ## Installation
42
46
 
43
47
  Supports `Python=3.10/3.11/3.12` (tested).
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "imt-ring"
7
- version = "1.6.27"
7
+ version = "1.6.29"
8
8
  authors = [
9
9
  { name="Simon Bachhuber", email="simon.bachhuber@fau.de" },
10
10
  ]
@@ -5,6 +5,10 @@
5
5
  # Recurrent Inertial Graph-based Estimator (RING)
6
6
  <img src="https://raw.githubusercontent.com/simon-bachhuber/ring/main/docs/img/coverage_badge.svg" height="20" />
7
7
 
8
+ > **ℹ️ Tip:**
9
+ >
10
+ > Check out my new plug-and-play interface for inertial motion tracking (RING included) [here](https://github.com/simon-bachhuber/imt.git).
11
+
8
12
  ## Installation
9
13
 
10
14
  Supports `Python=3.10/3.11/3.12` (tested).
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: imt-ring
3
- Version: 1.6.27
3
+ Version: 1.6.29
4
4
  Summary: RING: Recurrent Inertial Graph-based Estimator
5
5
  Author-email: Simon Bachhuber <simon.bachhuber@fau.de>
6
6
  Project-URL: Homepage, https://github.com/SimiPixel/ring
@@ -38,6 +38,10 @@ Requires-Dist: nbmake; extra == "dev"
38
38
  # Recurrent Inertial Graph-based Estimator (RING)
39
39
  <img src="https://raw.githubusercontent.com/simon-bachhuber/ring/main/docs/img/coverage_badge.svg" height="20" />
40
40
 
41
+ > **ℹ️ Tip:**
42
+ >
43
+ > Check out my new plug-and-play interface for inertial motion tracking (RING included) [here](https://github.com/simon-bachhuber/imt.git).
44
+
41
45
  ## Installation
42
46
 
43
47
  Supports `Python=3.10/3.11/3.12` (tested).
@@ -98,7 +98,10 @@ def RING(lam: list[int] | None, Ts: float | None, **kwargs) -> ml.AbstractFilter
98
98
  add_Ts = True
99
99
 
100
100
  ringnet = ml.RING(
101
- params=params, lam=None if lam is None else tuple(lam), jit=False, name="RING"
101
+ params=params,
102
+ lam=None if lam is None else tuple(lam),
103
+ jit=config.pop("jit", False),
104
+ name="RING",
102
105
  )
103
106
  ringnet = ml.base.ScaleX_FilterWrapper(ringnet)
104
107
  if config["use_lpf"]:
@@ -55,6 +55,11 @@ class RCMG:
55
55
  ) -> None:
56
56
  "Random Chain Motion Generator"
57
57
 
58
+ # add some default values
59
+ randomize_hz_kwargs_defaults = dict(add_dt=True)
60
+ randomize_hz_kwargs_defaults.update(randomize_hz_kwargs)
61
+ randomize_hz_kwargs = randomize_hz_kwargs_defaults
62
+
58
63
  sys, config = utils.to_list(sys), utils.to_list(config)
59
64
  sys_ml = sys[0] if sys_ml is None else sys_ml
60
65
 
@@ -409,7 +414,11 @@ def _build_mconfig_batched_generator(
409
414
  @jax.vmap
410
415
  def _vmapped_context(key, q, sys):
411
416
  x, _ = jax.vmap(kinematics.forward_kinematics_transforms, (None, 0))(sys, q)
412
- X = {"dt": jnp.array(sys.dt)} if randomize_hz else {}
417
+ X = (
418
+ {"dt": jnp.array(sys.dt)}
419
+ if (randomize_hz and randomize_hz_kwargs["add_dt"])
420
+ else {}
421
+ )
413
422
  Xy, extras = (X, {}), (key, q, x, sys)
414
423
  return _finalize_fn(Xy, extras)
415
424
 
@@ -558,6 +558,7 @@ class System(_Base):
558
558
  new_stif: Optional[jax.Array] = None,
559
559
  new_zero: Optional[jax.Array] = None,
560
560
  seed: int = 1,
561
+ warn: bool = True,
561
562
  ):
562
563
  "By default damping, stiffness are set to zero."
563
564
  from ring.algorithms import get_joint_model
@@ -587,7 +588,7 @@ class System(_Base):
587
588
 
588
589
  jm = get_joint_model(new_joint_type)
589
590
  if jm.init_joint_params is not None:
590
- sys = sys.from_str(sys.to_str(), seed=seed)
591
+ sys = sys.from_str(sys.to_str(warn=warn), seed=seed)
591
592
 
592
593
  return sys
593
594
 
@@ -786,8 +787,8 @@ class System(_Base):
786
787
  def from_str(xml: str, seed: int = 1):
787
788
  return ring.io.load_sys_from_str(xml, seed)
788
789
 
789
- def to_str(self) -> str:
790
- return ring.io.save_sys_to_str(self)
790
+ def to_str(self, warn: bool = True) -> str:
791
+ return ring.io.save_sys_to_str(self, warn=warn)
791
792
 
792
793
  def to_xml(self, path: str) -> None:
793
794
  ring.io.save_sys_to_xml(self, path)
@@ -5,18 +5,19 @@ from xml.etree.ElementTree import SubElement
5
5
  from xml.etree.ElementTree import tostring
6
6
 
7
7
  import jax.numpy as jnp
8
- from ring import base
9
8
  from tree_utils import batch_concat
10
9
 
10
+ from ring import base
11
+
11
12
  from . import abstract
12
13
  from .abstract import _to_str
13
14
 
14
15
 
15
- def save_sys_to_str(sys: base.System) -> str:
16
+ def save_sys_to_str(sys: base.System, warn: bool = True) -> str:
16
17
  for joint_type in sys.links.joint_params:
17
18
  for i, link_name in enumerate(sys.link_names):
18
19
  joint_params_flat = batch_concat((sys.links[i]).joint_params[joint_type], 0)
19
- if not jnp.all(joint_params_flat == 0.0):
20
+ if warn and (not jnp.all(joint_params_flat == 0.0)):
20
21
  warnings.warn(
21
22
  "The system has `sys.links.joint_params` unequal to the 'default'"
22
23
  f" value (of zeros). In particular the link `{link_name}` has for"
@@ -90,6 +90,19 @@ def angle_error(q, qhat):
90
90
  return jnp.abs(quat_angle(quat_mul(quat_inv(q), qhat)))
91
91
 
92
92
 
93
+ def inclination_loss(q, qhat):
94
+ """Absolute inclination angle in radians. `q`'s are from body-to-eps.
95
+ This function fullfills
96
+ inclination_loss(q1, q2)
97
+ == inclination_loss(qmt.addHeading(q1, H), q2)
98
+ == inclination_loss(q1, qmt.addHeading(q2, H))`
99
+ for any q1, q2, H
100
+ """
101
+ q_rel = quat_mul(q, quat_inv(qhat))
102
+ q_rel_incl = quat_project(q_rel, [0, 0, 1.0])[1]
103
+ return jnp.abs(quat_angle(q_rel_incl))
104
+
105
+
93
106
  def unit_quats_like(array):
94
107
  "Array of *unit* quaternions of identical shape."
95
108
  if array.shape[-1] != 4:
@@ -8,7 +8,10 @@ from ring import maths
8
8
 
9
9
  _skybox = """<texture name="skybox" type="skybox" builtin="gradient" rgb1=".4 .6 .8" rgb2="0 0 0" width="800" height="800" mark="random" markrgb="1 1 1"/>""" # noqa: E501
10
10
  _skybox_white = """<texture name="skybox" type="skybox" builtin="gradient" rgb1="1 1 1" rgb2="1 1 1" width="800" height="800" mark="random" markrgb="1 1 1"/>""" # noqa: E501
11
- _floor = """<geom name="floor" pos="0 0 -0.84" size="0 0 1" type="plane" material="matplane" mass="0"/>""" # noqa: E501
11
+
12
+
13
+ def _floor(floor_z: float) -> str:
14
+ return f"""<geom name="floor" pos="0 0 {floor_z}" size="0 0 1" type="plane" material="matplane" mass="0"/>""" # noqa: E501
12
15
 
13
16
 
14
17
  def _build_model_of_geoms(
@@ -16,6 +19,7 @@ def _build_model_of_geoms(
16
19
  cameras: dict[int, Sequence[str]],
17
20
  lights: dict[int, Sequence[str]],
18
21
  floor: bool,
22
+ floor_z: float,
19
23
  stars: bool,
20
24
  debug: bool,
21
25
  ) -> mujoco.MjModel:
@@ -94,7 +98,7 @@ def _build_model_of_geoms(
94
98
  <camera pos="0 -1 1" name="target" mode="targetbodycom" target="{targetbody}"/>
95
99
  <camera pos="0 -3 3" name="targetfar" mode="targetbodycom" target="{targetbody}"/>
96
100
  <camera pos="0 -5 5" name="targetFar" mode="targetbodycom" target="{targetbody}"/>
97
- {_floor if floor else ''}
101
+ {_floor(floor_z) if floor else ''}
98
102
  {inside_worldbody_cameras}
99
103
  {inside_worldbody_lights}
100
104
  {inside_worldbody}
@@ -171,6 +175,7 @@ class MujocoScene:
171
175
  add_lights: dict[int, str | Sequence[str]] = _default_lights,
172
176
  show_stars: bool = True,
173
177
  show_floor: bool = True,
178
+ floor_z: float = -0.84,
174
179
  debug: bool = False,
175
180
  ) -> None:
176
181
  self.debug = debug
@@ -185,6 +190,7 @@ class MujocoScene:
185
190
  self.add_cameras, self.add_lights = to_list(add_cameras), to_list(add_lights)
186
191
  self.show_stars = show_stars
187
192
  self.show_floor = show_floor
193
+ self.floor_z = floor_z
188
194
 
189
195
  def init(self, geoms: list[base.Geometry]):
190
196
  self._parent_ids = list(set([geom.link_idx for geom in geoms]))
@@ -193,6 +199,7 @@ class MujocoScene:
193
199
  self.add_cameras,
194
200
  self.add_lights,
195
201
  floor=self.show_floor,
202
+ floor_z=self.floor_z,
196
203
  stars=self.show_stars,
197
204
  debug=self.debug,
198
205
  )
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes