From 63f89821c217b51e9b66599aae3c5bdb2d60d3ab Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Mon, 4 Sep 2023 11:12:18 +0200 Subject: [PATCH] Fix conversion from Python dict to arrow type in ROS2 example --- examples/python-ros2-dataflow/random_turtle.py | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/examples/python-ros2-dataflow/random_turtle.py b/examples/python-ros2-dataflow/random_turtle.py index 7892073b..4fef3571 100755 --- a/examples/python-ros2-dataflow/random_turtle.py +++ b/examples/python-ros2-dataflow/random_turtle.py @@ -51,19 +51,8 @@ for i in range(500): }, } - print(direction, flush=True) - # TODO FIXME: The below line seems to result in an - # `["linear", "angular"]` array, completely ignoring the values. - direction_arrow = pa.array( - direction, - # TODO: maybe type annotations help somehow? - # type=pa.map_( - # pa.utf8(), - # pa.map_(pa.utf8(), pa.float32()), - # ), - ) - print(direction_arrow, flush=True) - # twist_writer.publish(direction_arrow) + direction_arrow = pa.array([pa.scalar(direction)]) + twist_writer.publish(direction_arrow) case "tick": pass