pub struct SimulationConfig {
pub model: String,
pub model_config: Option<String>,
pub environment: String,
pub environment_config: Option<String>,
pub headless: bool,
pub camera: CameraConfig,
pub networking: NetworkingConfig,
}Expand description
Runtime simulation configuration
Loaded from configs/simulation/config.json with environment sections. The config file format is:
{
"dev": { ... config ... },
"production": { ... config ... }
}This is distinct from ProjectSimulationConfig which is stored in mecha10.json.
Fields§
§model: StringRobot model identifier (e.g., “@mecha10/simulation-models/rover”)
model_config: Option<String>Path to model configuration file
environment: StringEnvironment identifier (e.g., “@mecha10/simulation-environments/basic_arena”)
environment_config: Option<String>Path to environment configuration file
headless: boolRun simulation in headless mode (no GUI)
camera: CameraConfigCamera configuration
networking: NetworkingConfigNetworking configuration
Implementations§
Source§impl SimulationConfig
impl SimulationConfig
Sourcepub fn load() -> Result<SimulationConfig, Error>
pub fn load() -> Result<SimulationConfig, Error>
Load simulation config with environment and scenario support
Priority (first found wins):
- configs/simulation/{scenario}.json (if scenario specified)
- configs/simulation/config.json (with dev/production sections)
- Error
Sourcepub fn load_with_profile_and_scenario(
profile: Option<&str>,
scenario: Option<&str>,
) -> Result<SimulationConfig, Error>
pub fn load_with_profile_and_scenario( profile: Option<&str>, scenario: Option<&str>, ) -> Result<SimulationConfig, Error>
Load simulation config with specific profile and/or scenario
Config files are now environment-aware with this format:
{
"dev": { ... config ... },
"production": { ... config ... }
}§Arguments
profile- Config profile (dev, production, etc.). If None, uses MECHA10_ENVIRONMENT or “dev”scenario- Scenario name (navigation, obstacle_avoidance, etc.). If None, uses MECHA10_SIMULATION_SCENARIO or loads config.json
Trait Implementations§
Source§impl Clone for SimulationConfig
impl Clone for SimulationConfig
Source§fn clone(&self) -> SimulationConfig
fn clone(&self) -> SimulationConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SimulationConfig
impl Debug for SimulationConfig
Source§impl<'de> Deserialize<'de> for SimulationConfig
impl<'de> Deserialize<'de> for SimulationConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SimulationConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SimulationConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for SimulationConfig
impl Serialize for SimulationConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for SimulationConfig
impl RefUnwindSafe for SimulationConfig
impl Send for SimulationConfig
impl Sync for SimulationConfig
impl Unpin for SimulationConfig
impl UnsafeUnpin for SimulationConfig
impl UnwindSafe for SimulationConfig
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more