Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

porting pointcoud_to_pcd to ros2 #444

Merged

Conversation

Ar-Ray-code
Copy link
Contributor

I needed the ROS 2 version of pointcoud_to_pcd, so I will port it and submit a PR.
Please review.

Depends

  • ROS 2 Humble (on Ubuntu22.04 LTS, x86-64)

Usage

  • subscriber topic (pointcloud2) : /cloud_in
  • prefix : abc_
  • fixed_frame (central frame_id) : base_link
ros2 run pcl_ros pointcloud_to_pcd --ros-args -r input:=/cloud_in -p prefix:=abc_ -p fixed_frame:=base_link

How to check exported pcd file

pcl_viewer <path to .pcd file>

image

Thank you.

Copy link
Member

@SteveMacenski SteveMacenski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM from a quick glance. From your testing image I assume this works fine

@SteveMacenski
Copy link
Member

Were there tests associated with this as well?

Otherwise, give this a week and if no other maintainers chime in, ping me again and I'll merge it

Copy link

@remco-r remco-r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

builds for humble (not for foxy)
features tested

  • prefix
  • compresed
  • binary
  • prefix
  • fixed_frame

ros2 run pcl_ros pointcloud_to_pcd --ros-args -r input:=os_node/points -p prefix:=abc_ -p binary:=true -p compressed:=true -p fixed_frame:=base_link

Everything works except fixed_frame feature because my (ouster) lidar frame is on tf_static i get the following error.

[WARN] [1712221819.952296406] [transform_listener_impl_556e0f932ee0]: New publisher discovered on topic '/tf_static', offering incompatible QoS. No messages will be sent to it. Last incompatible policy: DURABILITY_QOS_POLICY
[ERROR] [1712221820.239036841] [pointcloud_to_pcd]: Transform error: "os_sensor" passed to lookupTransform argument source_frame does not exist. 

@Ar-Ray-code
Copy link
Contributor Author

Ar-Ray-code commented Apr 4, 2024

builds for humble (not for foxy) features tested

  • prefix
  • compresed
  • binary
  • prefix
  • fixed_frame

ros2 run pcl_ros pointcloud_to_pcd --ros-args -r input:=os_node/points -p prefix:=abc_ -p binary:=true -p compressed:=true -p fixed_frame:=base_link

Everything works except fixed_frame feature because my (ouster) lidar frame is on tf_static i get the following error.

[WARN] [1712221819.952296406] [transform_listener_impl_556e0f932ee0]: New publisher discovered on topic '/tf_static', offering incompatible QoS. No messages will be sent to it. Last incompatible policy: DURABILITY_QOS_POLICY
[ERROR] [1712221820.239036841] [pointcloud_to_pcd]: Transform error: "os_sensor" passed to lookupTransform argument source_frame does not exist. 

Thank you for your testing.

fixed_frame is an option that can be used when the sensor is connected to another tf.
For example, the following command broadcasts a relative position with x=2, yaw=90deg.

ros2 run tf2_ros static_transform_publisher 2 0 0 0 0 0.707 0.707 base_link velodyne

I would consider implementing the following: if tf cannot be obtained, a warning is displayed and the fixed_frame option is ignored. <- done

@Ar-Ray-code
Copy link
Contributor Author

Ar-Ray-code commented Apr 4, 2024

I also added the rgb option because when I tested with velodyne we could not save in RGB. (Default is false)

@SteveMacenski
Copy link
Member

@remco-r let me know if that resolves your concern

@remco-r
Copy link

remco-r commented Apr 5, 2024

@SteveMacenski

  • The fixed_frame issue is just an observation. Its a ros2 and tf issue though, and not related to this PR. So concern resolved
  • The new RGB + use_transform features added in the last two commits I havent tested, but the code looks good.

@SteveMacenski SteveMacenski merged commit 7e3401c into ros-perception:ros2 Apr 5, 2024
1 of 4 checks passed
@Ar-Ray-code Ar-Ray-code deleted the feat/support_pointcloud_to_pcd branch April 6, 2024 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants