Skip to content

change msg type of rpy gain from int16 to uint16 #721

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kitagawa444
Copy link

@kitagawa444 kitagawa444 commented Aug 22, 2025

What is this

change msg type of rpy gain from int16 to uint16

Details

Currently, the upper limit of the RPY gain is 32.767 (≤ 2¹⁵ = 32,768, int16).
Since negative values are never used, we can change the message type to uint16, which increases the upper limit to 65,535.

@kitagawa444
Copy link
Author

I haven't checked in rm

@kitagawa444 kitagawa444 marked this pull request as draft August 22, 2025 02:55
@kitagawa444
Copy link
Author

kitagawa444 commented Aug 22, 2025

I have checked in rm.
It worked well in flight.

For ex,
/rpy/gain
`motors:

roll_p: 35000
roll_i: 7000
roll_d: 15500
pitch_p: 35000
pitch_i: 7000
pitch_d: 15500
yaw_d: 4000

previous
motors:

roll_p: −30,536
roll_i: 7000
roll_d: 15500
pitch_p: −30,536
pitch_i: 7000
pitch_d: 15500
yaw_d: 4000

`

@kitagawa444 kitagawa444 marked this pull request as ready for review August 22, 2025 07:03
@tongtybj
Copy link
Collaborator

@kitagawa444

Perfect!

@kitagawa444 kitagawa444 changed the title [WIP] change msg type of rpy gain from int16 to uint16 change msg type of rpy gain from int16 to uint16 Aug 23, 2025
@tongtybj
Copy link
Collaborator

The rpy gain for other robots, such as mini_quadrotor, is calculated for each rotor, where the negatives value exist:

chou@homeaxis:~$ rostopic echo /quadrotor/rpy/gain -n 1
motors:
  -
    roll_p: -2020
    roll_i: -355
    roll_d: -419
    pitch_p: 2011
    pitch_i: 353
    pitch_d: 416
    yaw_d: 1095
  -
    roll_p: -2001
    roll_i: -351
    roll_d: -412
    pitch_p: -2010
    pitch_i: -353
    pitch_d: -416
    yaw_d: -1100
  -
    roll_p: 2001
    roll_i: 351
    roll_d: 412
    pitch_p: -2010
    pitch_i: -353
    pitch_d: -416
    yaw_d: 1100
  -
    roll_p: 2020
    roll_i: 355
    roll_d: 419
    pitch_p: 2011
    pitch_i: 353
    pitch_d: 416
    yaw_d: -1095
---

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

Successfully merging this pull request may close these issues.

2 participants