Closed pazeshun closed 4 years ago
Sorry, I unfortunately found that this PR doesn't completely solve unexpected behavior. After this PR, the right finger of left hand sometimes moves (not always) when the right hand is commanded to move.
When I commanded robot.HandOpen('rhand')
, rtcd log (/opt/jsk/var/log/rtcd.log
) shows:
[ServoSerial] setPositions 2: 8.401793 1.000000, 0054, 0064
[ServoSerial] setPositions 3: -54.238416 1.000000, fffffde2, 0064
[ServoSerial] setPositions 4: 5.537004 1.000000, 0037, 0064
[ServoSerial] setPositions 5: -54.238416 1.000000, fffffde2, 0064
[ServoSerial] setPositions 0: -nan 0.000000, 0000, 0000
[ServoSerial] setPositions 165067884: 57.295[ServoSerial] sending : FA AF 00 00 1E 05 08 02 54 00 64 00 03 E2 FD 64 00 04 37 00 64 00 05 E2 FD 64 00 00 00 00 00 00 6C 3C 02 00 00 07 3C 02 00 00 00 3C 02 00 00 25 - 48
[ServoSerial] received: FA AF 00 00 1E 05 08 02 54 00 64 00 03 E2 FD 64 00 04 37 00 64 00 05 E2 FD 64 00 00 00 00 00 00 6C 3C 02 00 00 07 3C 02 00 00 00 3C 02 00 00 25 - 48
[ServoSerial] setPositions 0: -nan 0.000000, 0000, 0000
is weird.
c.f. https://github.com/fkanehiro/hrpsys-base/blob/315.15.0/rtc/ServoController/ServoSerial.h#L109-L123
I found #1286 is the solution working correctly. However, I'm still suspicious about array initialization with non-const variable.
What is problem
When I moved the right hand of HIRONX using the latest hrpsys including some modifications, the left finger of left hand also moved. What I commanded is as follows:
robot.HandClose('lhand')
has no problem, butrobot.HandOpen('rhand')
unexpectedly moved left hand. You can see the behavior in this video: https://drive.google.com/open?id=19yFCOOD3o0bqJKtdLQQGNjTPPqdKmtbfCause
I found some arrays in ServoController RTC (used to move HIRONX hand) use non-const variable as number of elements when initialized. This causes unexpected behavior in QNX, as I explained in #1247 .
Solution
This PR stops that initialization of array. I confirmed I can move hand correctly with this PR.