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

I build this on Ubuntu20.04 ROS noetic, and get error... #39

Open
fengyikawhi opened this issue Feb 15, 2022 · 4 comments
Open

I build this on Ubuntu20.04 ROS noetic, and get error... #39

fengyikawhi opened this issue Feb 15, 2022 · 4 comments

Comments

@fengyikawhi
Copy link

error: no type named ‘Parameters’ in ‘class ceres::internal::ParameterDims<false, 5>’
315 | using Parameters = typename ParameterDims::Parameters;
| ^~~~~~~~~~
/home/slam/cartographer_ws/install_isolated/include/ceres/internal/autodiff.h:348:47: error: no type named ‘Parameters’ in ‘class ceres::internal::ParameterDims<false, 5>’
348 | Make1stOrderPerturbations::Apply(parameters,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
349 | parameters_as_jets.data());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/slam/cartographer_ws/install_isolated/include/ceres/internal/autodiff.h:357:39: error: no type named ‘Parameters’ in ‘class ceres::internal::ParameterDims<false, 5>’
357 | Take1stOrderParts::Apply(
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
358 | num_outputs, residuals_as_jets.data(), jacobians);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@DreamWaterFound
Copy link

Maybe you need to compile with the correct version like 2.0.0 of Ceres-solver.

@fengyikawhi
Copy link
Author

Maybe you need to compile with the correct version like 2.0.0 of Ceres-solver.

I have installed Ceres2.0.0 when build cartographer, but it was in the workspace of cartographer, does it matter?

@DreamWaterFound
Copy link

Maybe you need to compile with the correct version like 2.0.0 of Ceres-solver.

I have installed Ceres2.0.0 when build cartographer, but it was in the workspace of cartographer, does it matter?

Yes, in your case the compiler will only compile imu_utils with ceres-solver in the default path.

There are 2 ways to solve this problem:

  1. To complie and install ceres-slover in the same ROS workspace with imu_utils;
  2. Specify the path where ceres-solver 2.0 installed in CMakeLists.txt(Suggested methods). You can locate CeresConfig.cmake using command locate:
$ sudo updatedb
$ locate CeresConfig.cmake

Find the installation path for Ceres-Solver 2.0, like /home/robot/Libraries/Install/Ceres/2.0.0/lib/cmake/Ceres/CeresConfig.cmake.
Then add following line in CMakeLists.txt:

...

find_package(OpenCV REQUIRED)

# HACK add here
# HACK begin
set(Ceres_DIR "/home/robot/Libraries/Install/Ceres/2.0.0/lib/cmake/Ceres/CeresConfig.cmake")
# HACK end

find_package(Ceres REQUIRED)

find_package(Eigen3  REQUIRED)

Be sure clean folders build and devel in this ROS worksapce and then re-build it by catkin_make. In this way gcc/g++ will use you specified ceres-solver.

@Hezhexi2002
Copy link

Hi,I meet the same problem but the error still exits after I follow your second way to solve the problem:
image
I install the ceres under my /opt and here is the output of my locate CeresConfig.cmake:
image
and I have add set the path of ceres in the CMakeLists.txt:
image
so why dose it not work and is this means I have to re-compile the ceres under my ros workspace?

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

No branches or pull requests

3 participants