Expand description
bevy-sensor: Multi-view rendering for YCB object dataset
This library provides Bevy-based rendering of 3D objects from multiple viewpoints, designed to match TBP (Thousand Brains Project) habitat sensor conventions for use in neocortx sensorimotor learning experiments.
§Headless Rendering (NEW)
Render directly to memory buffers for use in sensorimotor learning:
ⓘ
use bevy_sensor::{render_to_buffer, RenderConfig, ViewpointConfig, ObjectRotation};
use std::path::Path;
let config = RenderConfig::tbp_default(); // 64x64, RGBD
let viewpoint = bevy_sensor::generate_viewpoints(&ViewpointConfig::default())[0];
let rotation = ObjectRotation::identity();
let output = render_to_buffer(
Path::new("/tmp/ycb/003_cracker_box"),
&viewpoint,
&rotation,
&config,
)?;
// output.rgba: Vec<u8> - RGBA pixels (64*64*4 bytes)
// output.depth: Vec<f32> - Depth values (64*64 floats)§File-based Capture (Legacy)
ⓘ
use bevy_sensor::{SensorConfig, ViewpointConfig, ObjectRotation};
let config = SensorConfig {
viewpoints: ViewpointConfig::default(),
object_rotations: ObjectRotation::tbp_benchmark_rotations(),
..Default::default()
};§YCB Dataset
Download YCB models programmatically:
ⓘ
use bevy_sensor::ycb::{download_models, Subset};
// Download representative subset (3 objects)
download_models("/tmp/ycb", Subset::Representative).await?;Re-exports§
pub use ycbust;
Modules§
Structs§
- Camera
Intrinsics - Camera intrinsic parameters for 3D reconstruction.
- Capture
Camera - Marker component for the capture camera
- Capture
Target - Marker component for the target object being captured
- Download
Options - Options for downloading YCB objects.
- Lighting
Config - Lighting configuration for rendering.
- Object
Rotation - Object rotation in Euler angles (degrees), matching TBP benchmark format. Format: [pitch, yaw, roll] or [x, y, z] rotation.
- Quat
- A quaternion representing an orientation.
- Render
Config - Configuration for headless rendering.
- Render
Output - Output from headless rendering containing RGBA and depth data.
- Sensor
Config - Full sensor configuration for capture sessions
- Transform
- Describe the position of an entity. If the entity has a parent, the position is relative to its parent position.
- Vec3
- A 3-dimensional vector.
- Viewpoint
Config - Configuration for viewpoint generation matching TBP habitat sensor behavior. Uses spherical coordinates to capture objects from multiple elevations.
Enums§
- Render
Error - Errors that can occur during rendering.
- YcbSubset
- Subset of objects to download.
Constants§
- REPRESENTATIVE_
OBJECTS - Representative subset of 3 commonly used objects.
- TEN_
OBJECTS - Subset of 10 commonly used objects.
Functions§
- generate_
viewpoints - Generate camera viewpoints using spherical coordinates.
- render_
all_ viewpoints - Render all viewpoints and rotations for a YCB object.
- render_
to_ buffer - Render a YCB object to an in-memory buffer.
- render_
to_ files - Render directly to files (for subprocess mode).