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

ros2 compilation error due to notifyPointcloudListener's handle type #83

Closed
youliangtan opened this issue Jun 30, 2022 · 2 comments · Fixed by #84
Closed

ros2 compilation error due to notifyPointcloudListener's handle type #83

youliangtan opened this issue Jun 30, 2022 · 2 comments · Fixed by #84

Comments

@youliangtan
Copy link
Contributor

Issue Description

I am getting compilation errors while using the latest master of sick_scan_xd, for ROS2 .

Setup Environment:

  • ros2 foxy
  • ubuntu 20.04
  • latest main with commit hash: eacf743e3d432febeb9799b2fe9019f2eb46ba90

Error messages

Starting >>> sick_scan
[Processing: sick_scan]                             
[Processing: sick_scan]                                     
--- stderr: sick_scan                                       
/home/youliang/ros2_ws/src/sick_scan_xd/driver/src/sick_scan_common.cpp: In member function ‘int sick_scan::SickScanCommon::loopOnce(rosNodePtr)’:
/home/youliang/ros2_ws/src/sick_scan_xd/driver/src/sick_scan_common.cpp:4531:44: error: cannot convert ‘rosNodePtr’ {aka ‘std::shared_ptr<rclcpp::Node>’} to ‘sick_scan::Handle’ {aka ‘void*’}
4531 |                   notifyPointcloudListener(nh, &cloud_);
    |                                            ^~
    |                                            |
    |                                            rosNodePtr {aka std::shared_ptr<rclcpp::Node>}
In file included from /home/youliang/ros2_ws/src/sick_scan_xd/include/sick_scan/sick_scan_common.h:73,
               from /home/youliang/ros2_ws/src/sick_scan_xd/driver/src/sick_scan_common.cpp:74:
/home/youliang/ros2_ws/src/sick_scan_xd/include/sick_scan/sick_generic_callback.h:69:42: note:   initializing argument 1 of ‘void sick_scan::notifyPointcloudListener(sick_scan::Handle, const PointCloud2*)’
 69 |     void notifyPointcloudListener(Handle handle, const ros_sensor_msgs::PointCloud2* msg);
    |                                   ~~~~~~~^~~~~~
/home/youliang/ros2_ws/src/sick_scan_xd/driver/src/sick_scan_common.cpp: In member function ‘int sick_scan::SickScanCommon::loopOnce(rosNodePtr)’:
/home/youliang/ros2_ws/src/sick_scan_xd/driver/src/sick_scan_common.cpp:4531:44: error: cannot convert ‘rosNodePtr’ {aka ‘std::shared_ptr<rclcpp::Node>’} to ‘sick_scan::Handle’ {aka ‘void*’}
4531 |                   notifyPointcloudListener(nh, &cloud_);
    |                                            ^~
    |                                            |
    |                                            rosNodePtr {aka std::shared_ptr<rclcpp::Node>}
In file included from /home/youliang/ros2_ws/src/sick_scan_xd/include/sick_scan/sick_scan_common.h:73,
               from /home/youliang/ros2_ws/src/sick_scan_xd/driver/src/sick_scan_common.cpp:74:
/home/youliang/ros2_ws/src/sick_scan_xd/include/sick_scan/sick_generic_callback.h:69:42: note:   initializing argument 1 of ‘void sick_scan::notifyPointcloudListener(sick_scan::Handle, const PointCloud2*)’
 69 |     void notifyPointcloudListener(Handle handle, const ros_sensor_msgs::PointCloud2* msg);

It seems like the error is related to the newly created notifyPointcloudListener class in #82 PR. Meanwhile, to run the driver with ros2, I am still using the commit after the merge of #76, which seems to work fine till now.

To ensure pkg stability, the recommendation is to have a simple CI process here in this repo. FYI, this can be easily implemented by using github action's ros-tooling/setup-ros.

rostest pushed a commit that referenced this issue Jun 30, 2022
@rostest rostest linked a pull request Jun 30, 2022 that will close this issue
rostest added a commit that referenced this issue Jun 30, 2022
@rostest
Copy link
Collaborator

rostest commented Jun 30, 2022

@youliangtan Thanks for reporting! Sorry, my fault. The error is fixed. Please checkout the latest version or the new release 2.7.4.

@youliangtan
Copy link
Contributor Author

Thanks for the fast fix, i managed to run it after this.

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 a pull request may close this issue.

2 participants