Skip to content

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

@YusukeKato

Description

@YusukeKato

現状の問題点

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でもない形式、が判別できると良い。

代替案

なし。

その他

なし。

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy