pub struct PoulpeRemoteClient {
pub ids: Vec<u16>,
pub names: Vec<String>,
/* private fields */
}
Fields§
§ids: Vec<u16>
§names: Vec<String>
Implementations§
Source§impl PoulpeRemoteClient
impl PoulpeRemoteClient
Sourcepub fn connect_with_name(
addr: Uri,
poulpe_names: Vec<String>,
update_period: Duration,
) -> Result<Self, Error>
pub fn connect_with_name( addr: Uri, poulpe_names: Vec<String>, update_period: Duration, ) -> Result<Self, Error>
Connect to the server with the given poulpe names
- connects to the server and reads the ids of the poulpe slaves
- checks if the given poulpe names are valid
- subsrtibes to the states of the given slaves
§Arguments
- addr: Uri: The address of the server
- poulpe_names: Vec<String>: The names of the poulpe slaves to connect to
- update_period: Duration: The update period for the state stream
§Returns
- Result<Self, std::io::Error>: The client if successful, else an error
Sourcepub fn connect(
addr: Uri,
poulpe_ids: Vec<u16>,
update_period: Duration,
) -> Result<Self, Error>
pub fn connect( addr: Uri, poulpe_ids: Vec<u16>, update_period: Duration, ) -> Result<Self, Error>
Connect to the server with the given poulpe ids
- connects to the server and reads the ids of the poulpe slaves
- checks if the given poulpe ids are valid
- subsrtibes to the states of the given slaves
§Arguments
- addr: Uri: The address of the server
- ids: Vec
: The ids of the poulpe slaves to connect to - update_period: Duration: The update period for the state stream
§Returns
- Result<Self, std::io::Error>: The client if successful, else an error
Sourcepub fn get_poulpe_ids_sync(
&self,
) -> Result<(Vec<u16>, Vec<String>), Box<dyn Error>>
pub fn get_poulpe_ids_sync( &self, ) -> Result<(Vec<u16>, Vec<String>), Box<dyn Error>>
Get all ids and names of slaves in the network
Sourcepub fn get_poulpe_ids(&self) -> Vec<u16>
pub fn get_poulpe_ids(&self) -> Vec<u16>
get the ids of the slaves the client is connected to
Sourcepub fn get_position_actual_value(&self, slave_id: u16) -> Result<Vec<f32>, ()>
pub fn get_position_actual_value(&self, slave_id: u16) -> Result<Vec<f32>, ()>
Get the current position of the slave [rad]
Sourcepub fn get_velocity_actual_value(&self, slave_id: u16) -> Result<Vec<f32>, ()>
pub fn get_velocity_actual_value(&self, slave_id: u16) -> Result<Vec<f32>, ()>
Get the current velocity of the slave [rad/s]
Sourcepub fn get_torque_actual_value(&self, slave_id: u16) -> Result<Vec<f32>, ()>
pub fn get_torque_actual_value(&self, slave_id: u16) -> Result<Vec<f32>, ()>
Get the current torque of the slave [mA]
Sourcepub fn get_target_position(&self, slave_id: u16) -> Result<Vec<f32>, ()>
pub fn get_target_position(&self, slave_id: u16) -> Result<Vec<f32>, ()>
Get the target position of the slave [rad]
Sourcepub fn get_motor_temperatures(&self, slave_id: u16) -> Result<Vec<f32>, ()>
pub fn get_motor_temperatures(&self, slave_id: u16) -> Result<Vec<f32>, ()>
Get the motor temperatures of the slave [°C]
Sourcepub fn get_board_temperatures(&self, slave_id: u16) -> Result<Vec<f32>, ()>
pub fn get_board_temperatures(&self, slave_id: u16) -> Result<Vec<f32>, ()>
Get the driver board temperatures of the slave [°C]
Sourcepub fn get_mode_of_operation(&self, slave_id: u16) -> Result<u32, ()>
pub fn get_mode_of_operation(&self, slave_id: u16) -> Result<u32, ()>
Get the mode of operation of the slave [CiA402 State] 1: Profile Position, 3: Profile Velocity, 4: Profile Torque (see poulpe_ethercat_controller::state_machine)
Sourcepub fn get_state(&self, slave_id: u16) -> Result<u32, ()>
pub fn get_state(&self, slave_id: u16) -> Result<u32, ()>
Get the state of the slave [BoardState] (see poulpe_ethercat_controller::register)
Sourcepub fn get_cia402_state(&self, slave_id: u16) -> Result<u32, ()>
pub fn get_cia402_state(&self, slave_id: u16) -> Result<u32, ()>
Get the state of the slave [CiA402 State] (see poulpe_ethercat_controller::state_machine)
Sourcepub fn get_torque_state(&self, slave_id: u16) -> Result<bool, ()>
pub fn get_torque_state(&self, slave_id: u16) -> Result<bool, ()>
Get the current compliance state of the slave (the same as is_on - deprecated)
Sourcepub fn get_axis_sensors(&self, slave_id: u16) -> Result<Vec<f32>, ()>
pub fn get_axis_sensors(&self, slave_id: u16) -> Result<Vec<f32>, ()>
Get the current axis sensor position [rad]
Sourcepub fn get_axis_sensor_zeros(&self, slave_id: u16) -> Result<Vec<f32>, ()>
pub fn get_axis_sensor_zeros(&self, slave_id: u16) -> Result<Vec<f32>, ()>
Get the axis senosr absolute zeros from the firmware [rad]
Sourcepub fn get_error_codes(&self, slave_id: u16) -> Result<Vec<i32>, ()>
pub fn get_error_codes(&self, slave_id: u16) -> Result<Vec<i32>, ()>
Get the motor and homing error codes (see poulpe_ethercat_controller::state_machine)
Sourcepub fn get_velocity_limit(&self, slave_id: u16) -> Result<Vec<f32>, ()>
pub fn get_velocity_limit(&self, slave_id: u16) -> Result<Vec<f32>, ()>
Get current velocity limits (relative from 0 to 1)
Sourcepub fn get_torque_limit(&self, slave_id: u16) -> Result<Vec<f32>, ()>
pub fn get_torque_limit(&self, slave_id: u16) -> Result<Vec<f32>, ()>
Get current torque limits (relative from 0 to 1)
Sourcepub fn set_mode_of_operation(&mut self, slave_id: u16, mode: u32)
pub fn set_mode_of_operation(&mut self, slave_id: u16, mode: u32)
Set the mode of operation of the slave [CiA402 compliant] 1: Profile Position, 3: Profile Velocity, 4: Profile Torque (see poulpe_ethercat_controller::state_machine)
Sourcepub fn set_target_position(&mut self, slave_id: u16, target_position: Vec<f32>)
pub fn set_target_position(&mut self, slave_id: u16, target_position: Vec<f32>)
Set the target position of the slave [rad]
Sourcepub fn set_target_velocity(&mut self, slave_id: u16, target_velocity: Vec<f32>)
pub fn set_target_velocity(&mut self, slave_id: u16, target_velocity: Vec<f32>)
Set the target velocity of the slave [rad/s]
Sourcepub fn set_target_torque(&mut self, slave_id: u16, target_torque: Vec<f32>)
pub fn set_target_torque(&mut self, slave_id: u16, target_torque: Vec<f32>)
Set the target torque of the slave [mA]
Sourcepub fn set_velocity_limit(&mut self, slave_id: u16, velocity_limit: Vec<f32>)
pub fn set_velocity_limit(&mut self, slave_id: u16, velocity_limit: Vec<f32>)
Set the velocity limit of the slave [relative from 0 to 1]
Sourcepub fn set_torque_limit(&mut self, slave_id: u16, torque_limit: Vec<f32>)
pub fn set_torque_limit(&mut self, slave_id: u16, torque_limit: Vec<f32>)
Set the torque limit of the slave [relative from 0 to 1]
Sourcepub fn emergency_stop(&mut self, slave_id: u16)
pub fn emergency_stop(&mut self, slave_id: u16)
Emergency stop the slave
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for PoulpeRemoteClient
impl !RefUnwindSafe for PoulpeRemoteClient
impl Send for PoulpeRemoteClient
impl Sync for PoulpeRemoteClient
impl Unpin for PoulpeRemoteClient
impl !UnwindSafe for PoulpeRemoteClient
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
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.