Cannot/don't know how to publish message with `byte[]` field
See original GitHub issueBug report
Required Info:
- Operating System:
- Ubuntu 20.04
- Installation type:
- binaries
- Version or commit hash:
- ros2cli 0.13.4
- DDS implementation:
- rmw_cyclonedds_cpp: 0.22.5
- Client library (if applicable):
- N/A
Steps to reproduce issue
Trying to ros2 topic pub
a std_msgs/msg/ByteMultiArray
message. I have tried:
bash ros2 topic pub -1 /whatever std_msgs/msg/ByteMultiArray "{data: [{3}, {4}]}"
and
bash ros2 topic pub -1 /whatever std_msgs/msg/ByteMultiArray "{data: [0x03, 0x04]}"
Expected behavior
Successful publishing.
Actual behavior
Error response:
Failed to populate field: The 'data' field must be a set or sequence and each value of type 'bytes'
Additional information
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Try-Me seems to send message as byte[] array and not text
Hi,. Using the the try-me functionality of the Solace Cloud Console to publish a message. The problem is that it seems to sends...
Read more >in JMeter, how to send a 4 byte message to a JMS publisher
I have to run a performance test on a application that consumes from a ActiveMQ topic. The sampler needs to publish 4 Bytes...
Read more >Understanding of AMQP Basic.Publish frame format
I am trying to parse the "arguments" field in the payload of AMQP Basic.Publish method According to the specifications, the three first parameters...
Read more >Publish - Amazon Simple Notification Service
Sends a message to an Amazon SNS topic, a text message (SMS message) ... You can publish messages only to topics and endpoints...
Read more >Understanding the MQTT Protocol Packet Structure
The minimum size of the packet length field is 1 byte which is for messages with a total length less than 127 bytes.(not...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@fujitatomoya
The generated message for python in
build/std_msgs/ament_cmake_python/std_msgs/std_msgs/msg/_byte_multi_array.py:158
only checking a typebytes
seems not enough.The type could be
int
if usingros2 topic pub -1 /whatever std_msgs/msg/ByteMultiArray "{data: [3]}"
.I am afraid that we should update the above source code with
NOTE: It means that we need to update https://github.com/ros2/rosidl_python/blob/52e099efef21366ff651385da865e305228d24ec/rosidl_generator_py/resource/_msg.py.em
both do not work.