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

Hwdev 2399 feat use correct mm per pulse when tug connected #59

Merged

Conversation

ar90n
Copy link
Contributor

@ar90n ar90n commented Sep 24, 2024

ref: HWDEV-2399

This PR is motivated to add selecting mm_per_pulse depends on whether tug is connected or not and fix wrong error value handling in info sub command. This PR contains followings

  • add a function whose name is get_mm_per_pulse to get suitable mm_per_pulse depends on whether tug is connected or not.
  • Add displaying mm_per_sec in info sub command.
  • Fix wrong value cast in info sub command, which is casting -1 into uint8_t.

This PR is tested in robots. And results are followings.

with tug

uart:~$ tug_encoder info
Angle: 74.882812[deg]
TUG connected: 1
Magnet detected: 0
Raw Angle: 0
Burn count: 3
ZPOS: 3244
MPOS: 3244
uart:~$ act info
[notice] parameter order [Center] [Left] [Right]
actuator: 0 encoder: -1 pulse current: 0 mV fail: 0 dir: 0 duty: 0 mm/pulse: 0.047438
actuator: 1 encoder: -1 pulse current: 0 mV fail: 0 dir: 0 duty: 0 mm/pulse: 0.003300
actuator: 2 encoder: -1 pulse current: 0 mV fail: 0 dir: 0 duty: 0 mm/pulse: 0.003300

without tug

uart:~$ tug_encoder info
Angle: 0.000000[deg]
TUG connected: 0
Magnet detected: 0
Raw Angle: -1
Burn count: -1
ZPOS: -1
MPOS: -1
[00:00:42.334,000] <wrn> tug_encoder: Failed to read ZMCO
[00:00:42.334,000] <wrn> tug_encoder: Failed to read AS5600_REG_RAW_ANGLE_H
[00:00:42.334,000] <wrn> tug_encoder: Failed to read AS5600_REG_ZPOS_H
[00:00:42.334,000] <wrn> tug_encoder: Failed to read AS5600_REG_MPOS_H
[00:00:42.337,000] <wrn> tug_encoder: Failed to read status
uart:~$ act info
[notice] parameter order [Center] [Left] [Right]
actuator: 0 encoder: -1 pulse current: 2 mV fail: 0 dir: 0 duty: 0 mm/pulse: 0.047438
actuator: 1 encoder: -1 pulse current: 0 mV fail: 0 dir: 0 duty: 0 mm/pulse: 0.047438
actuator: 2 encoder: -1 pulse current: 2 mV fail: 0 dir: 0 duty: 0 mm/pulse: 0.047438

@github-actions github-actions bot added the feat label Sep 24, 2024
Base automatically changed from HWDEV-2398-feat-improve-encoder-count-precision to main September 25, 2024 02:38
@ar90n ar90n force-pushed the HWDEV-2399-feat-use-correct-mm-per-pulse-when-tug-connected branch from 509d579 to abbfae7 Compare September 25, 2024 04:53
@ar90n ar90n marked this pull request as ready for review September 25, 2024 04:58
@ar90n ar90n merged commit 1b91ad6 into main Sep 30, 2024
3 checks passed
@ar90n ar90n deleted the HWDEV-2399-feat-use-correct-mm-per-pulse-when-tug-connected branch September 30, 2024 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants