Up my_robot_msgs/BrainCmd 作成: 2026-08-25
更新: 2026-09-23

4足歩行ロボット > 自律型> コンピュータ > プログラミング > ROS2 ノート > データの型 > BrainCmd

    BrainCmd は,
      node : brain (歩行脳NNドライバ)
      publisher : brain_publisher
      topic : /brain/cmd
    のデータ型。

    つぎのフィールドで成る:
      float32[12] current

    配列を使わないで書くと:
      float32 fore_right_hip_current
      float32 fore_right_knee_current
      float32 fore_right_ankle_current
      float32 fore_left_hip_current
      float32 fore_left_knee_current
      float32 fore_left_ankle_current
      float32 hind_right_hip_current
      float32 hind_right_knee_current
      float32 hind_right_ankle_current
      float32 hind_left_hip_current
      float32 hind_left_knee_current
      float32 hind_left_ankle_current


    備考. 配列で書くメリット
     ・コードが短くなる
     ・NN の入出力と相性が良い(ベクトルとして扱える)
     ・モータ数が変わっても拡張しやすい
     ・Python/C++ の処理が高速になる
     ・msg の可読性が高い