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

Compilation error while building SdfDemo #388

Open
antoan opened this issue Mar 21, 2023 · 0 comments
Open

Compilation error while building SdfDemo #388

antoan opened this issue Mar 21, 2023 · 0 comments
Labels
ros1 Affects ROS 1

Comments

@antoan
Copy link

antoan commented Mar 21, 2023

Setup: Ubuntu Focal 20.04, ROS 1 Noetic

I have installed grid_map grid_map_sdf. I compile the master branch with the following lines added to the demo package CmakeLists.txt

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

And I get the following build errors

/home/antoan/dev/autonomy_ws/src/litterbot_desktop/litterbot_gridmap/src/SdfDemo.cpp: In member function ‘void grid_map_demos::SdfDemo::callback(const GridMap&)’:
/home/antoan/dev/autonomy_ws/src/litterbot_desktop/litterbot_gridmap/src/SdfDemo.cpp:44:77: error: no matching function for call to ‘grid_map::SignedDistanceField::SignedDistanceField(grid_map::GridMap&, std::string&, const float&, const float&)’
   44 |   grid_map::SignedDistanceField sdf(map, elevationLayer_, minValue, maxValue);
      |                                                                             ^
In file included from /home/antoan/dev/autonomy_ws/src/litterbot_desktop/litterbot_gridmap/src/SdfDemo.cpp:14:
/opt/ros/noetic/include/grid_map_sdf/SignedDistanceField.hpp:24:3: note: candidate: ‘grid_map::SignedDistanceField::SignedDistanceField()’
   24 |   SignedDistanceField();
      |   ^~~~~~~~~~~~~~~~~~~
/opt/ros/noetic/include/grid_map_sdf/SignedDistanceField.hpp:24:3: note:   candidate expects 0 arguments, 4 provided
/opt/ros/noetic/include/grid_map_sdf/SignedDistanceField.hpp:21:7: note: candidate: ‘grid_map::SignedDistanceField::SignedDistanceField(const grid_map::SignedDistanceField&)’
   21 | class SignedDistanceField
      |       ^~~~~~~~~~~~~~~~~~~
/opt/ros/noetic/include/grid_map_sdf/SignedDistanceField.hpp:21:7: note:   candidate expects 1 argument, 4 provided
/home/antoan/dev/autonomy_ws/src/litterbot_desktop/litterbot_gridmap/src/SdfDemo.cpp:48:66: error: no matching function for call to ‘grid_map::GridMapRosConverter::toPointCloud(grid_map::SignedDistanceField&, sensor_msgs::PointCloud2&)’
   48 |   grid_map::GridMapRosConverter::toPointCloud(sdf, pointCloud2Msg);
      |                                                                  ^
