velodyne
velodyne copied to clipboard
ROS2 Transform Node Memory Error
Please complete the following information:
- OS and Version: Ubuntu 18.04 Docker
- ROS Version: ROS2 Dashing
- Built from Source or Downloaded from Official Repository: Built from Source
- Version: 2cbd8a47f23b9ef877d0ccb34e410499b451c77f (dashing-devel head)
Describe the bug velodyne/velodyne_pointcloud/src/conversions/transform.cpp Line 161
Here a new Shared Pointer is created, however this appears to cause a memory error.
To Reproduce
- Configure a velodyne driver normally
- Configure transform node to have the same frame_id and fixed_frame as the DRIVER frame_id.
- Power on velodyne.
- Launch the driver and transform node with composed launch.
- Transform node crashes with "free(): invalid size" error.
Expected behavior The transform node does not crash, and filters based on frame_id.
Additional context I fixed this by having a "const shared_ptr<const VelodyneScan>" for setup in both the data container base and the point cloud classes, which prevents the need to create the shared pointer, however this leads to significant code duplication.
I ran into this issue as I am running both a VLP32C and a VLP16 on the same ros2, which causes conflicting conversions to occur, as the VLP32C convert node was converting VLP16 data, as well as it's own and vice versa. As the topics are not configurable, I found the transform node allows filtering based on frame id.
Thanks for reporting the issue, @Chase-san! Would you mind creating a Pull Request to resolve this issue?
I ran into this issue as I am running both a VLP32C and a VLP16 on the same ros2, which causes conflicting conversions to occur, as the VLP32C convert node was converting VLP16 data, as well as it's own and vice versa. As the topics are not configurable, I found the transform node allows filtering based on frame id.
I will note that I've tested both a VLP16 and VLP32C with dashing-devel when I did the initial port here. Both worked fine for me.
But I think this may be a mis-configuration. Topics are always configurable in ROS 2; you just need to use the topic remapping, like:
ros2 run velodyne_driver velodyne_driver_node --ros-args -r velodyne_packets:=/vlp16/velodyne_packets
What definitely will not work is having two velodyne_drivers from two different VLPs publishing to the same /velodyne_packets
topic. That will cause them to interfere with each other, and may be the reason you are getting a crash here.