improved default impls
This commit is contained in:
parent
f7fba64d76
commit
12f8337e3e
|
|
@ -10,31 +10,27 @@ use std::ffi::CString;
|
||||||
|
|
||||||
impl Default for rmw_message_info_t {
|
impl Default for rmw_message_info_t {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
rmw_message_info_t {
|
unsafe { rmw_get_zero_initialized_message_info() }
|
||||||
source_timestamp: 0,
|
|
||||||
received_timestamp: 0,
|
|
||||||
publisher_gid: rmw_gid_t {
|
|
||||||
implementation_identifier: std::ptr::null(),
|
|
||||||
data: [0; 24],
|
|
||||||
},
|
|
||||||
from_intra_process: false,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for rmw_qos_profile_t {
|
impl Default for rmw_qos_profile_t {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
rmw_qos_profile_t {
|
let mut profile: rmw_qos_profile_t = unsafe { std::mem::zeroed() };
|
||||||
history: rmw_qos_history_policy_t::RMW_QOS_POLICY_HISTORY_SYSTEM_DEFAULT,
|
profile.history =
|
||||||
depth: 10,
|
rmw_qos_history_policy_t::RMW_QOS_POLICY_HISTORY_SYSTEM_DEFAULT;
|
||||||
reliability: rmw_qos_reliability_policy_t::RMW_QOS_POLICY_RELIABILITY_SYSTEM_DEFAULT,
|
profile.depth = 10;
|
||||||
durability: rmw_qos_durability_policy_t::RMW_QOS_POLICY_DURABILITY_SYSTEM_DEFAULT,
|
profile.reliability =
|
||||||
avoid_ros_namespace_conventions: false,
|
rmw_qos_reliability_policy_t::RMW_QOS_POLICY_RELIABILITY_SYSTEM_DEFAULT;
|
||||||
deadline: rmw_time_t { sec: 0, nsec: 0 },
|
profile.durability =
|
||||||
lifespan: rmw_time_t { sec: 0, nsec: 0 },
|
rmw_qos_durability_policy_t::RMW_QOS_POLICY_DURABILITY_SYSTEM_DEFAULT;
|
||||||
liveliness: rmw_qos_liveliness_policy_t::RMW_QOS_POLICY_LIVELINESS_SYSTEM_DEFAULT,
|
profile.avoid_ros_namespace_conventions = false;
|
||||||
liveliness_lease_duration: rmw_time_t { sec: 0, nsec: 0 },
|
profile.deadline = rmw_time_t { sec: 0, nsec: 0 };
|
||||||
}
|
profile.lifespan = rmw_time_t { sec: 0, nsec: 0 };
|
||||||
|
profile.liveliness =
|
||||||
|
rmw_qos_liveliness_policy_t::RMW_QOS_POLICY_LIVELINESS_SYSTEM_DEFAULT;
|
||||||
|
profile.liveliness_lease_duration = rmw_time_t { sec: 0, nsec: 0 };
|
||||||
|
profile
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue