Skip to content

Commit

Permalink
fix mA conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve Nguyen committed Nov 6, 2024
1 parent cdc5817 commit 585c826
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/device/xl330.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,14 @@ pub mod conv {
///
/// Works for present_current instance
pub fn dxl_current_to_ma(current: i16) -> f32 {
current as f32 * 2.69
current as f32 * 1.0
}
/// Current (mA) to dynamixel current
///
/// It should be in [-current_limit, +current_limit] with an absolute max at 1193 (3209.17mA)
/// Works for goal_current for instance
pub fn ma_to_dxl_current(current: f32) -> i16 {
(current / 2.69) as i16
(current / 1.0) as i16
}

/// Dxl Temperature (°C)
Expand Down

0 comments on commit 585c826

Please sign in to comment.