pub const DEX_STEP_CONFIGURED: f64 = 0.0;
pub const DEX_STEP_DISABLED: f64 = -1.0;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dex_robot_t {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dex_diagnostic_t {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dex_component_t {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dex_motion_t {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dex_motion_group_t {
_unused: [u8; 0],
}
pub type dex_status_t = i32;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct dex_wait_policy_t {
pub struct_size: u32,
pub mode: u32,
pub timeout_ms: u64,
pub convergence_tolerance: f64,
pub settle_time_ms: u64,
pub max_state_age_ms: u64,
pub wait_ceiling_ms: u64,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of dex_wait_policy_t"][::std::mem::size_of::<dex_wait_policy_t>() - 48usize];
["Alignment of dex_wait_policy_t"][::std::mem::align_of::<dex_wait_policy_t>() - 8usize];
["Offset of field: dex_wait_policy_t::struct_size"]
[::std::mem::offset_of!(dex_wait_policy_t, struct_size) - 0usize];
["Offset of field: dex_wait_policy_t::mode"]
[::std::mem::offset_of!(dex_wait_policy_t, mode) - 4usize];
["Offset of field: dex_wait_policy_t::timeout_ms"]
[::std::mem::offset_of!(dex_wait_policy_t, timeout_ms) - 8usize];
["Offset of field: dex_wait_policy_t::convergence_tolerance"]
[::std::mem::offset_of!(dex_wait_policy_t, convergence_tolerance) - 16usize];
["Offset of field: dex_wait_policy_t::settle_time_ms"]
[::std::mem::offset_of!(dex_wait_policy_t, settle_time_ms) - 24usize];
["Offset of field: dex_wait_policy_t::max_state_age_ms"]
[::std::mem::offset_of!(dex_wait_policy_t, max_state_age_ms) - 32usize];
["Offset of field: dex_wait_policy_t::wait_ceiling_ms"]
[::std::mem::offset_of!(dex_wait_policy_t, wait_ceiling_ms) - 40usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dex_error_t {
pub struct_size: u32,
pub code: i32,
pub message: [::std::os::raw::c_char; 256usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of dex_error_t"][::std::mem::size_of::<dex_error_t>() - 264usize];
["Alignment of dex_error_t"][::std::mem::align_of::<dex_error_t>() - 4usize];
["Offset of field: dex_error_t::struct_size"]
[::std::mem::offset_of!(dex_error_t, struct_size) - 0usize];
["Offset of field: dex_error_t::code"][::std::mem::offset_of!(dex_error_t, code) - 4usize];
["Offset of field: dex_error_t::message"]
[::std::mem::offset_of!(dex_error_t, message) - 8usize];
};
impl Default for dex_error_t {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dex_runtime_options_t {
pub struct_size: u32,
pub worker_threads: u32,
pub thread_name_utf8: *const ::std::os::raw::c_char,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of dex_runtime_options_t"][::std::mem::size_of::<dex_runtime_options_t>() - 16usize];
["Alignment of dex_runtime_options_t"]
[::std::mem::align_of::<dex_runtime_options_t>() - 8usize];
["Offset of field: dex_runtime_options_t::struct_size"]
[::std::mem::offset_of!(dex_runtime_options_t, struct_size) - 0usize];
["Offset of field: dex_runtime_options_t::worker_threads"]
[::std::mem::offset_of!(dex_runtime_options_t, worker_threads) - 4usize];
["Offset of field: dex_runtime_options_t::thread_name_utf8"]
[::std::mem::offset_of!(dex_runtime_options_t, thread_name_utf8) - 8usize];
};
impl Default for dex_runtime_options_t {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
unsafe extern "C" {
pub fn dex_abi_version() -> u32;
}
unsafe extern "C" {
pub fn dex_wait_policy_init(policy: *mut dex_wait_policy_t);
}
unsafe extern "C" {
pub fn dex_error_init(error: *mut dex_error_t);
}
unsafe extern "C" {
pub fn dex_runtime_options_init(options: *mut dex_runtime_options_t);
}
unsafe extern "C" {
pub fn dex_runtime_configure(
options: *const dex_runtime_options_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_watchdog_configure(
command_utf8: *const ::std::os::raw::c_char,
enabled: bool,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_safety_configure(
exit_on_termination_request: bool,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_diagnostic_create_from_profile(
profile_name_utf8: *const ::std::os::raw::c_char,
out_client: *mut *mut dex_diagnostic_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_diagnostic_create_from_file(
path_utf8: *const ::std::os::raw::c_char,
out_client: *mut *mut dex_diagnostic_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_diagnostic_snapshot_json(
client: *mut dex_diagnostic_t,
settle_timeout_ms: u64,
out_json: *mut *mut ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_diagnostic_shutdown(
client: *mut dex_diagnostic_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_diagnostic_release(client: *mut dex_diagnostic_t);
}
unsafe extern "C" {
pub fn dex_string_free(value: *mut ::std::os::raw::c_char);
}
unsafe extern "C" {
pub fn dex_robot_create_from_profile(
profile_name_utf8: *const ::std::os::raw::c_char,
out_robot: *mut *mut dex_robot_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_create_from_file(
path_utf8: *const ::std::os::raw::c_char,
out_robot: *mut *mut dex_robot_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_create_from_resolved_json(
json: *const u8,
json_len: usize,
out_robot: *mut *mut dex_robot_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_create_simulated_from_profile(
profile_name_utf8: *const ::std::os::raw::c_char,
out_robot: *mut *mut dex_robot_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_create_simulated_from_resolved_json(
json: *const u8,
json_len: usize,
out_robot: *mut *mut dex_robot_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_simulation_hold_motions(
robot: *mut dex_robot_t,
hold: bool,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_retain(robot: *mut dex_robot_t) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_release(robot: *mut dex_robot_t);
}
unsafe extern "C" {
pub fn dex_robot_close(robot: *mut dex_robot_t, error: *mut dex_error_t) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_shutdown(robot: *mut dex_robot_t, error: *mut dex_error_t) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_reconnect(robot: *mut dex_robot_t, error: *mut dex_error_t) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_chassis_set_velocity(
robot: *mut dex_robot_t,
vx: f64,
vy: f64,
wz: f64,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_chassis_stop(robot: *mut dex_robot_t, error: *mut dex_error_t)
-> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_pause_heartbeat(
robot: *mut dex_robot_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_resume_heartbeat(
robot: *mut dex_robot_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_joint_component(
robot: *mut dex_robot_t,
name_utf8: *const ::std::os::raw::c_char,
out_component: *mut *mut dex_component_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_component_release(component: *mut dex_component_t);
}
unsafe extern "C" {
pub fn dex_component_joint_count(
component: *const dex_component_t,
out_count: *mut usize,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_component_get_joint_pos(
component: *const dex_component_t,
values_out: *mut f64,
capacity: usize,
out_count: *mut usize,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_component_grasp_torque(
component: *mut dex_component_t,
torque_out: *mut f64,
has_torque_out: *mut ::std::os::raw::c_int,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_component_set_grasp_torque(
component: *mut dex_component_t,
torque: f64,
force: ::std::os::raw::c_int,
applied_out: *mut f64,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_component_set_joint_pos(
component: *mut dex_component_t,
values: *const f64,
count: usize,
wait: *const dex_wait_policy_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_component_set_joint_pos_vel(
component: *mut dex_component_t,
positions: *const f64,
velocities: *const f64,
count: usize,
wait: *const dex_wait_policy_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_component_move_to_joint_pos(
component: *mut dex_component_t,
values: *const f64,
count: usize,
wait: *const dex_wait_policy_t,
out_motion: *mut *mut dex_motion_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dex_context_t {
_unused: [u8; 0],
}
unsafe extern "C" {
pub fn dex_context_create(
workers: usize,
out_context: *mut *mut dex_context_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_context_release(context: *mut dex_context_t);
}
unsafe extern "C" {
pub fn dex_context_connect_profile(
context: *const dex_context_t,
profile: *const ::std::os::raw::c_char,
simulation: bool,
watchdog: bool,
exit_on_termination: bool,
out_robot: *mut *mut dex_robot_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_start_joint_motions(
robot: *mut dex_robot_t,
names: *const *const ::std::os::raw::c_char,
values: *const *const f64,
counts: *const usize,
n: usize,
out_group: *mut *mut dex_motion_group_t,
out_report: *mut *mut ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_component_command_position(
component: *const dex_component_t,
values: *const f64,
limits: *const f64,
count: usize,
max_state_age_ms: u64,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_initialize_arms_json(
robot: *mut dex_robot_t,
out: *mut *mut ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_initialize_components_json(
robot: *mut dex_robot_t,
out: *mut *mut ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_joint_state_json(
robot: *mut dex_robot_t,
name: *const ::std::os::raw::c_char,
out: *mut *mut ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_build_info_json(
out_json: *mut *mut ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_motion_wait_success(
motion: *mut dex_motion_t,
wait: *const dex_wait_policy_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_motion_wait(
motion: *mut dex_motion_t,
wait: *const dex_wait_policy_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_motion_cancel(motion: *mut dex_motion_t, error: *mut dex_error_t) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_motion_id(motion: *const dex_motion_t, out_id: *mut u64) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_motion_state(motion: *const dex_motion_t, out_state: *mut u32) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_motion_release(motion: *mut dex_motion_t);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dex_frame_t {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dex_rate_limiter_t {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dex_buffer_t {
pub data: *mut u8,
pub len: usize,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of dex_buffer_t"][::std::mem::size_of::<dex_buffer_t>() - 16usize];
["Alignment of dex_buffer_t"][::std::mem::align_of::<dex_buffer_t>() - 8usize];
["Offset of field: dex_buffer_t::data"][::std::mem::offset_of!(dex_buffer_t, data) - 0usize];
["Offset of field: dex_buffer_t::len"][::std::mem::offset_of!(dex_buffer_t, len) - 8usize];
};
impl Default for dex_buffer_t {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
unsafe extern "C" {
pub fn dex_buffer_free(buffer: *mut dex_buffer_t);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dex_robot_options_t {
pub struct_size: u32,
pub profile_utf8: *const ::std::os::raw::c_char,
pub config_file_utf8: *const ::std::os::raw::c_char,
pub enable_sensors: *const *const ::std::os::raw::c_char,
pub enable_sensor_count: usize,
pub simulated: u8,
pub require_version_check: u8,
pub disable_watchdog: u8,
pub exit_on_termination: u8,
pub watchdog_command_utf8: *const ::std::os::raw::c_char,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of dex_robot_options_t"][::std::mem::size_of::<dex_robot_options_t>() - 56usize];
["Alignment of dex_robot_options_t"][::std::mem::align_of::<dex_robot_options_t>() - 8usize];
["Offset of field: dex_robot_options_t::struct_size"]
[::std::mem::offset_of!(dex_robot_options_t, struct_size) - 0usize];
["Offset of field: dex_robot_options_t::profile_utf8"]
[::std::mem::offset_of!(dex_robot_options_t, profile_utf8) - 8usize];
["Offset of field: dex_robot_options_t::config_file_utf8"]
[::std::mem::offset_of!(dex_robot_options_t, config_file_utf8) - 16usize];
["Offset of field: dex_robot_options_t::enable_sensors"]
[::std::mem::offset_of!(dex_robot_options_t, enable_sensors) - 24usize];
["Offset of field: dex_robot_options_t::enable_sensor_count"]
[::std::mem::offset_of!(dex_robot_options_t, enable_sensor_count) - 32usize];
["Offset of field: dex_robot_options_t::simulated"]
[::std::mem::offset_of!(dex_robot_options_t, simulated) - 40usize];
["Offset of field: dex_robot_options_t::require_version_check"]
[::std::mem::offset_of!(dex_robot_options_t, require_version_check) - 41usize];
["Offset of field: dex_robot_options_t::disable_watchdog"]
[::std::mem::offset_of!(dex_robot_options_t, disable_watchdog) - 42usize];
["Offset of field: dex_robot_options_t::exit_on_termination"]
[::std::mem::offset_of!(dex_robot_options_t, exit_on_termination) - 43usize];
["Offset of field: dex_robot_options_t::watchdog_command_utf8"]
[::std::mem::offset_of!(dex_robot_options_t, watchdog_command_utf8) - 48usize];
};
impl Default for dex_robot_options_t {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
unsafe extern "C" {
pub fn dex_robot_options_init(options: *mut dex_robot_options_t) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_create(
options: *const dex_robot_options_t,
out_robot: *mut *mut dex_robot_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_context_connect(
context: *const dex_context_t,
options: *const dex_robot_options_t,
out_robot: *mut *mut dex_robot_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_diagnostic_create(
options: *const dex_robot_options_t,
out_client: *mut *mut dex_diagnostic_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_resolved_config_json(
options: *const dex_robot_options_t,
out_json: *mut *mut ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_profile_from_environment(
out_name: *mut *mut ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_config_json(
robot: *mut dex_robot_t,
out_json: *mut *mut ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_health_json(
robot: *mut dex_robot_t,
out_json: *mut *mut ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_version_info_json(
robot: *mut dex_robot_t,
out_json: *mut *mut ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_connection_report_json(
robot: *mut dex_robot_t,
out_json: *mut *mut ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_profile_name(
robot: *mut dex_robot_t,
out_name: *mut *mut ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_model_name(
robot: *mut dex_robot_t,
out_name: *mut *mut ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_is_active(robot: *const dex_robot_t, out_active: *mut bool) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_wait_for_active(
robot: *mut dex_robot_t,
timeout_ms: u64,
out_active: *mut bool,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_has_component(
robot: *mut dex_robot_t,
name_utf8: *const ::std::os::raw::c_char,
out_present: *mut bool,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_has_sensor(
robot: *mut dex_robot_t,
name_utf8: *const ::std::os::raw::c_char,
out_present: *mut bool,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_component_count(
robot: *const dex_robot_t,
out_count: *mut usize,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_component_name(
robot: *mut dex_robot_t,
index: usize,
out_name: *mut *mut ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_sensor_count(robot: *const dex_robot_t, out_count: *mut usize)
-> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_sensor_name(
robot: *mut dex_robot_t,
index: usize,
out_name: *mut *mut ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_wait_for_state(
robot: *mut dex_robot_t,
name_utf8: *const ::std::os::raw::c_char,
timeout_ms: u64,
out_ready: *mut bool,
error: *mut dex_error_t,
) -> dex_status_t;
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct dex_motion_options_t {
pub struct_size: u32,
pub relative: u8,
pub disable_limit_enforcement: u8,
pub velocity_scale: f64,
pub max_state_age_ms: u64,
pub wait_ceiling_ms: u64,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of dex_motion_options_t"][::std::mem::size_of::<dex_motion_options_t>() - 32usize];
["Alignment of dex_motion_options_t"][::std::mem::align_of::<dex_motion_options_t>() - 8usize];
["Offset of field: dex_motion_options_t::struct_size"]
[::std::mem::offset_of!(dex_motion_options_t, struct_size) - 0usize];
["Offset of field: dex_motion_options_t::relative"]
[::std::mem::offset_of!(dex_motion_options_t, relative) - 4usize];
["Offset of field: dex_motion_options_t::disable_limit_enforcement"]
[::std::mem::offset_of!(dex_motion_options_t, disable_limit_enforcement) - 5usize];
["Offset of field: dex_motion_options_t::velocity_scale"]
[::std::mem::offset_of!(dex_motion_options_t, velocity_scale) - 8usize];
["Offset of field: dex_motion_options_t::max_state_age_ms"]
[::std::mem::offset_of!(dex_motion_options_t, max_state_age_ms) - 16usize];
["Offset of field: dex_motion_options_t::wait_ceiling_ms"]
[::std::mem::offset_of!(dex_motion_options_t, wait_ceiling_ms) - 24usize];
};
unsafe extern "C" {
pub fn dex_motion_options_init(options: *mut dex_motion_options_t);
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct dex_command_options_t {
pub struct_size: u32,
pub relative: u8,
pub disable_limit_enforcement: u8,
pub max_step_rad: f64,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of dex_command_options_t"][::std::mem::size_of::<dex_command_options_t>() - 16usize];
["Alignment of dex_command_options_t"]
[::std::mem::align_of::<dex_command_options_t>() - 8usize];
["Offset of field: dex_command_options_t::struct_size"]
[::std::mem::offset_of!(dex_command_options_t, struct_size) - 0usize];
["Offset of field: dex_command_options_t::relative"]
[::std::mem::offset_of!(dex_command_options_t, relative) - 4usize];
["Offset of field: dex_command_options_t::disable_limit_enforcement"]
[::std::mem::offset_of!(dex_command_options_t, disable_limit_enforcement) - 5usize];
["Offset of field: dex_command_options_t::max_step_rad"]
[::std::mem::offset_of!(dex_command_options_t, max_step_rad) - 8usize];
};
unsafe extern "C" {
pub fn dex_robot_set_joint_pos_multi(
robot: *mut dex_robot_t,
names: *const *const ::std::os::raw::c_char,
values: *const *const f64,
counts: *const usize,
n: usize,
options: *const dex_command_options_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_move_to_joint_pos_multi(
robot: *mut dex_robot_t,
names: *const *const ::std::os::raw::c_char,
values: *const *const f64,
counts: *const usize,
n: usize,
options: *const dex_motion_options_t,
out_group: *mut *mut dex_motion_group_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_start_joint_motions_opt(
robot: *mut dex_robot_t,
names: *const *const ::std::os::raw::c_char,
values: *const *const f64,
counts: *const usize,
n: usize,
options: *const dex_motion_options_t,
out_group: *mut *mut dex_motion_group_t,
out_report: *mut *mut ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_execute_trajectory(
robot: *mut dex_robot_t,
names: *const *const ::std::os::raw::c_char,
positions: *const *const f64,
velocities: *const *const f64,
ticks: usize,
joint_counts: *const usize,
n: usize,
control_hz: f64,
max_tracking_error: f64,
error: *mut dex_error_t,
) -> dex_status_t;
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct dex_trajectory_options_t {
pub struct_size: u32,
pub max_tracking_error: f64,
pub max_state_age_ms: u64,
pub max_step_rad: f64,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of dex_trajectory_options_t"]
[::std::mem::size_of::<dex_trajectory_options_t>() - 32usize];
["Alignment of dex_trajectory_options_t"]
[::std::mem::align_of::<dex_trajectory_options_t>() - 8usize];
["Offset of field: dex_trajectory_options_t::struct_size"]
[::std::mem::offset_of!(dex_trajectory_options_t, struct_size) - 0usize];
["Offset of field: dex_trajectory_options_t::max_tracking_error"]
[::std::mem::offset_of!(dex_trajectory_options_t, max_tracking_error) - 8usize];
["Offset of field: dex_trajectory_options_t::max_state_age_ms"]
[::std::mem::offset_of!(dex_trajectory_options_t, max_state_age_ms) - 16usize];
["Offset of field: dex_trajectory_options_t::max_step_rad"]
[::std::mem::offset_of!(dex_trajectory_options_t, max_step_rad) - 24usize];
};
unsafe extern "C" {
pub fn dex_trajectory_options_init(options: *mut dex_trajectory_options_t);
}
unsafe extern "C" {
pub fn dex_robot_execute_trajectory_opt(
robot: *mut dex_robot_t,
names: *const *const ::std::os::raw::c_char,
positions: *const *const f64,
velocities: *const *const f64,
ticks: usize,
joint_counts: *const usize,
n: usize,
control_hz: f64,
options: *const dex_trajectory_options_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_stop_all(robot: *mut dex_robot_t, error: *mut dex_error_t) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_compensate_torso_pitch(
robot: *mut dex_robot_t,
values: *const f64,
count: usize,
part_utf8: *const ::std::os::raw::c_char,
out_values: *mut f64,
capacity: usize,
out_count: *mut usize,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_torso_pitch(
robot: *mut dex_robot_t,
out_pitch: *mut f64,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_clear_error(
robot: *mut dex_robot_t,
name_utf8: *const ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_clear_all_errors_json(
robot: *mut dex_robot_t,
out_json: *mut *mut ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_reboot(
robot: *mut dex_robot_t,
board_utf8: *const ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_query(
robot: *mut dex_robot_t,
name_utf8: *const ::std::os::raw::c_char,
payload: *const u8,
payload_len: usize,
out_reply: *mut dex_buffer_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_query_ntp_json(
robot: *mut dex_robot_t,
sample_count: usize,
out_json: *mut *mut ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_component_status_json(
robot: *mut dex_robot_t,
out_json: *mut *mut ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_take_safety_events_json(
robot: *mut dex_robot_t,
out_json: *mut *mut ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_wait_safety_event_json(
robot: *mut dex_robot_t,
timeout_ms: u64,
out_json: *mut *mut ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_available_profiles_json(
out_json: *mut *mut ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_profile_for_robot_name(
robot_name_utf8: *const ::std::os::raw::c_char,
out_name: *mut *mut ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_diagnostic_query_ntp_json(
client: *mut dex_diagnostic_t,
sample_count: usize,
out_json: *mut *mut ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct dex_estop_status_t {
pub struct_size: u32,
pub engaged: bool,
pub software_estop_enabled: bool,
pub state_observed: bool,
pub observed_age_ms: u64,
pub left_base_estop_enabled: bool,
pub right_base_estop_enabled: bool,
pub torso_estop_enabled: bool,
pub remote_estop_enabled: bool,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of dex_estop_status_t"][::std::mem::size_of::<dex_estop_status_t>() - 24usize];
["Alignment of dex_estop_status_t"][::std::mem::align_of::<dex_estop_status_t>() - 8usize];
["Offset of field: dex_estop_status_t::struct_size"]
[::std::mem::offset_of!(dex_estop_status_t, struct_size) - 0usize];
["Offset of field: dex_estop_status_t::engaged"]
[::std::mem::offset_of!(dex_estop_status_t, engaged) - 4usize];
["Offset of field: dex_estop_status_t::software_estop_enabled"]
[::std::mem::offset_of!(dex_estop_status_t, software_estop_enabled) - 5usize];
["Offset of field: dex_estop_status_t::state_observed"]
[::std::mem::offset_of!(dex_estop_status_t, state_observed) - 6usize];
["Offset of field: dex_estop_status_t::observed_age_ms"]
[::std::mem::offset_of!(dex_estop_status_t, observed_age_ms) - 8usize];
["Offset of field: dex_estop_status_t::left_base_estop_enabled"]
[::std::mem::offset_of!(dex_estop_status_t, left_base_estop_enabled) - 16usize];
["Offset of field: dex_estop_status_t::right_base_estop_enabled"]
[::std::mem::offset_of!(dex_estop_status_t, right_base_estop_enabled) - 17usize];
["Offset of field: dex_estop_status_t::torso_estop_enabled"]
[::std::mem::offset_of!(dex_estop_status_t, torso_estop_enabled) - 18usize];
["Offset of field: dex_estop_status_t::remote_estop_enabled"]
[::std::mem::offset_of!(dex_estop_status_t, remote_estop_enabled) - 19usize];
};
unsafe extern "C" {
pub fn dex_robot_estop_status(
robot: *mut dex_robot_t,
out: *mut dex_estop_status_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_estop_set(
robot: *mut dex_robot_t,
enabled: bool,
error: *mut dex_error_t,
) -> dex_status_t;
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct dex_battery_t {
pub struct_size: u32,
pub voltage: f64,
pub current: f64,
pub temperature: f64,
pub percentage: u32,
pub is_charging: bool,
pub timestamp_ns: u64,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of dex_battery_t"][::std::mem::size_of::<dex_battery_t>() - 48usize];
["Alignment of dex_battery_t"][::std::mem::align_of::<dex_battery_t>() - 8usize];
["Offset of field: dex_battery_t::struct_size"]
[::std::mem::offset_of!(dex_battery_t, struct_size) - 0usize];
["Offset of field: dex_battery_t::voltage"]
[::std::mem::offset_of!(dex_battery_t, voltage) - 8usize];
["Offset of field: dex_battery_t::current"]
[::std::mem::offset_of!(dex_battery_t, current) - 16usize];
["Offset of field: dex_battery_t::temperature"]
[::std::mem::offset_of!(dex_battery_t, temperature) - 24usize];
["Offset of field: dex_battery_t::percentage"]
[::std::mem::offset_of!(dex_battery_t, percentage) - 32usize];
["Offset of field: dex_battery_t::is_charging"]
[::std::mem::offset_of!(dex_battery_t, is_charging) - 36usize];
["Offset of field: dex_battery_t::timestamp_ns"]
[::std::mem::offset_of!(dex_battery_t, timestamp_ns) - 40usize];
};
unsafe extern "C" {
pub fn dex_robot_battery(
robot: *mut dex_robot_t,
out: *mut dex_battery_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_battery_ex(
robot: *mut dex_robot_t,
max_age_ms: u64,
out: *mut dex_battery_t,
out_age_ms: *mut u64,
error: *mut dex_error_t,
) -> dex_status_t;
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct dex_chassis_state_t {
pub struct_size: u32,
pub steering: [f64; 2usize],
pub wheel_velocity: [f64; 2usize],
pub wheel_position: [f64; 2usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of dex_chassis_state_t"][::std::mem::size_of::<dex_chassis_state_t>() - 56usize];
["Alignment of dex_chassis_state_t"][::std::mem::align_of::<dex_chassis_state_t>() - 8usize];
["Offset of field: dex_chassis_state_t::struct_size"]
[::std::mem::offset_of!(dex_chassis_state_t, struct_size) - 0usize];
["Offset of field: dex_chassis_state_t::steering"]
[::std::mem::offset_of!(dex_chassis_state_t, steering) - 8usize];
["Offset of field: dex_chassis_state_t::wheel_velocity"]
[::std::mem::offset_of!(dex_chassis_state_t, wheel_velocity) - 24usize];
["Offset of field: dex_chassis_state_t::wheel_position"]
[::std::mem::offset_of!(dex_chassis_state_t, wheel_position) - 40usize];
};
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct dex_chassis_options_t {
pub struct_size: u32,
pub disable_sequential_steering: u8,
pub steering_tolerance: f64,
pub steering_wait_ms: u64,
pub max_state_age_ms: u64,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of dex_chassis_options_t"][::std::mem::size_of::<dex_chassis_options_t>() - 32usize];
["Alignment of dex_chassis_options_t"]
[::std::mem::align_of::<dex_chassis_options_t>() - 8usize];
["Offset of field: dex_chassis_options_t::struct_size"]
[::std::mem::offset_of!(dex_chassis_options_t, struct_size) - 0usize];
["Offset of field: dex_chassis_options_t::disable_sequential_steering"]
[::std::mem::offset_of!(dex_chassis_options_t, disable_sequential_steering) - 4usize];
["Offset of field: dex_chassis_options_t::steering_tolerance"]
[::std::mem::offset_of!(dex_chassis_options_t, steering_tolerance) - 8usize];
["Offset of field: dex_chassis_options_t::steering_wait_ms"]
[::std::mem::offset_of!(dex_chassis_options_t, steering_wait_ms) - 16usize];
["Offset of field: dex_chassis_options_t::max_state_age_ms"]
[::std::mem::offset_of!(dex_chassis_options_t, max_state_age_ms) - 24usize];
};
unsafe extern "C" {
pub fn dex_chassis_options_init(options: *mut dex_chassis_options_t);
}
unsafe extern "C" {
pub fn dex_robot_chassis_state(
robot: *mut dex_robot_t,
out: *mut dex_chassis_state_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_chassis_set_motion_state(
robot: *mut dex_robot_t,
steering: *const f64,
wheel_velocity: *const f64,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_chassis_values(
robot: *mut dex_robot_t,
kind: u32,
out: *mut f64,
capacity: usize,
count: *mut usize,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_chassis_set_motion_state_n(
robot: *mut dex_robot_t,
steering: *const f64,
steering_count: usize,
wheels: *const f64,
wheel_count: usize,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_chassis_drive_for(
robot: *mut dex_robot_t,
vx: f64,
vy: f64,
wz: f64,
duration_ms: u64,
control_hz: f64,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_chassis_set_velocity_opt(
robot: *mut dex_robot_t,
vx: f64,
vy: f64,
wz: f64,
options: *const dex_chassis_options_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_chassis_set_velocity_named(
robot: *mut dex_robot_t,
name_utf8: *const ::std::os::raw::c_char,
vx: f64,
vy: f64,
wz: f64,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_chassis_stop_named(
robot: *mut dex_robot_t,
name_utf8: *const ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_chassis_values_named(
robot: *mut dex_robot_t,
name_utf8: *const ::std::os::raw::c_char,
kind: u32,
out: *mut f64,
capacity: usize,
count: *mut usize,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_chassis_set_motion_state_n_named(
robot: *mut dex_robot_t,
name_utf8: *const ::std::os::raw::c_char,
steering: *const f64,
steering_count: usize,
wheels: *const f64,
wheel_count: usize,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_chassis_drive_for_named(
robot: *mut dex_robot_t,
name_utf8: *const ::std::os::raw::c_char,
vx: f64,
vy: f64,
wz: f64,
duration_ms: u64,
control_hz: f64,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_chassis_set_velocity_opt_named(
robot: *mut dex_robot_t,
name_utf8: *const ::std::os::raw::c_char,
vx: f64,
vy: f64,
wz: f64,
options: *const dex_chassis_options_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_component_name(
component: *const dex_component_t,
out_name: *mut *mut ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_component_joint_name(
component: *const dex_component_t,
index: usize,
out_name: *mut *mut ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_component_joint_limits(
component: *const dex_component_t,
lower: *mut f64,
upper: *mut f64,
velocity: *mut f64,
capacity: usize,
out_count: *mut usize,
out_has_limits: *mut bool,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_component_pose_count(
component: *const dex_component_t,
out_count: *mut usize,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_component_pose_name(
component: *const dex_component_t,
index: usize,
out_name: *mut *mut ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_component_predefined_pose(
component: *const dex_component_t,
name_utf8: *const ::std::os::raw::c_char,
out_values: *mut f64,
capacity: usize,
out_count: *mut usize,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_component_resolve_pose(
component: *const dex_component_t,
name_utf8: *const ::std::os::raw::c_char,
out_values: *mut f64,
capacity: usize,
out_count: *mut usize,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_component_get_pose(
component: *const dex_component_t,
name_utf8: *const ::std::os::raw::c_char,
passthrough: bool,
out_values: *mut f64,
capacity: usize,
out_count: *mut usize,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_component_get_joint_state(
component: *const dex_component_t,
position: *mut f64,
velocity: *mut f64,
torque: *mut f64,
current: *mut f64,
capacity: usize,
out_count: *mut usize,
out_timestamp_ns: *mut u64,
error: *mut dex_error_t,
) -> dex_status_t;
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct dex_joint_state_counts_t {
pub struct_size: u32,
pub position: usize,
pub velocity: usize,
pub torque: usize,
pub current: usize,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of dex_joint_state_counts_t"]
[::std::mem::size_of::<dex_joint_state_counts_t>() - 40usize];
["Alignment of dex_joint_state_counts_t"]
[::std::mem::align_of::<dex_joint_state_counts_t>() - 8usize];
["Offset of field: dex_joint_state_counts_t::struct_size"]
[::std::mem::offset_of!(dex_joint_state_counts_t, struct_size) - 0usize];
["Offset of field: dex_joint_state_counts_t::position"]
[::std::mem::offset_of!(dex_joint_state_counts_t, position) - 8usize];
["Offset of field: dex_joint_state_counts_t::velocity"]
[::std::mem::offset_of!(dex_joint_state_counts_t, velocity) - 16usize];
["Offset of field: dex_joint_state_counts_t::torque"]
[::std::mem::offset_of!(dex_joint_state_counts_t, torque) - 24usize];
["Offset of field: dex_joint_state_counts_t::current"]
[::std::mem::offset_of!(dex_joint_state_counts_t, current) - 32usize];
};
unsafe extern "C" {
pub fn dex_component_get_joint_state_ex(
component: *const dex_component_t,
max_state_age_ms: u64,
position: *mut f64,
velocity: *mut f64,
torque: *mut f64,
current: *mut f64,
capacity: usize,
counts: *mut dex_joint_state_counts_t,
out_timestamp_ns: *mut u64,
out_age_ms: *mut u64,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_component_get_joint_err(
component: *const dex_component_t,
out_codes: *mut u32,
capacity: usize,
out_count: *mut usize,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_component_is_joint_pos_reached(
component: *const dex_component_t,
target: *const f64,
count: usize,
tolerance: f64,
out_reached: *mut bool,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_command_options_init(options: *mut dex_command_options_t);
}
unsafe extern "C" {
pub fn dex_component_set_joint_pos_opt(
component: *const dex_component_t,
values: *const f64,
velocities: *const f64,
count: usize,
options: *const dex_command_options_t,
wait: *const dex_wait_policy_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_component_move_to_joint_pos_opt(
component: *const dex_component_t,
values: *const f64,
count: usize,
options: *const dex_motion_options_t,
wait: *const dex_wait_policy_t,
out_motion: *mut *mut dex_motion_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_component_go_to_pose(
component: *const dex_component_t,
pose_utf8: *const ::std::os::raw::c_char,
options: *const dex_motion_options_t,
wait: *const dex_wait_policy_t,
out_motion: *mut *mut dex_motion_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_component_go_to_pose_opt(
component: *const dex_component_t,
pose_utf8: *const ::std::os::raw::c_char,
options: *const dex_motion_options_t,
wait: *const dex_wait_policy_t,
passthrough: bool,
out_motion: *mut *mut dex_motion_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_component_move_joint_trajectory(
component: *const dex_component_t,
positions: *const f64,
times_s: *const f64,
point_count: usize,
joint_count: usize,
velocity_scale: f64,
wait: *const dex_wait_policy_t,
out_motion: *mut *mut dex_motion_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_component_move_joint_trajectory_opt(
component: *const dex_component_t,
positions: *const f64,
times_s: *const f64,
point_count: usize,
joint_count: usize,
options: *const dex_motion_options_t,
wait: *const dex_wait_policy_t,
out_motion: *mut *mut dex_motion_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_component_stop(
component: *const dex_component_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_component_set_modes(
component: *const dex_component_t,
codes: *const i32,
count: usize,
out_json: *mut *mut ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_component_get_modes(
component: *const dex_component_t,
out_codes: *mut i32,
capacity: usize,
out_count: *mut usize,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_component_request_json(
component: *const dex_component_t,
role_utf8: *const ::std::os::raw::c_char,
request_json_utf8: *const ::std::os::raw::c_char,
out_json: *mut *mut ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_component_set_pid(
component: *const dex_component_t,
p: *const f64,
count: usize,
out_json: *mut *mut ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_component_get_pid(
component: *const dex_component_t,
out_json: *mut *mut ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_component_release_brake(
component: *const dex_component_t,
enable: bool,
joints: *const usize,
joint_count: usize,
out_json: *mut *mut ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_component_release_all_brakes(
component: *const dex_component_t,
enable: bool,
out_json: *mut *mut ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_component_brake_status(
component: *const dex_component_t,
out_json: *mut *mut ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_component_set_force_torque_sensor(
component: *const dex_component_t,
enable: bool,
out_json: *mut *mut ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_component_force_torque_sensor_mode(
component: *const dex_component_t,
out_json: *mut *mut ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_component_set_ee_baud_rate(
component: *const dex_component_t,
baud_rate: u32,
out_json: *mut *mut ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_component_ee_baud_rate(
component: *const dex_component_t,
out_json: *mut *mut ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_component_set_idle_mode(
component: *const dex_component_t,
enabled: bool,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_component_idle_mode(
component: *const dex_component_t,
out_enabled: *mut i32,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_component_ee_pass_through_enabled(
component: *const dex_component_t,
out_enabled: *mut bool,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_component_ee_pass_through_send(
component: *const dex_component_t,
data: *const u8,
len: usize,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_component_ee_pass_through_latest(
component: *const dex_component_t,
out_response: *mut dex_buffer_t,
out_has_response: *mut bool,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_component_button_state(
component: *const dex_component_t,
out_blue: *mut bool,
out_green: *mut bool,
out_has_state: *mut bool,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_component_touch_forces(
component: *const dex_component_t,
out_forces: *mut f64,
capacity: usize,
out_count: *mut usize,
out_has_data: *mut bool,
error: *mut dex_error_t,
) -> dex_status_t;
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct dex_imu_t {
pub struct_size: u32,
pub acceleration: [f64; 3usize],
pub angular_velocity: [f64; 3usize],
pub orientation: [f64; 4usize],
pub magnetic_field: [f64; 3usize],
pub has_magnetic_field: bool,
pub timestamp_ns: u64,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of dex_imu_t"][::std::mem::size_of::<dex_imu_t>() - 128usize];
["Alignment of dex_imu_t"][::std::mem::align_of::<dex_imu_t>() - 8usize];
["Offset of field: dex_imu_t::struct_size"]
[::std::mem::offset_of!(dex_imu_t, struct_size) - 0usize];
["Offset of field: dex_imu_t::acceleration"]
[::std::mem::offset_of!(dex_imu_t, acceleration) - 8usize];
["Offset of field: dex_imu_t::angular_velocity"]
[::std::mem::offset_of!(dex_imu_t, angular_velocity) - 32usize];
["Offset of field: dex_imu_t::orientation"]
[::std::mem::offset_of!(dex_imu_t, orientation) - 56usize];
["Offset of field: dex_imu_t::magnetic_field"]
[::std::mem::offset_of!(dex_imu_t, magnetic_field) - 88usize];
["Offset of field: dex_imu_t::has_magnetic_field"]
[::std::mem::offset_of!(dex_imu_t, has_magnetic_field) - 112usize];
["Offset of field: dex_imu_t::timestamp_ns"]
[::std::mem::offset_of!(dex_imu_t, timestamp_ns) - 120usize];
};
unsafe extern "C" {
pub fn dex_robot_imu(
robot: *mut dex_robot_t,
name_utf8: *const ::std::os::raw::c_char,
out: *mut dex_imu_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_imu_ex(
robot: *mut dex_robot_t,
name_utf8: *const ::std::os::raw::c_char,
max_age_ms: u64,
out: *mut dex_imu_t,
out_age_ms: *mut u64,
error: *mut dex_error_t,
) -> dex_status_t;
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct dex_ultrasonic_t {
pub struct_size: u32,
pub front_left: f64,
pub front_right: f64,
pub back_left: f64,
pub back_right: f64,
pub timestamp_ns: u64,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of dex_ultrasonic_t"][::std::mem::size_of::<dex_ultrasonic_t>() - 48usize];
["Alignment of dex_ultrasonic_t"][::std::mem::align_of::<dex_ultrasonic_t>() - 8usize];
["Offset of field: dex_ultrasonic_t::struct_size"]
[::std::mem::offset_of!(dex_ultrasonic_t, struct_size) - 0usize];
["Offset of field: dex_ultrasonic_t::front_left"]
[::std::mem::offset_of!(dex_ultrasonic_t, front_left) - 8usize];
["Offset of field: dex_ultrasonic_t::front_right"]
[::std::mem::offset_of!(dex_ultrasonic_t, front_right) - 16usize];
["Offset of field: dex_ultrasonic_t::back_left"]
[::std::mem::offset_of!(dex_ultrasonic_t, back_left) - 24usize];
["Offset of field: dex_ultrasonic_t::back_right"]
[::std::mem::offset_of!(dex_ultrasonic_t, back_right) - 32usize];
["Offset of field: dex_ultrasonic_t::timestamp_ns"]
[::std::mem::offset_of!(dex_ultrasonic_t, timestamp_ns) - 40usize];
};
unsafe extern "C" {
pub fn dex_robot_ultrasonic(
robot: *mut dex_robot_t,
name_utf8: *const ::std::os::raw::c_char,
out: *mut dex_ultrasonic_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_ultrasonic_ex(
robot: *mut dex_robot_t,
name_utf8: *const ::std::os::raw::c_char,
max_age_ms: u64,
out: *mut dex_ultrasonic_t,
out_age_ms: *mut u64,
error: *mut dex_error_t,
) -> dex_status_t;
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct dex_lidar_2d_info_t {
pub struct_size: u32,
pub angle_min: f64,
pub angle_max: f64,
pub angle_increment: f64,
pub time_increment: f64,
pub scan_time: f64,
pub range_min: f64,
pub range_max: f64,
pub timestamp_ns: u64,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of dex_lidar_2d_info_t"][::std::mem::size_of::<dex_lidar_2d_info_t>() - 72usize];
["Alignment of dex_lidar_2d_info_t"][::std::mem::align_of::<dex_lidar_2d_info_t>() - 8usize];
["Offset of field: dex_lidar_2d_info_t::struct_size"]
[::std::mem::offset_of!(dex_lidar_2d_info_t, struct_size) - 0usize];
["Offset of field: dex_lidar_2d_info_t::angle_min"]
[::std::mem::offset_of!(dex_lidar_2d_info_t, angle_min) - 8usize];
["Offset of field: dex_lidar_2d_info_t::angle_max"]
[::std::mem::offset_of!(dex_lidar_2d_info_t, angle_max) - 16usize];
["Offset of field: dex_lidar_2d_info_t::angle_increment"]
[::std::mem::offset_of!(dex_lidar_2d_info_t, angle_increment) - 24usize];
["Offset of field: dex_lidar_2d_info_t::time_increment"]
[::std::mem::offset_of!(dex_lidar_2d_info_t, time_increment) - 32usize];
["Offset of field: dex_lidar_2d_info_t::scan_time"]
[::std::mem::offset_of!(dex_lidar_2d_info_t, scan_time) - 40usize];
["Offset of field: dex_lidar_2d_info_t::range_min"]
[::std::mem::offset_of!(dex_lidar_2d_info_t, range_min) - 48usize];
["Offset of field: dex_lidar_2d_info_t::range_max"]
[::std::mem::offset_of!(dex_lidar_2d_info_t, range_max) - 56usize];
["Offset of field: dex_lidar_2d_info_t::timestamp_ns"]
[::std::mem::offset_of!(dex_lidar_2d_info_t, timestamp_ns) - 64usize];
};
unsafe extern "C" {
pub fn dex_robot_lidar_2d(
robot: *mut dex_robot_t,
name_utf8: *const ::std::os::raw::c_char,
ranges: *mut f64,
angles: *mut f64,
intensities: *mut u32,
capacity: usize,
out_count: *mut usize,
info: *mut dex_lidar_2d_info_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct dex_lidar_3d_info_t {
pub struct_size: u32,
pub height: u32,
pub width: u32,
pub is_dense: bool,
pub point_count: u32,
pub timestamp_ns: u64,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of dex_lidar_3d_info_t"][::std::mem::size_of::<dex_lidar_3d_info_t>() - 32usize];
["Alignment of dex_lidar_3d_info_t"][::std::mem::align_of::<dex_lidar_3d_info_t>() - 8usize];
["Offset of field: dex_lidar_3d_info_t::struct_size"]
[::std::mem::offset_of!(dex_lidar_3d_info_t, struct_size) - 0usize];
["Offset of field: dex_lidar_3d_info_t::height"]
[::std::mem::offset_of!(dex_lidar_3d_info_t, height) - 4usize];
["Offset of field: dex_lidar_3d_info_t::width"]
[::std::mem::offset_of!(dex_lidar_3d_info_t, width) - 8usize];
["Offset of field: dex_lidar_3d_info_t::is_dense"]
[::std::mem::offset_of!(dex_lidar_3d_info_t, is_dense) - 12usize];
["Offset of field: dex_lidar_3d_info_t::point_count"]
[::std::mem::offset_of!(dex_lidar_3d_info_t, point_count) - 16usize];
["Offset of field: dex_lidar_3d_info_t::timestamp_ns"]
[::std::mem::offset_of!(dex_lidar_3d_info_t, timestamp_ns) - 24usize];
};
unsafe extern "C" {
pub fn dex_robot_lidar_3d(
robot: *mut dex_robot_t,
name_utf8: *const ::std::os::raw::c_char,
x: *mut f64,
y: *mut f64,
z: *mut f64,
intensity: *mut u32,
ring: *mut u32,
point_timestamps_ns: *mut u32,
capacity: usize,
out_count: *mut usize,
info: *mut dex_lidar_3d_info_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dex_lidar_2d_t {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dex_lidar_3d_t {
_unused: [u8; 0],
}
unsafe extern "C" {
pub fn dex_robot_lidar_2d_take(
robot: *mut dex_robot_t,
name_utf8: *const ::std::os::raw::c_char,
max_age_ms: u64,
out_scan: *mut *mut dex_lidar_2d_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_lidar_2d_info(
scan: *const dex_lidar_2d_t,
out: *mut dex_lidar_2d_info_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_lidar_2d_channel_f64(
scan: *const dex_lidar_2d_t,
channel: u32,
out_data: *mut *const f64,
out_count: *mut usize,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_lidar_2d_channel_u32(
scan: *const dex_lidar_2d_t,
channel: u32,
out_data: *mut *const u32,
out_count: *mut usize,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_lidar_2d_age_ms(scan: *const dex_lidar_2d_t, out_age_ms: *mut u64) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_lidar_2d_release(scan: *mut dex_lidar_2d_t);
}
unsafe extern "C" {
pub fn dex_robot_lidar_3d_take(
robot: *mut dex_robot_t,
name_utf8: *const ::std::os::raw::c_char,
max_age_ms: u64,
out_cloud: *mut *mut dex_lidar_3d_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_lidar_3d_info(
cloud: *const dex_lidar_3d_t,
out: *mut dex_lidar_3d_info_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_lidar_3d_channel_f64(
cloud: *const dex_lidar_3d_t,
channel: u32,
out_data: *mut *const f64,
out_count: *mut usize,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_lidar_3d_channel_u32(
cloud: *const dex_lidar_3d_t,
channel: u32,
out_data: *mut *const u32,
out_count: *mut usize,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_lidar_3d_age_ms(cloud: *const dex_lidar_3d_t, out_age_ms: *mut u64) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_lidar_3d_release(cloud: *mut dex_lidar_3d_t);
}
unsafe extern "C" {
pub fn dex_robot_wrench(
robot: *mut dex_robot_t,
component_utf8: *const ::std::os::raw::c_char,
out_wrench: *mut f64,
out_timestamp_ns: *mut u64,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_wrench_ex(
robot: *mut dex_robot_t,
component_utf8: *const ::std::os::raw::c_char,
max_age_ms: u64,
out_wrench: *mut f64,
out_timestamp_ns: *mut u64,
out_age_ms: *mut u64,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_temperature_json(
robot: *mut dex_robot_t,
component_utf8: *const ::std::os::raw::c_char,
out_json: *mut *mut ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_sensor_json(
robot: *mut dex_robot_t,
name_utf8: *const ::std::os::raw::c_char,
role_utf8: *const ::std::os::raw::c_char,
out_json: *mut *mut ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct dex_frame_info_t {
pub struct_size: u32,
pub width: u32,
pub height: u32,
pub encoding: u32,
pub timestamp_ns: u64,
pub data_len: usize,
pub depth_scale: f32,
pub depth_min_range: f32,
pub depth_max_range: f32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of dex_frame_info_t"][::std::mem::size_of::<dex_frame_info_t>() - 48usize];
["Alignment of dex_frame_info_t"][::std::mem::align_of::<dex_frame_info_t>() - 8usize];
["Offset of field: dex_frame_info_t::struct_size"]
[::std::mem::offset_of!(dex_frame_info_t, struct_size) - 0usize];
["Offset of field: dex_frame_info_t::width"]
[::std::mem::offset_of!(dex_frame_info_t, width) - 4usize];
["Offset of field: dex_frame_info_t::height"]
[::std::mem::offset_of!(dex_frame_info_t, height) - 8usize];
["Offset of field: dex_frame_info_t::encoding"]
[::std::mem::offset_of!(dex_frame_info_t, encoding) - 12usize];
["Offset of field: dex_frame_info_t::timestamp_ns"]
[::std::mem::offset_of!(dex_frame_info_t, timestamp_ns) - 16usize];
["Offset of field: dex_frame_info_t::data_len"]
[::std::mem::offset_of!(dex_frame_info_t, data_len) - 24usize];
["Offset of field: dex_frame_info_t::depth_scale"]
[::std::mem::offset_of!(dex_frame_info_t, depth_scale) - 32usize];
["Offset of field: dex_frame_info_t::depth_min_range"]
[::std::mem::offset_of!(dex_frame_info_t, depth_min_range) - 36usize];
["Offset of field: dex_frame_info_t::depth_max_range"]
[::std::mem::offset_of!(dex_frame_info_t, depth_max_range) - 40usize];
};
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct dex_stream_stats_t {
pub struct_size: u32,
pub frames_received: u64,
pub frames_replaced_unread: u64,
pub decode_errors: u64,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of dex_stream_stats_t"][::std::mem::size_of::<dex_stream_stats_t>() - 32usize];
["Alignment of dex_stream_stats_t"][::std::mem::align_of::<dex_stream_stats_t>() - 8usize];
["Offset of field: dex_stream_stats_t::struct_size"]
[::std::mem::offset_of!(dex_stream_stats_t, struct_size) - 0usize];
["Offset of field: dex_stream_stats_t::frames_received"]
[::std::mem::offset_of!(dex_stream_stats_t, frames_received) - 8usize];
["Offset of field: dex_stream_stats_t::frames_replaced_unread"]
[::std::mem::offset_of!(dex_stream_stats_t, frames_replaced_unread) - 16usize];
["Offset of field: dex_stream_stats_t::decode_errors"]
[::std::mem::offset_of!(dex_stream_stats_t, decode_errors) - 24usize];
};
unsafe extern "C" {
pub fn dex_robot_camera_stream_count(
robot: *mut dex_robot_t,
sensor_utf8: *const ::std::os::raw::c_char,
out_count: *mut usize,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_camera_stream_name(
robot: *mut dex_robot_t,
sensor_utf8: *const ::std::os::raw::c_char,
index: usize,
out_name: *mut *mut ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_camera_subscribe(
robot: *mut dex_robot_t,
sensor_utf8: *const ::std::os::raw::c_char,
stream_utf8: *const ::std::os::raw::c_char,
history: usize,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_camera_unsubscribe(
robot: *mut dex_robot_t,
sensor_utf8: *const ::std::os::raw::c_char,
stream_utf8: *const ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_camera_latest_frame(
robot: *mut dex_robot_t,
sensor_utf8: *const ::std::os::raw::c_char,
stream_utf8: *const ::std::os::raw::c_char,
out_frame: *mut *mut dex_frame_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_camera_stats(
robot: *mut dex_robot_t,
sensor_utf8: *const ::std::os::raw::c_char,
stream_utf8: *const ::std::os::raw::c_char,
out: *mut dex_stream_stats_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_robot_camera_is_active(
robot: *mut dex_robot_t,
sensor_utf8: *const ::std::os::raw::c_char,
stream_utf8: *const ::std::os::raw::c_char,
window_ms: u64,
out_active: *mut bool,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_frame_info(
frame: *const dex_frame_t,
out: *mut dex_frame_info_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_frame_data(
frame: *const dex_frame_t,
out_data: *mut *const u8,
out_len: *mut usize,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_frame_release(frame: *mut dex_frame_t);
}
unsafe extern "C" {
pub fn dex_motion_group_len(
group: *const dex_motion_group_t,
out_len: *mut usize,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_motion_group_member(
group: *const dex_motion_group_t,
index: usize,
out_motion: *mut *mut dex_motion_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_motion_group_wait(
group: *const dex_motion_group_t,
wait: *const dex_wait_policy_t,
out_state: *mut u32,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_motion_group_cancel(
group: *const dex_motion_group_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_motion_group_state(
group: *const dex_motion_group_t,
out_state: *mut u32,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_motion_group_release(group: *mut dex_motion_group_t);
}
unsafe extern "C" {
pub fn dex_motion_refresh(
motion: *const dex_motion_t,
out_state: *mut u32,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_motion_message(
motion: *const dex_motion_t,
out_message: *mut *mut ::std::os::raw::c_char,
error: *mut dex_error_t,
) -> dex_status_t;
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct dex_rate_limiter_stats_t {
pub struct_size: u32,
pub target_rate_hz: f64,
pub actual_rate_hz: f64,
pub average_rate_hz: f64,
pub iterations: u64,
pub missed_deadlines: u64,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of dex_rate_limiter_stats_t"]
[::std::mem::size_of::<dex_rate_limiter_stats_t>() - 48usize];
["Alignment of dex_rate_limiter_stats_t"]
[::std::mem::align_of::<dex_rate_limiter_stats_t>() - 8usize];
["Offset of field: dex_rate_limiter_stats_t::struct_size"]
[::std::mem::offset_of!(dex_rate_limiter_stats_t, struct_size) - 0usize];
["Offset of field: dex_rate_limiter_stats_t::target_rate_hz"]
[::std::mem::offset_of!(dex_rate_limiter_stats_t, target_rate_hz) - 8usize];
["Offset of field: dex_rate_limiter_stats_t::actual_rate_hz"]
[::std::mem::offset_of!(dex_rate_limiter_stats_t, actual_rate_hz) - 16usize];
["Offset of field: dex_rate_limiter_stats_t::average_rate_hz"]
[::std::mem::offset_of!(dex_rate_limiter_stats_t, average_rate_hz) - 24usize];
["Offset of field: dex_rate_limiter_stats_t::iterations"]
[::std::mem::offset_of!(dex_rate_limiter_stats_t, iterations) - 32usize];
["Offset of field: dex_rate_limiter_stats_t::missed_deadlines"]
[::std::mem::offset_of!(dex_rate_limiter_stats_t, missed_deadlines) - 40usize];
};
unsafe extern "C" {
pub fn dex_rate_limiter_create(
rate_hz: f64,
window_size: usize,
adaptive: bool,
out_limiter: *mut *mut dex_rate_limiter_t,
error: *mut dex_error_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_rate_limiter_sleep(limiter: *const dex_rate_limiter_t) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_rate_limiter_reset(limiter: *const dex_rate_limiter_t) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_rate_limiter_stats(
limiter: *const dex_rate_limiter_t,
out: *mut dex_rate_limiter_stats_t,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_rate_limiter_done(limiter: *const dex_rate_limiter_t) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_rate_limiter_actual_rate(
limiter: *const dex_rate_limiter_t,
out_rate: *mut f64,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_rate_limiter_average_rate(
limiter: *const dex_rate_limiter_t,
out_rate: *mut f64,
) -> dex_status_t;
}
unsafe extern "C" {
pub fn dex_rate_limiter_release(limiter: *mut dex_rate_limiter_t);
}