In file included from /home/antoan/dev/autonomy_ws/src/litterbot_desktop/litterbot_gridmap/src/SdfDemo.cpp:13:
/opt/ros/noetic/include/grid_map_ros/GridMapRosConverter.hpp:91:15: note: candidate: ‘static void grid_map::GridMapRosConverter::toPointCloud(const grid_map::GridMap&, const string&, sensor_msgs::PointCloud2&)’
   91 |   static void toPointCloud(const grid_map::GridMap& gridMap,
      |               ^~~~~~~~~~~~
/opt/ros/noetic/include/grid_map_ros/GridMapRosConverter.hpp:91:15: note:   candidate expects 3 arguments, 2 provided
/opt/ros/noetic/include/grid_map_ros/GridMapRosConverter.hpp:104:15: note: candidate: ‘static void grid_map::GridMapRosConverter::toPointCloud(const grid_map::GridMap&, const std::vector<std::__cxx11::basic_string<char> >&, const string&, sensor_msgs::PointCloud2&)’
  104 |   static void toPointCloud(const grid_map::GridMap& gridMap,
      |               ^~~~~~~~~~~~
/opt/ros/noetic/include/grid_map_ros/GridMapRosConverter.hpp:104:15: note:   candidate expects 4 arguments, 2 provided
/home/antoan/dev/autonomy_ws/src/litterbot_desktop/litterbot_gridmap/src/SdfDemo.cpp:51:116: error: no matching function for call to ‘grid_map::GridMapRosConverter::toPointCloud(grid_map::SignedDistanceField&, sensor_msgs::PointCloud2&, int, grid_map_demos::SdfDemo::callback(const GridMap&)::<lambda(float)>)’
   51 |   grid_map::GridMapRosConverter::toPointCloud(sdf, pointCloud2Msg, 1, [](float sdfValue) { return sdfValue > 0.0; });
      |                                                                                                                    ^
In file included from /home/antoan/dev/autonomy_ws/src/litterbot_desktop/litterbot_gridmap/src/SdfDemo.cpp:13:
/opt/ros/noetic/include/grid_map_ros/GridMapRosConverter.hpp:91:15: note: candidate: ‘static void grid_map::GridMapRosConverter::toPointCloud(const grid_map::GridMap&, const string&, sensor_msgs::PointCloud2&)’
   91 |   static void toPointCloud(const grid_map::GridMap& gridMap,
      |               ^~~~~~~~~~~~
/opt/ros/noetic/include/grid_map_ros/GridMapRosConverter.hpp:91:15: note:   candidate expects 3 arguments, 4 provided
/opt/ros/noetic/include/grid_map_ros/GridMapRosConverter.hpp:104:15: note: candidate: ‘static void grid_map::GridMapRosConverter::toPointCloud(const grid_map::GridMap&, const std::vector<std::__cxx11::basic_string<char> >&, const string&, sensor_msgs::PointCloud2&)’
  104 |   static void toPointCloud(const grid_map::GridMap& gridMap,
      |               ^~~~~~~~~~~~
/opt/ros/noetic/include/grid_map_ros/GridMapRosConverter.hpp:104:53: note:   no known conversion for argument 1 from ‘grid_map::SignedDistanceField’ to ‘const grid_map::GridMap&’
  104 |   static void toPointCloud(const grid_map::GridMap& gridMap,
      |                            ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
/home/antoan/dev/autonomy_ws/src/litterbot_desktop/litterbot_gridmap/src/SdfDemo.cpp:54:117: error: no matching function for call to ‘grid_map::GridMapRosConverter::toPointCloud(grid_map::SignedDistanceField&, sensor_msgs::PointCloud2&, int, grid_map_demos::SdfDemo::callback(const GridMap&)::<lambda(float)>)’
   54 |   grid_map::GridMapRosConverter::toPointCloud(sdf, pointCloud2Msg, 1, [](float sdfValue) { return sdfValue <= 0.0; });
      |                                                                                                                     ^
In file included from /home/antoan/dev/autonomy_ws/src/litterbot_desktop/litterbot_gridmap/src/SdfDemo.cpp:13:
/opt/ros/noetic/include/grid_map_ros/GridMapRosConverter.hpp:91:15: note: candidate: ‘static void grid_map::GridMapRosConverter::toPointCloud(const grid_map::GridMap&, const string&, sensor_msgs::PointCloud2&)’
   91 |   static void toPointCloud(const grid_map::GridMap& gridMap,
      |               ^~~~~~~~~~~~
/opt/ros/noetic/include/grid_map_ros/GridMapRosConverter.hpp:91:15: note:   candidate expects 3 arguments, 4 provided
/opt/ros/noetic/include/grid_map_ros/GridMapRosConverter.hpp:104:15: note: candidate: ‘static void grid_map::GridMapRosConverter::toPointCloud(const grid_map::GridMap&, const std::vector<std::__cxx11::basic_string<char> >&, const string&, sensor_msgs::PointCloud2&)’
  104 |   static void toPointCloud(const grid_map::GridMap& gridMap,
      |               ^~~~~~~~~~~~
/opt/ros/noetic/include/grid_map_ros/GridMapRosConverter.hpp:104:53: note:   no known conversion for argument 1 from ‘grid_map::SignedDistanceField’ to ‘const grid_map::GridMap&’
  104 |   static void toPointCloud(const grid_map::GridMap& gridMap,

It is the only example I am unable to build from the demo package (which I really appreciate) I would be grateful for any advice on how to get past this.

Cheers,

Antoan

@Ryanf55 Ryanf55 added the ros1 Affects ROS 1 label Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ros1 Affects ROS 1
Projects
None yet
Development

No branches or pull requests

2 participants