NVIDIA-ISAAC-ROS / isaac_ros_map_localization

NVIDIA-accelerated global localization
https://developer.nvidia.com/isaac-ros-gems
Apache License 2.0
57 stars 6 forks source link

cudaMemcpy failed when using velodyne vlp 16 #10

Open springcloud-bcchoi opened 1 year ago

springcloud-bcchoi commented 1 year ago

_Topic information: Topic: /velodyne_points | Type: sensor_msgs/msg/PointCloud2 | Count: 582 | Serialization Format: cdr_

I encountered the following error when transmitting the topic "/velodyne_points" of type "sensor_msgs/msg/PointCloud2" with a count of 582 and serialization format of cdr:

_[component_container_mt-1] [ERROR] [1686143869.761777459] [NitrosPointCloud]: [convert_to_custom] cudaMemcpy failed for copying data from sensormsgs::msg::PointCloud2 to NitrosPointCloud: cudaErrorInvalidValue (invalid argument)

It seems that there is an issue with copying the data from the sensor_msgs::msg::PointCloud2 to NitrosPointCloud, resulting in a cudaMemcpy failed error with cudaErrorInvalidValue (invalid argument).

I suspect that modifications are required in the pointcloud_to_flatscan_node.yaml file. Could you please guide me on how to proceed with the necessary changes in the file?

ashwinvkNV commented 1 year ago

Can you please post a short rosbag and launch file that can be used to reproduce this issue?

springcloud-bcchoi commented 1 year ago

rosbag2_2023_06_08-14_07_45.zip

admin@bcc-desktop:/workspaces/isaac_ros-dev$ ros2 bag info rosbag2_2023_06_08-14_07_45

Files:             rosbag2_2023_06_08-14_07_45_0.db3
Bag size:          42.4 MiB
Storage id:        sqlite3
Duration:          8.389s
Start:             Jun  8 2023 14:07:45.511 (1686200865.511)
End:               Jun  8 2023 14:07:53.901 (1686200873.901)
Messages:          85
Topic information: Topic: /velodyne_points | Type: sensor_msgs/msg/PointCloud2 | Count: 85 | Serialization Format: cdr
springcloud-bcchoi commented 1 year ago

Here is the launch file, isaac_ros_pointcloud_utils/launch/isaac_ros_pointcloud_to_flatscan.launch.py, that I used from Isaac ROS 0.30.0 (DP3) version.

milesprieb commented 1 year ago

I am also experiencing the same issue when converting from Ouster LiDAR (Topic:os_lidar/points) PointCloud2 -> NitrosPointCloud.

[component_container_mt-1] [ERROR] [1689000288.056167546] [NitrosPointCloud]: [convert_to_custom] cudaMemcpy failed for copying data from sensor_msgs::msg::PointCloud2 to NitrosPointCloud: cudaErrorInvalidValue (invalid argument) [component_container_mt-1] terminate called after throwing an instance of 'std::runtime_error' [component_container_mt-1] what(): [convert_to_custom] cudaMemcpy failed for copying data from sensor_msgs::msg::PointCloud2 to NitrosPointCloud: cudaErrorInvalidValue (invalid argument)

Here is the output of 'ros2 bag info':

Files: rosbag2_2023_04_14-10_40_22_0.db3 Bag size: 4.6 GiB Storage id: sqlite3 Duration: 157.263s Start: Apr 14 2023 12:40:27.470 (1681490427.470) End: Apr 14 2023 12:43:04.733 (1681490584.733) Messages: 17299 Topic information: Topic: /os_lidar/imu | Type: sensor_msgs/msg/Imu | Count: 15726 | Serialization Format: cdr Topic: /os_lidar/points | Type: sensor_msgs/msg/PointCloud2 | Count: 1573 | Serialization Format: cdr

HappySamuel commented 6 months ago

Hi @springcloud-bcchoi , @milesprieb

I found a solution for this. Not sure if you still need it.

For the pointcloud2 topic that this package need is PointXYZ, which only need 3 fields. If you pass the lidar pointcloud directly from those lidars, the package will throw error and quit. Therefore, there're 2 options that you can do: (1) amending of your lidar driver package to output X, Y, Z field only. (2) Add 1 more node in between lidar driver package and the pointcloud_to_flatscan node, which do the removing of extra fields and output X, Y, Z fields in the pointcloud topic.

Hope this helps.

Best, Samuel