Core API¶
This page documents the simulator-agnostic Python API surface exposed by the refactored package layout.
Scene Subpackage¶
Public scene-definition types and YAML I/O exports.
- class simkit.core.scene.Camera(position, target, fov, near_clip, far_clip)[source][source]¶
Bases:
objectCamera configuration.
- far_clip: float¶
- fov: float¶
- near_clip: float¶
- class simkit.core.scene.CollisionProperties(enabled, shape, size)[source][source]¶
Bases:
objectCollision properties for objects.
- Parameters:
enabled (bool)
shape (str)
size (List[float])
- enabled: bool¶
- shape: str¶
- size: List[float]¶
- class simkit.core.scene.Color(r, g, b, a=1.0)[source][source]¶
Bases:
objectRGBA color representation.
- Parameters:
r (float)
g (float)
b (float)
a (float)
- a: float = 1.0¶
- b: float¶
- g: float¶
- r: float¶
- class simkit.core.scene.DirectionalLight(direction, color, intensity)[source][source]¶
Bases:
objectDirectional light configuration.
- intensity: float¶
- class simkit.core.scene.Environment(gravity, wind, time_step)[source][source]¶
Bases:
objectEnvironment settings for the scene.
- time_step: float¶
- class simkit.core.scene.Lighting(ambient, directional)[source][source]¶
Bases:
objectLighting configuration.
- Parameters:
ambient (Color)
directional (List[DirectionalLight])
- directional: List[DirectionalLight]¶
- class simkit.core.scene.PhysicsProperties(mass, friction, restitution)[source][source]¶
Bases:
objectPhysics properties for objects.
- Parameters:
mass (float)
friction (float)
restitution (float)
- friction: float¶
- mass: float¶
- restitution: float¶
- class simkit.core.scene.Quaternion(x, y, z, w)[source][source]¶
Bases:
objectQuaternion rotation representation.
- Parameters:
x (float)
y (float)
z (float)
w (float)
- w: float¶
- x: float¶
- y: float¶
- z: float¶
- class simkit.core.scene.Scene(name, description, version, environment, objects, lighting, camera)[source][source]¶
Bases:
objectComplete scene definition.
- Parameters:
name (str)
description (str)
version (str)
environment (Environment)
objects (List[SceneObject])
lighting (Lighting)
camera (Camera)
- description: str¶
- environment: Environment¶
- get_object_by_name(name)[source][source]¶
Get object by name.
- Return type:
Optional[SceneObject]- Parameters:
name (str)
- get_objects_by_type(obj_type)[source][source]¶
Get all objects of a specific type.
- Return type:
List[SceneObject]- Parameters:
obj_type (str)
- name: str¶
- objects: List[SceneObject]¶
- version: str¶
- class simkit.core.scene.SceneObject(name, type, position, rotation, scale, physics, visual, collision)[source][source]¶
Bases:
objectObject in the scene.
- Parameters:
name (str)
type (str)
position (Vector3)
rotation (Quaternion)
scale (Vector3)
physics (PhysicsProperties)
visual (VisualProperties)
collision (CollisionProperties)
- collision: CollisionProperties¶
- get_world_transform()[source][source]¶
Get world transformation matrix data.
- Return type:
Dict[str,Any]
- name: str¶
- physics: PhysicsProperties¶
- rotation: Quaternion¶
- type: str¶
- visual: VisualProperties¶
- class simkit.core.scene.SceneReader[source][source]¶
Bases:
objectReader for YAML scene definition files.
- static load_scene(file_path)[source][source]¶
Load a scene from a YAML file.
- Parameters:
file_path (
str) – Path to the YAML scene definition file- Return type:
- Returns:
Scene object containing all scene data
- Raises:
FileNotFoundError – If the file doesn’t exist
yaml.YAMLError – If the YAML is invalid
KeyError – If required fields are missing
- class simkit.core.scene.SceneWriter[source][source]¶
Bases:
objectWriter for saving scenes to YAML files.
Scene Types¶
Dataclasses and helper types for structured scene definitions.
- class simkit.core.scene.scene_types.Camera(position, target, fov, near_clip, far_clip)[source][source]¶
Bases:
objectCamera configuration.
- far_clip: float¶
- fov: float¶
- near_clip: float¶
- class simkit.core.scene.scene_types.CollisionProperties(enabled, shape, size)[source][source]¶
Bases:
objectCollision properties for objects.
- Parameters:
enabled (bool)
shape (str)
size (List[float])
- enabled: bool¶
- shape: str¶
- size: List[float]¶
- class simkit.core.scene.scene_types.Color(r, g, b, a=1.0)[source][source]¶
Bases:
objectRGBA color representation.
- Parameters:
r (float)
g (float)
b (float)
a (float)
- a: float = 1.0¶
- b: float¶
- g: float¶
- r: float¶
- class simkit.core.scene.scene_types.DirectionalLight(direction, color, intensity)[source][source]¶
Bases:
objectDirectional light configuration.
- intensity: float¶
- class simkit.core.scene.scene_types.Environment(gravity, wind, time_step)[source][source]¶
Bases:
objectEnvironment settings for the scene.
- time_step: float¶
- class simkit.core.scene.scene_types.Lighting(ambient, directional)[source][source]¶
Bases:
objectLighting configuration.
- Parameters:
ambient (Color)
directional (List[DirectionalLight])
- directional: List[DirectionalLight]¶
- class simkit.core.scene.scene_types.PhysicsProperties(mass, friction, restitution)[source][source]¶
Bases:
objectPhysics properties for objects.
- Parameters:
mass (float)
friction (float)
restitution (float)
- friction: float¶
- mass: float¶
- restitution: float¶
- class simkit.core.scene.scene_types.Quaternion(x, y, z, w)[source][source]¶
Bases:
objectQuaternion rotation representation.
- Parameters:
x (float)
y (float)
z (float)
w (float)
- w: float¶
- x: float¶
- y: float¶
- z: float¶
- class simkit.core.scene.scene_types.Scene(name, description, version, environment, objects, lighting, camera)[source][source]¶
Bases:
objectComplete scene definition.
- Parameters:
name (str)
description (str)
version (str)
environment (Environment)
objects (List[SceneObject])
lighting (Lighting)
camera (Camera)
- description: str¶
- environment: Environment¶
- get_object_by_name(name)[source][source]¶
Get object by name.
- Return type:
Optional[SceneObject]- Parameters:
name (str)
- get_objects_by_type(obj_type)[source][source]¶
Get all objects of a specific type.
- Return type:
List[SceneObject]- Parameters:
obj_type (str)
- name: str¶
- objects: List[SceneObject]¶
- version: str¶
- class simkit.core.scene.scene_types.SceneObject(name, type, position, rotation, scale, physics, visual, collision)[source][source]¶
Bases:
objectObject in the scene.
- Parameters:
name (str)
type (str)
position (Vector3)
rotation (Quaternion)
scale (Vector3)
physics (PhysicsProperties)
visual (VisualProperties)
collision (CollisionProperties)
- collision: CollisionProperties¶
- get_world_transform()[source][source]¶
Get world transformation matrix data.
- Return type:
Dict[str,Any]
- name: str¶
- physics: PhysicsProperties¶
- rotation: Quaternion¶
- type: str¶
- visual: VisualProperties¶
- class simkit.core.scene.scene_types.Vector3(x, y, z)[source][source]¶
Bases:
object3D vector representation.
- Parameters:
x (float)
y (float)
z (float)
- x: float¶
- y: float¶
- z: float¶
Scene Reader¶
YAML readers and writers for structured scene definitions.
- class simkit.core.scene.scene_reader.SceneReader[source][source]¶
Bases:
objectReader for YAML scene definition files.
- static load_scene(file_path)[source][source]¶
Load a scene from a YAML file.
- Parameters:
file_path (
str) – Path to the YAML scene definition file- Return type:
- Returns:
Scene object containing all scene data
- Raises:
FileNotFoundError – If the file doesn’t exist
yaml.YAMLError – If the YAML is invalid
KeyError – If required fields are missing