Expand description
Parameter server for nros
This crate provides a ROS 2 compatible parameter server for embedded systems. Parameters are stored in static memory with compile-time configurable capacity.
§Example
use nros_params::{ParameterDescriptor, ParameterServer, ParameterType, ParameterValue};
let mut server = ParameterServer::new();
// Declare a simple parameter
server.declare("max_speed", ParameterValue::Double(1.0));
// Declare a parameter with constraints
let desc = ParameterDescriptor::new("velocity", ParameterType::Double)
.unwrap()
.with_description("Maximum velocity in m/s")
.with_float_range(0.0, 10.0, 0.1);
server.declare_with_descriptor("velocity", ParameterValue::Double(5.0), Some(desc));
// Get and set parameters
assert_eq!(server.get_double("max_speed"), Some(1.0));
server.set_double("max_speed", 2.0);§Features
std- Enable standard library supportalloc- Enable heap allocation
Re-exports§
pub use persist::FileParamStore;pub use persist::NullParamStore;pub use persist::ParamStore;pub use persist::ParamStoreError;pub use server::LegacyParameterBuilder;pub use server::ParameterServer;pub use typed::MandatoryParameter;pub use typed::OptionalParameter;pub use typed::ParameterBuilder;pub use typed::ParameterError;pub use typed::RangeConvertible;pub use typed::ReadOnlyParameter;pub use typed::UndeclaredParameters;pub use types::FloatingPointRange;pub use types::IntegerRange;pub use types::MAX_ARRAY_LEN;pub use types::MAX_BYTE_ARRAY_LEN;pub use types::MAX_PARAM_NAME_LEN;pub use types::MAX_PARAMETERS;pub use types::MAX_STRING_VALUE_LEN;pub use types::Parameter;pub use types::ParameterDescriptor;pub use types::ParameterRange;pub use types::ParameterType;pub use types::ParameterValue;pub use types::ParameterVariant;pub use types::SetParameterResult;