コマンドラインからバイト型をパブリッシュする

忘れそうなので。

$ ros2 topic pub /topic std_msgs/msg/Byte "{data: {5}}"
publisher: beginning loop
publishing #1: std_msgs.msg.Byte(data=b'\x05')

publishing #2: std_msgs.msg.Byte(data=b'\x05')

publishing #3: std_msgs.msg.Byte(data=b'\x05')

ros2 topic pub /topic std_msgs/msg/Byte "{data: {255}}"
publisher: beginning loop
publishing #1: std_msgs.msg.Byte(data=b'\xff')

publishing #2: std_msgs.msg.Byte(data=b'\xff')

publishing #3: std_msgs.msg.Byte(data=b'\xff')

256をパブリッシュするとFailed to populate field: bytes must be in range(0, 256)と出るので多分あってる。

97,98,99...とパブリッシュすると表示上はa,b,c...に変換される。