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

Merge binary mode and ascii mode into one node #19

Merged
merged 7 commits into from
Jun 30, 2020
Merged

Conversation

ShotaAk
Copy link
Collaborator

@ShotaAk ShotaAk commented Jun 24, 2020

Checklists

  • I have read the CONTRIBUTING guidelines.
  • I have checked to ensure there aren't other open Pull Requests for the same change.

What does this implement/fix? Explain your changes.

rt_usb_9axisimu_ascii_mode.cpp の内容をrt_usb_9axisimu_binary_mode.cppに移植して、ノードを切り替えること無くバイナリモードのデータとアスキーモードのデータを受信します。

バイナリモードのモジュールを接続した状態でrt_usb_9axisimu_driverノードを起動すると、バイナリデータ受信モードでノードが動きます。

アスキーモードのモジュールを接続した状態でノードを起動すると、アスキーデータ受信モードでノードが動きます。

モードの判定はバイナリモードかどうかのみをチェックしているので、別のシリアルモジュールの接続は想定していません。(接続した場合は、アスキーモードで動作し、エラーを吐くと思います。)

クラス名変更等のリファクタリングは別PRで実施します。

Does this close any currently open issues?

いいえ。

How has this been tested?

roslaunch rt_usb_9axisimu_driver rt_usb_9axisimu_driver.launchを実行し、
アスキーモードのモジュールと、バイナリモードのモジュールのどちらを接続してもIMUトピックが出力されることを確認しました。

@ShotaAk ShotaAk added the Type: Feature New Feature label Jun 24, 2020
@Tiryoh Tiryoh self-requested a review June 24, 2020 04:49
@Tiryoh Tiryoh self-assigned this Jun 24, 2020
@Tiryoh Tiryoh linked an issue Jun 24, 2020 that may be closed by this pull request
Copy link
Contributor

@Tiryoh Tiryoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

実機にてASCII出力モードとバイナリ出力モード両方同一ノードで動作することを確認しました。

全然関係ない文字列を送ったところ以下のエラーが出てプロセスが停止しました。

[ INFO] [1592993554.204090319]: Data format is ascii.
terminate called after throwing an instance of 'std::invalid_argument'
  what():  stof

#18 で取り込んだコードに問題ありました。
別PRにてエラー修正します。

@Tiryoh Tiryoh added this to the Release 1.0.0 milestone Jun 25, 2020
@Tiryoh Tiryoh self-requested a review June 29, 2020 01:04
@Tiryoh
Copy link
Contributor

Tiryoh commented Jun 29, 2020

再度動作確認します。

@Tiryoh
Copy link
Contributor

Tiryoh commented Jun 30, 2020

実機にてASCII出力モードとバイナリ出力モード両方同一ノードで動作することを確認しました。

全然関係ない文字列を送ったところ以下のエラーが出てプロセスが停止しました。

実機にて接続確認し、ROSノード起動中にSW1を長押ししてメニューを呼び出してもプロセス自体は停止しないことを確認しました。

Copy link
Contributor

@Tiryoh Tiryoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

クラス名変更等のリファクタリングは別PRで実施します。

ということなのでこのPRについてはこれでOKだと思います。

@Tiryoh Tiryoh changed the title Merge binary mode and ascii mode Merge binary mode and ascii mode into one node Jun 30, 2020
@Tiryoh Tiryoh merged commit c5de342 into master Jun 30, 2020
@Tiryoh Tiryoh deleted the merge_binary_ascii branch June 30, 2020 02:32
@ShotaAk ShotaAk mentioned this pull request Jul 3, 2020
2 tasks
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

Successfully merging this pull request may close these issues.

Return OK only if the USB device is ready
2 participants