Publishing arrays with rqt_publisher in ROS2
I am having trouble publishing messages with sequences in them, such as example_interfaces/UInt8MultiArray. By default, the expression is populated with array('B')
. When I try to populate with data, such as array('B', [1])
I get errors in the terminal.
[ERROR] [1611709217.176271581] [get_message_class]: Malformed message_type: sequence<double> Python eval failed for expression "array('d',[1])" with an exception "name 'array' is not defined" Publisher._evaluate_expression(): failed to evaluate expression: "array('d',[1])" as Python type "None" Traceback (most recent call last): File "/opt/ros/foxy/lib/python3.8/site-packages/rqt_publisher/publisher.py", line 157, in change_publisher new_text = handler(self._publishers[publisher_id], topic_name, new_value) File "/opt/ros/foxy/lib/python3.8/site-packages/rqt_publisher/publisher.py", line 258, in _change_publisher_expression expression, error_prefix, slot_type.__name__) AttributeError: 'NoneType' object has no attribute '__name__'
Can someone provide an example of proper usage for the expression field?
Thanks!