pub struct ReachabilityMap {
pub origin: [f64; 3],
pub voxel_size: f64,
pub dims: [usize; 3],
pub counts: Vec<u32>,
}Expand description
A coarse voxel reachability map for a robot arm.
Populated by Monte-Carlo workspace sampling.
Fields§
§origin: [f64; 3]World-space origin of the voxel grid.
voxel_size: f64Size of each voxel in metres.
dims: [usize; 3]Number of voxels along each axis.
counts: Vec<u32>Flat array of occupancy counts.
Implementations§
Source§impl ReachabilityMap
impl ReachabilityMap
Sourcepub fn new(origin: [f64; 3], voxel_size: f64, dims: [usize; 3]) -> Self
pub fn new(origin: [f64; 3], voxel_size: f64, dims: [usize; 3]) -> Self
Creates an empty reachability map.
Sourcepub fn world_to_voxel(&self, p: [f64; 3]) -> Option<[usize; 3]>
pub fn world_to_voxel(&self, p: [f64; 3]) -> Option<[usize; 3]>
Converts a world position to a voxel index, returning None if outside.
Sourcepub fn add_point(&mut self, p: [f64; 3])
pub fn add_point(&mut self, p: [f64; 3])
Increments the occupancy count for the voxel at world position p.
Sourcepub fn populate(&mut self, arm: &RobotArm, n_samples: usize)
pub fn populate(&mut self, arm: &RobotArm, n_samples: usize)
Populates the map from a Monte-Carlo workspace sample.
Sourcepub fn reachable_count(&self) -> usize
pub fn reachable_count(&self) -> usize
Returns the total number of non-zero voxels (reachable cells).
Trait Implementations§
Source§impl Clone for ReachabilityMap
impl Clone for ReachabilityMap
Source§fn clone(&self) -> ReachabilityMap
fn clone(&self) -> ReachabilityMap
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ReachabilityMap
impl RefUnwindSafe for ReachabilityMap
impl Send for ReachabilityMap
impl Sync for ReachabilityMap
impl Unpin for ReachabilityMap
impl UnsafeUnpin for ReachabilityMap
impl UnwindSafe for ReachabilityMap
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.