Returns a ``tensordict`` containing the physical parameters such as gravitational force and torque or speed limits.
(g=10.0, batch_size=None)
| 485 | |
| 486 | |
| 487 | def gen_params(g=10.0, batch_size=None) -> TensorDictBase: |
| 488 | """Returns a ``tensordict`` containing the physical parameters such as gravitational force and torque or speed limits.""" |
| 489 | if batch_size is None: |
| 490 | batch_size = [] |
| 491 | td = TensorDict( |
| 492 | { |
| 493 | "params": TensorDict( |
| 494 | { |
| 495 | "max_speed": 8, |
| 496 | "max_torque": 2.0, |
| 497 | "dt": 0.05, |
| 498 | "g": g, |
| 499 | "m": 1.0, |
| 500 | "l": 1.0, |
| 501 | }, |
| 502 | [], |
| 503 | ) |
| 504 | }, |
| 505 | [], |
| 506 | ) |
| 507 | if batch_size: |
| 508 | td = td.expand(batch_size).contiguous() |
| 509 | return td |
| 510 | |
| 511 | |
| 512 | ###################################################################### |
nothing calls this directly
no outgoing calls
no test coverage detected