-
Notifications
You must be signed in to change notification settings - Fork 34
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
[Spinal][PwmTest] workaround to send pwm value to each servo independependently #613
Conversation
@tongtybj This PR doesn't depend on any other features, so could you please check and merge this? |
LGTM. But I do think it would be better to refactor Pwms.msg rather than defining a new message. On the other hand, I also understand this will effect the whole system if we change the structure of |
In my understanding, Pwms.msg is for state message rather than for command, and I guess this is the reason why the current system doesn't use Pwms.msg for PWM test, right? |
I was told that creating original message type is a stupid way, and using the standard message type such as std_msgs, geometry_msgs is the clever way. Considering the limited bandwidth of communication between PC and MCU, we have to define some original light-weight message types. But the number of original message type should be kept to the minimum. Therefore, if two different topics have very similoar contents, it is better to use a common message type.
It is just becuase I didn't realize the need of sending different PWM values to different motor... |
OK, so the best way you think is using Pwms.msg for both status and command topics, right? |
That only applies to half. The best solution I suggest is to use PwmTest.msg (of couse, rename it to Pwm.msg or something like that ) for both status and command topics. |
All right, I'll modify some parts as you have suggested. |
I'm sorry I didn't explain it enough... I will merge this PR with current version. |
All right, everything is clear. |
What is this
Change some structure of the PWM test to support motor-by-motor check
Usage
rostopic pub -1 /pwm_test spinal/PwmTest "motor_index: [] pwms: [0.55]"
rostopic pub -1 /pwm_test spinal/PwmTest "motor_index: [0,2] pwms: [0.55, 0.65]"
rostopic pub -1 /pwm_test spinal/PwmTest "motor_index: [] pwms: []"