[−][src]Struct ev3dev_lang_rust::tacho_motor::LargeMotor
Methods
impl LargeMotor
[src]
pub fn new(port: MotorPort) -> Option<LargeMotor>
[src]
Try to get a LargeMotor
on the given port. Returns None
if port is not used or another device is connected.
pub fn find() -> Option<LargeMotor>
[src]
Try to find a LargeMotor
. Only returns a motor if their is exactly one connected, None
otherwise.
pub fn list() -> Vec<LargeMotor>
[src]
Extract list of connected 'LargeMotor'
Trait Implementations
impl Device for LargeMotor
[src]
fn get_attribute(&mut self, name: &str) -> &Attribute
[src]
fn get_address(&mut self) -> AttributeResult<String>
[src]
Returns the name of the port that the motor is connected to.
fn set_command(&mut self, command: String) -> AttributeResult<()>
[src]
Sends a command to the device controller.
fn get_commands(&mut self) -> AttributeResult<Vec<String>>
[src]
Returns a space separated list of commands that are supported by the device controller.
fn get_driver_name(&mut self) -> AttributeResult<String>
[src]
Returns the name of the driver that provides this device.
impl Motor for LargeMotor
[src]
impl TachoMotor for LargeMotor
[src]
fn get_count_per_rot(&mut self) -> AttributeResult<isize>
[src]
Returns the number of tacho counts in one rotation of the motor. Tacho counts are used by the position and speed attributes, so you can use this value to convert from rotations or degrees to tacho counts. (rotation motors only) Read more
fn get_count_per_m(&mut self) -> AttributeResult<isize>
[src]
Returns the number of tacho counts in one meter of travel of the motor. Tacho counts are used by the position and speed attributes, so you can use this value to convert from distance to tacho counts. (linear motors only) Read more
fn get_full_travel_count(&mut self) -> AttributeResult<isize>
[src]
Returns the number of tacho counts in the full travel of the motor. When combined with the count_per_m atribute, you can use this value to calculate the maximum travel distance of the motor. (linear motors only) Read more
fn get_duty_cycle(&mut self) -> AttributeResult<isize>
[src]
Returns the current duty cycle of the motor. Units are percent. Values are -100 to 100.
fn get_duty_cycle_sp(&mut self) -> AttributeResult<isize>
[src]
Returns the current duty cycle setpoint of the motor. Units are in percent. Valid values are -100 to 100. A negative value causes the motor to rotate in reverse. Read more
fn set_duty_cycle_sp(&mut self, duty_cycle: isize) -> AttributeResult<()>
[src]
Sets the duty cycle setpoint of the motor. Units are in percent. Valid values are -100 to 100. A negative value causes the motor to rotate in reverse. Read more
fn get_polarity(&mut self) -> AttributeResult<String>
[src]
Returns the current polarity of the motor.
fn set_polarity(&mut self, polarity: String) -> AttributeResult<()>
[src]
Sets the polarity of the motor.
fn get_position(&mut self) -> AttributeResult<isize>
[src]
Returns the current position of the motor in pulses of the rotary encoder. When the motor rotates clockwise, the position will increase. Likewise, rotating counter-clockwise causes the position to decrease. The range is -2,147,483,648 and +2,147,483,647 tachometer counts (32-bit signed integer) Read more
fn set_position(&mut self, position: isize) -> AttributeResult<()>
[src]
Sets the current position of the motor in pulses of the rotary encoder. When the motor rotates clockwise, the position will increase. Likewise, rotating counter-clockwise causes the position to decrease. The range is -2,147,483,648 and +2,147,483,647 tachometer counts (32-bit signed integer) Read more
fn get_hold_pid_kp(&mut self) -> AttributeResult<f32>
[src]
Returns the proportional constant for the position PID.
fn set_hold_pid_kp(&mut self, kp: f32) -> AttributeResult<()>
[src]
Sets the proportional constant for the position PID.
fn get_hold_pid_ki(&mut self) -> AttributeResult<f32>
[src]
Returns the integral constant for the position PID.
fn set_hold_pid_ki(&mut self, ki: f32) -> AttributeResult<()>
[src]
Sets the integral constant for the position PID.
fn get_hold_pid_kd(&mut self) -> AttributeResult<f32>
[src]
Returns the derivative constant for the position PID.
fn set_hold_pid_kd(&mut self, kd: f32) -> AttributeResult<()>
[src]
Sets the derivative constant for the position PID.
fn get_max_speed(&mut self) -> AttributeResult<isize>
[src]
Returns the maximum value that is accepted by the speed_sp
attribute. This value is the speed of the motor at 9V with no load. Note: The actual maximum obtainable speed will be less than this and will depend on battery voltage and mechanical load on the motor. Read more
fn get_position_sp(&mut self) -> AttributeResult<isize>
[src]
Returns the current target position for the run-to-abs-pos
and run-to-rel-pos
commands. Units are in tacho counts. You can use the value returned by counts_per_rot
to convert tacho counts to/from rotations or degrees. The range is -2,147,483,648 and +2,147,483,647 tachometer counts (32-bit signed integer). Read more
fn set_position_sp(&mut self, position_sp: isize) -> AttributeResult<()>
[src]
Sets the target position for the run-to-abs-pos
and run-to-rel-pos
commands. Units are in tacho counts. You can use the value returned by counts_per_rot
to convert tacho counts to/from rotations or degrees. The range is -2,147,483,648 and +2,147,483,647 tachometer counts (32-bit signed integer). Read more
fn get_speed(&mut self) -> AttributeResult<isize>
[src]
Returns the current motor speed in tacho counts per second. Note, this is not necessarily degrees (although it is for LEGO motors). Use the count_per_rot
attribute to convert this value to RPM or deg/sec. Read more
fn get_speed_sp(&mut self) -> AttributeResult<isize>
[src]
Returns the target speed in tacho counts per second used for all run-* commands except run-direct. A negative value causes the motor to rotate in reverse with the exception of run-to-*-pos commands where the sign is ignored. Use the count_per_rot
attribute to convert RPM or deg/sec to tacho counts per second. Use the count_per_m
attribute to convert m/s to tacho counts per second. Read more
fn set_speed_sp(&mut self, speed_sp: isize) -> AttributeResult<()>
[src]
Sets the target speed in tacho counts per second used for all run-* commands except run-direct. A negative value causes the motor to rotate in reverse with the exception of run-to-*-pos commands where the sign is ignored. Use the count_per_rot
attribute to convert RPM or deg/sec to tacho counts per second. Use the count_per_m
attribute to convert m/s to tacho counts per second. Read more
fn get_ramp_up_sp(&mut self) -> AttributeResult<isize>
[src]
Returns the current ramp up setpoint. Units are in milliseconds and must be positive. When set to a non-zero value, the motor speed will increase from 0 to 100% of max_speed
over the span of this setpoint. The actual ramp time is the ratio of the difference between the speed_sp and the current speed and max_speed multiplied by ramp_up_sp. Values must not be negative. Read more
fn set_ramp_up_sp(&mut self, ramp_up_sp: isize) -> AttributeResult<()>
[src]
Sets the ramp up setpoint. Units are in milliseconds and must be positive. When set to a non-zero value, the motor speed will increase from 0 to 100% of max_speed
over the span of this setpoint. The actual ramp time is the ratio of the difference between the speed_sp and the current speed and max_speed multiplied by ramp_up_sp. Values must not be negative. Read more
fn get_ramp_down_sp(&mut self) -> AttributeResult<isize>
[src]
Returns the current ramp down setpoint. Units are in milliseconds and must be positive. When set to a non-zero value, the motor speed will decrease from 100% down to 0 of max_speed
over the span of this setpoint. The actual ramp time is the ratio of the difference between the speed_sp and the current speed and 0 multiplied by ramp_down_sp. Values must not be negative. Read more
fn set_ramp_down_sp(&mut self, ramp_down_sp: isize) -> AttributeResult<()>
[src]
Sets the ramp down setpoint. Units are in milliseconds and must be positive. When set to a non-zero value, the motor speed will decrease from 100% down to 0 of max_speed
over the span of this setpoint. The actual ramp time is the ratio of the difference between the speed_sp and the current speed and 0 multiplied by ramp_down_sp. Values must not be negative. Read more
fn get_speed_pid_kp(&mut self) -> AttributeResult<f32>
[src]
Returns the proportional constant for the speed regulation PID.
fn set_speed_pid_kp(&mut self, kp: f32) -> AttributeResult<()>
[src]
Sets the proportional constant for the speed regulation PID.
fn get_speed_pid_ki(&mut self) -> AttributeResult<f32>
[src]
Returns the integral constant for the speed regulation PID.
fn set_speed_pid_ki(&mut self, ki: f32) -> AttributeResult<()>
[src]
Sets the integral constant for the speed regulation PID.
fn get_speed_pid_kd(&mut self) -> AttributeResult<f32>
[src]
Returns the derivative constant for the speed regulation PID.
fn set_speed_pid_kd(&mut self, kd: f32) -> AttributeResult<()>
[src]
Sets the derivative constant for the speed regulation PID.
fn get_state(&mut self) -> AttributeResult<Vec<String>>
[src]
Returns a list of state flags.
fn get_stop_action(&mut self) -> AttributeResult<String>
[src]
Returns the current stop action. The value determines the motors behavior when command is set to stop. Read more
fn set_stop_action(&mut self, stop_action: String) -> AttributeResult<()>
[src]
Sets the stop action. The value determines the motors behavior when command is set to stop. Read more
fn get_stop_actions(&mut self) -> AttributeResult<Vec<String>>
[src]
Returns a list of stop actions supported by the motor controller.
fn get_time_sp(&mut self) -> AttributeResult<isize>
[src]
Returns the current amount of time the motor will run when using the run-timed command. Units are in milliseconds. Values must not be negative. Read more
fn set_time_sp(&mut self, time_sp: isize) -> AttributeResult<()>
[src]
Sets the amount of time the motor will run when using the run-timed command. Units are in milliseconds. Values must not be negative. Read more
fn run_direct(&mut self) -> AttributeResult<()>
[src]
fn run_forever(&mut self) -> AttributeResult<()>
[src]
fn run_to_abs_pos(&mut self, position_sp: Option<isize>) -> AttributeResult<()>
[src]
fn run_to_rel_pos(&mut self, position_sp: Option<isize>) -> AttributeResult<()>
[src]
fn run_timed(&mut self, time_sp: Option<isize>) -> AttributeResult<()>
[src]
fn stop(&mut self) -> AttributeResult<()>
[src]
fn reset(&mut self) -> AttributeResult<()>
[src]
fn is_running(&mut self) -> AttributeResult<bool>
[src]
fn is_ramping(&mut self) -> AttributeResult<bool>
[src]
fn is_holding(&mut self) -> AttributeResult<bool>
[src]
fn is_overloaded(&mut self) -> AttributeResult<bool>
[src]
fn is_stalled(&mut self) -> AttributeResult<bool>
[src]
Auto Trait Implementations
impl Send for LargeMotor
impl Sync for LargeMotor
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,