Environments¶
Base Environment¶
BaseEnv
¶
PyBullet Environment¶
pybullet_env
¶
PyBulletEnv(config: RobotConfig, visualize: bool = True)
¶
Bases: BaseEnv
PyBullet scene with the X500.
The URDF carries the body pose as joints (base_x_joint …
base_yaw_joint from world), so a full 6-DOF configuration is
applied by setting joint positions.
Source code in drone_planning/envs/pybullet_env.py
set_configuration(config: np.ndarray)
¶
wait_key(key: str | int, message: str = '') -> None
¶
Block until key is pressed in the PyBullet GUI.
Prints message to stdout, then polls keyboard events until the
requested key is triggered. Accepts either a single character
("n") or a raw PyBullet key code (e.g. pb.B3G_RIGHT_ARROW).
Returns early if the GUI window is closed.
Source code in drone_planning/envs/pybullet_env.py
wait_for_close() -> None
¶
Block until the user closes the PyBullet GUI window.
animate_path(path: np.ndarray, fps: float = 60.0, next_key: str | int | None = None) -> bool
¶
Interactively play back a full-DOF path, VAMP-style.
Each row of path is handed to :meth:set_configuration. The
method blocks on the PyBullet GUI with these controls:
SPACE— toggle auto-play (loops end → start)← / →— step one waypoint back / forward (while paused)next_key(opt.) — exit and returnTrue— useful when the caller wants to drive a sequence of demos
Exits when the user closes the GUI window (returns False) or
presses next_key if one is provided (returns True). The
animation starts paused so the caller can read the banner before
anything moves.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
ndarray
|
|
required |
fps
|
float
|
playback frame rate while auto-playing. |
60.0
|
next_key
|
str | int | None
|
optional single-character string or raw PyBullet key code; pressing it exits the viewer. |
None
|
Returns:
| Type | Description |
|---|---|
bool
|
|
Source code in drone_planning/envs/pybullet_env.py
draw_box(center, half_extents, color: tuple[float, float, float, float] = (0.75, 0.75, 0.78, 1.0)) -> int
¶
Visual-only axis-aligned box — e.g. a wall of the scene.