Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Range of xl320 is 300 but would expect 360 #55

Open
haixuanTao opened this issue May 20, 2024 · 1 comment
Open

Range of xl320 is 300 but would expect 360 #55

haixuanTao opened this issue May 20, 2024 · 1 comment

Comments

@haixuanTao
Copy link
Contributor

/// Unit conversion for XL-320 motors
pub mod conv {
/// Dynamixel angular position to radians
///
/// Works in joint and multi-turn mode
pub fn xl320_pos_to_radians(pos: i16) -> f64 {
(300.0_f64.to_radians() * (pos as f64) / 1024.0) - 150.0_f64.to_radians()
}
/// Radians to dynamixel angular position
///
/// Works in joint and multi-turn mode
pub fn radians_to_xl320_pos(rads: f64) -> i16 {
(1024.0 * (150.0_f64.to_radians() + rads) / 300.0_f64.to_radians()) as i16
}

I was wondering why when converting angles from xl320 from angular bit to radians, the range chosen is 300 and not 360.

I guess its probably linked to the Drive mode right?

In which case I would guess it could be good to:

  • A. document it
  • B. maybe add a debug assertion or something as to not confuse users.
@SteveNguyen
Copy link
Contributor

Hi,
Well it looks like for the XL320 the valid range is in [0°, 300°] in joint mode.
cf. https://emanual.robotis.com/docs/en/dxl/x/xl320/#present-position ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants