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

checkDataFormat関数ではASCII形式のチェックを行っていない #53

Closed
YusukeKato opened this issue Apr 5, 2024 · 1 comment
Labels
Type: Feature New Feature

Comments

@YusukeKato
Copy link
Contributor

現状の問題点

RtUsb9axisimuRosDriver::checkDataFormat関数では取得したデータがBinary形式かどうかのチェックは行っているが、ASCII形式かどうかのチェックは直接的には行っていない。

https://github.com/rt-net/rt_usb_9axisimu_driver/blob/ros2-devel/src/rt_usb_9axisimu_driver.cpp#L252

現在のcheckDataFormat関数の実装では取得したデータがBinary形式かどうかチェックして、Binary形式ではない場合はASCII形式だと判断している。

また、取得したデータがASCII形式だと判断されるためにはcheckDataFormat関数が二度実行される必要がある。

取得したデータが「ASCII形式」か「BinaryでもASCIIでもない形式」かの区別もできていなさそう。

改善案

RtUsb9axisimuRosDriver::readAsciiData関数で行っているASCII形式チェックをcheckDataFormat関数でも実施すると良さそう。

https://github.com/rt-net/rt_usb_9axisimu_driver/blob/ros2-devel/src/rt_usb_9axisimu_driver.cpp#L183

checkDataFormat関数を一度実行するだけで、Binary形式、ASCII形式、BinaryでもASCIIでもない形式、が判別できると良い。

代替案

なし。

その他

なし。

@YusukeKato
Copy link
Contributor Author

#54 で解決したためクローズします。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature New Feature
Projects
None yet
Development

No branches or pull requests

1 participant