#[repr(C)]pub struct Range {
pub header: Header,
pub radiation_type: RadiationType,
pub field_of_view: f32,
pub min_range: f32,
pub max_range: f32,
pub range: f32,
}
Expand description
Single range reading from an active ranger that emits energy and reports one range reading that is valid along an arc at the distance measured. This message is not appropriate for laser scanners. See the LaserScan message if you are working with a laser scanner.
This message also can represent a fixed-distance (binary) ranger. This sensor will have min_range===max_range===distance of detection. These sensors follow REP 117 and will output -Inf if the object is detected and +Inf if the object is outside of the detection range.
Fields§
§header: Header
§radiation_type: RadiationType
§field_of_view: f32
the size of the arc that the distance reading is valid for [rad] the object causing the range reading may have been anywhere within -field_of_view/2 and field_of_view/2 at the measured range. 0 angle corresponds to the x-axis of the sensor.
min_range: f32
minimum range value [m]
max_range: f32
maximum range value [m]
range: f32
range data [m] (Note: values < range_min or > range_max should be discarded) Fixed distance rangers only output -Inf or +Inf. -Inf represents a detection within fixed distance. (Detection too close to the sensor to quantify) +Inf represents no detection within the fixed distance. (Object out of range)
Implementations§
Source§impl Range
impl Range
Sourcepub fn create_topic_with_name(
participant: &DdsParticipant,
name: &str,
maybe_qos: Option<DdsQos>,
maybe_listener: Option<DdsListener>,
) -> Result<DdsTopic<Self>, DDSError>
pub fn create_topic_with_name( participant: &DdsParticipant, name: &str, maybe_qos: Option<DdsQos>, maybe_listener: Option<DdsListener>, ) -> Result<DdsTopic<Self>, DDSError>
Create a topic using of this Type specifying the topic name
§Arguments
participant
- The participant handle onto which this topic should be createdname
- The name of the topicmaybe_qos
- A QoS structure for this topic. The Qos is optionalmaybe_listener
- A listener to use on this topic. The listener is optional
Sourcepub fn create_topic(
participant: &DdsParticipant,
maybe_topic_prefix: Option<&str>,
maybe_qos: Option<DdsQos>,
maybe_listener: Option<DdsListener>,
) -> Result<DdsTopic<Self>, DDSError>
pub fn create_topic( participant: &DdsParticipant, maybe_topic_prefix: Option<&str>, maybe_qos: Option<DdsQos>, maybe_listener: Option<DdsListener>, ) -> Result<DdsTopic<Self>, DDSError>
Create a topic of this Type using the default topic name. The default topic name is provided by the Self::topic_name function.
§Arguments
participant
- The participant handle onto which this topic should be createdmaybe_topic_prefix
- An additional prefix to be added to the topic name. This can be Nonemaybe_qos
- A QoS structure for this topic. The Qos is optionalmaybe_listener
- A listener to use on this topic. The listener is optional
Sourcepub fn create_sample_buffer(len: usize) -> SampleBuffer<Range>
pub fn create_sample_buffer(len: usize) -> SampleBuffer<Range>
Create a sample buffer for storing an array of samples You can pass the sample buffer into a read to read multiple samples. Multiple samples are useful when you have one or more keys in your topic structure. Each value of the key will result in the storage of another sample.