Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add checks for bad data, file handle. Dont move servos if Joint 6 / 7…
… value is "NaN" Check the result of ProcessServerReceiveDataDDE and don't try to interpret the data if it returned a false. This keeps DexRun from crashing if invalid data is sent. e.g. missing the ';' at the EOL. Additional checks on file handle wfp to verify it's an open file (greater than 0) before attempting to close it, always set to zero when closed. (vs -1) Previously we were checking if wfp was equal to zero, and was sometimes be set to -1 when the file was closed. See: 8976cc6#diff-691272021fae98368efb598f8e089c16 If a user sends an 'a' command with 5 numbers, only the first 5 joints will be moved, Joints 6 and 7 (the Dynamixel servos) will not be sent any command. The same is true for joint 7 only if you send 6 numbers; joint 6 will move, joint 7 won't. In order to support moving joint 7 and not moving joint 6, the option to send "NaN" is supported for joint 6 and 7. E.g. "a 0 0 0 0 0 NaN 0" will move all joints, except joint 6, to home. In fact, the code is only checking the first letter of the value, so anything that starts with a capital "N" will do.