PepperlFuchs / pf_lidar_ros_driver

ROS driver for Pepperl+Fuchs R2000 and R2300 laser scanners
https://www.pepperl-fuchs.com/global/en/23097.htm
Apache License 2.0
39 stars 38 forks source link

ROS2 support #80

Closed wawanbreton closed 11 months ago

wawanbreton commented 2 years ago

Hi, I'm using an R2000 lidar with ROS2, currently using a bridge from the ROS1 driver. I will now have a need not to use the bridge anymore, and having only ROS2 nodes. Is there a work in progress for ROS2 porting ? If not, I will start forking the repository and do it myself, but I just wanted to be sure nobody is alreay working on it.

ptruka commented 2 years ago

Hello, we will start the work on the ROS2 driver in the next week. A first version should be available by the end of this month.

wawanbreton commented 2 years ago

Thanks for the feedback. I just pushed a basically working version on my branch. I was about to start doing some refactoring, but it seems useless if you are up to it. You can take a look at it if needed on some points. I have been struggling about the deserialization of the header, since it is a bit more complicated (impossible ?) with ROS2, so I did a quick-and-dirty implementation. I'm curious to see how you will handle it :) Of course I would be happy to test your implementation if you need to, however I only have R2000 LIDARs.

hsd-dev commented 2 years ago

I am guessing this is the branch: https://github.com/wawanbreton/pf_lidar_ros_driver/tree/porting-ros2

Thanks for the initial work! I have created a PR here: https://github.com/PepperlFuchs/pf_lidar_ros_driver/pull/82 I will push more commits to it

wawanbreton commented 2 years ago

Ok, nice ! I think it requires some refactoring : I had to reorganize the initialization as in ROS2 you can't read the parameters before the node is created, so I did things that are not very clean. It works for me yet so I can use my LIDAR, but feel free to break what I did !

hsd-dev commented 2 years ago

sure :) Porting of the package.xml and CMakeLists.txt is already good contribution.

hsd-dev commented 2 years ago

https://github.com/PepperlFuchs/pf_lidar_ros_driver/pull/82 has been closed and the work is being continued on https://github.com/PepperlFuchs/pf_lidar_ros_driver/pull/83.

shaoxiang commented 1 year ago

Is there a time schedule for ROS2 support? Thanks.

chenwu-cc commented 1 year ago

ROS2 支持有时间表吗?谢谢。

Can you use the porting ROS2 version normally? We urgently need the ROS2 version driver

andrewTianxiaolu commented 1 year ago

Hi there. I just tried the porting-ros2 branch on Ubuntu22/ros2 humble, and I met an error when I build the pf_driver. The error is no matching function for call to ‘rclcpp::Duration::Duration(double)’. I have already installed the rosdep before building the source code. 倍加福编译问题 Does anybody have met the same problem like it?

hsd-dev commented 1 year ago

ROS2 支持有时间表吗?谢谢。

Can you use the porting ROS2 version normally? We urgently need the ROS2 version driver

Most of the features are working. There are couple of more bugs to be fixed, which I will do next week.

hsd-dev commented 1 year ago

Hi there. I just tried the porting-ros2 branch on Ubuntu22/ros2 humble, and I met an error when I build the pf_driver. The error is no matching function for call to ‘rclcpp::Duration::Duration(double)’. I have already installed the rosdep before building the source code. 倍加福编译问题 Does anybody have met the same problem like it?

Thanks for testing it on Humble. The driver has been tested only on foxy and galactic. I will take a look at the Humble api and make changes in the coming days.

shaoxiang commented 1 year ago

ROS2 支持有时间表吗?谢谢。

Can you use the porting ROS2 version normally? We urgently need the ROS2 version driver

It can already be run on ROS2 foxy version.

PGotzmann commented 1 year ago

Thanks for porting this to ROS2. Really looking forward to this release. Since both foxy and galactic are already end of life for quiet some time now I still need to ask if you are also planing to release this on Humble and if so when we can expect such a release.

hsd-dev commented 1 year ago

@PGotzmann thanks for your interest. There was a small change (mentioned below) required for humble. The initial test looks good on Humble.

This week we fixed few bugs related to setting (changing) parameters at runtime. Next week we have planned an extensive test for Foxy, Galactic and Humble.

hsd-dev commented 1 year ago

@andrewTianxiaolu said:

Hi there. I just tried the porting-ros2 branch on Ubuntu22/ros2 humble, and I met an error when I build the pf_driver. The error is no matching function for call to ‘rclcpp::Duration::Duration(double)’. I have already installed the rosdep before building the source code. 倍加福编译问题 Does anybody have met the same problem like it?

https://github.com/PepperlFuchs/pf_lidar_ros_driver/pull/83/commits/46ca683de303f86254dd90e7513f8ae6b385bb1d should fix the error.

Another "fix" that might be needed is mentioned here: https://github.com/open-source-parsers/jsoncpp/issues/1356

hsd-dev commented 11 months ago

As mentioned in https://github.com/PepperlFuchs/pf_lidar_ros_driver/pull/83#issuecomment-1815977173, the ROS 2 version for foxy, galactic, humble and iron has been moved to a new repo: https://github.com/PepperlFuchs/pf_lidar_ros2_driver. The initial testing is done. Please test the driver and create issues in the new repo.