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

catkin_make error Ubunto 20.04, Noetic, #1

Closed
MF-Ahmed opened this issue Jan 5, 2023 · 6 comments
Closed

catkin_make error Ubunto 20.04, Noetic, #1

MF-Ahmed opened this issue Jan 5, 2023 · 6 comments

Comments

@MF-Ahmed
Copy link

MF-Ahmed commented Jan 5, 2023

hello!
I am having the following error
98%] Building CXX object slam_karto_g2o/CMakeFiles/slam_karto_g2o.dir/src/slam_karto_g2o.cpp.o
[ 98%] Building CXX object slam_karto_g2o/CMakeFiles/slam_karto_g2o.dir/src/g2o_solver.cpp.o
/home/usr/data/ros1_ws/src/slam_karto_g2o/src/slam_karto_g2o.cpp: In member function ‘karto::LaserRangeFinder* SlamKartoG2o::getLaser(const ConstPtr&)’:
/home/usr/data/ros1_ws/src/slam_karto_g2o/src/slam_karto_g2o.cpp:412:37: error: catching polymorphic type ‘tf::TransformException’ {aka ‘class tf2::TransformException’} by value [-Werror=catch-value=]
412 | } catch (tf::TransformException e) {
| ^
/home/usr/data/ros1_ws/src/slam_karto_g2o/src/slam_karto_g2o.cpp: In member function ‘bool SlamKartoG2o::getOdomPose(karto::Pose2*, const ros::Time&)’:
/home/usr/data/ros1_ws/src/slam_karto_g2o/src/slam_karto_g2o.cpp:477:35: error: catching polymorphic type ‘tf::TransformException’ {aka ‘class tf2::TransformException’} by value [-Werror=catch-value=]
477 | } catch (tf::TransformException e) {
| ^
/home/usr/data/ros1_ws/src/slam_karto_g2o/src/slam_karto_g2o.cpp: In member function ‘bool SlamKartoG2o::addScan(karto::LaserRangeFinder*, const ConstPtr&, karto::Pose2*)’:
/home/usr/data/ros1_ws/src/slam_karto_g2o/src/slam_karto_g2o.cpp:638:37: error: catching polymorphic type ‘tf::TransformException’ {aka ‘class tf2::TransformException’} by value [-Werror=catch-value=]
638 | } catch (tf::TransformException e) {
| ^
cc1plus: all warnings being treated as errors
make[2]: *** [slam_karto_g2o/CMakeFiles/slam_karto_g2o.dir/build.make:63: slam_karto_g2o/CMakeFiles/slam_karto_g2o.dir/src/slam_karto_g2o.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:2425: slam_karto_g2o/CMakeFiles/slam_karto_g2o.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
Invoking "make -j20 -l20" failed

Thanks

@nkuwenjian
Copy link
Owner

Hi @MF-Ahmed
Thanks for pointing out this issue. I have fixed this bug.

Best,

Jian Wen

@MF-Ahmed MF-Ahmed reopened this Jan 26, 2023
@MF-Ahmed
Copy link
Author

Hi
Im now using catkin build and getting the following error, im not sure if its related to the previous one

Errors << slam_karto_g2o:make /home/usr/data/catkin_ws/logs/slam_karto_g2o/build.make.007.log
In file included from /opt/ros/noetic/include/open_karto/Mapper.h:25,
from /home/usr/data/catkin_ws/src/slam_karto_g2o/src/slam_karto_g2o.cpp:37:
/opt/ros/noetic/include/open_karto/Karto.h: In constructor ‘karto::LocalizedRangeScanWithPoints::LocalizedRangeScanWithPoints(const karto::Name&, const RangeReadingsVector&, const PointVectorDouble&)’:
/opt/ros/noetic/include/open_karto/Karto.h:5589:29: error: ‘karto::LocalizedRangeScanWithPoints::m_Points’ will be initialized after [-Werror=reorder]
5589 | const PointVectorDouble m_Points;
| ^~~~~~~~
/opt/ros/noetic/include/open_karto/Karto.h:5514:52: error: base ‘karto::LocalizedRangeScan’ [-Werror=reorder]
5514 | LocalizedRangeScan(rSensorName, rReadings)
| ^
/opt/ros/noetic/include/open_karto/Karto.h:5511:5: error: when initialized here [-Werror=reorder]
5511 | LocalizedRangeScanWithPoints(const Name& rSensorName, const RangeReadingsVector& rReadings,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/ros/noetic/include/open_karto/Karto.h: In destructor ‘virtual karto::OccupancyGrid::~OccupancyGrid()’:
/opt/ros/noetic/include/open_karto/Karto.h:5657:14: error: deleting object of polymorphic class type ‘karto::CellUpdater’ which has non-virtual destructor might cause undefined behavior [-Werror=delete-non-virtual-dtor]
5657 | delete m_pCellUpdater;
| ^~~~~~~~~~~~~~
In file included from /opt/ros/noetic/include/open_karto/Mapper.h:25,
from /home/usr/data/catkin_ws/src/slam_karto_g2o/include/slam_karto_g2o/g2o_solver.h:35,
from /home/usr/data/catkin_ws/src/slam_karto_g2o/src/g2o_solver.cpp:32:
/opt/ros/noetic/include/open_karto/Karto.h: In constructor ‘karto::LocalizedRangeScanWithPoints::LocalizedRangeScanWithPoints(const karto::Name&, const RangeReadingsVector&, const PointVectorDouble&)’:
/opt/ros/noetic/include/open_karto/Karto.h:5589:29: error: ‘karto::LocalizedRangeScanWithPoints::m_Points’ will be initialized after [-Werror=reorder]
5589 | const PointVectorDouble m_Points;
| ^~~~~~~~
/opt/ros/noetic/include/open_karto/Karto.h:5514:52: error: base ‘karto::LocalizedRangeScan’ [-Werror=reorder]
5514 | LocalizedRangeScan(rSensorName, rReadings)
| ^
/opt/ros/noetic/include/open_karto/Karto.h:5511:5: error: when initialized here [-Werror=reorder]
5511 | LocalizedRangeScanWithPoints(const Name& rSensorName, const RangeReadingsVector& rReadings,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/ros/noetic/include/open_karto/Karto.h: In destructor ‘virtual karto::OccupancyGrid::~OccupancyGrid()’:
/opt/ros/noetic/include/open_karto/Karto.h:5657:14: error: deleting object of polymorphic class type ‘karto::CellUpdater’ which has non-virtual destructor might cause undefined behavior [-Werror=delete-non-virtual-dtor]
5657 | delete m_pCellUpdater;
| ^~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[2]: *** [CMakeFiles/slam_karto_g2o.dir/build.make:63: CMakeFiles/slam_karto_g2o.dir/src/slam_karto_g2o.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
cc1plus: all warnings being treated as errors
make[2]: *** [CMakeFiles/slam_karto_g2o.dir/build.make:76: CMakeFiles/slam_karto_g2o.dir/src/g2o_solver.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1194: CMakeFiles/slam_karto_g2o.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
cd /home/usr/data/catkin_ws/build/slam_karto_g2o; catkin build --get-env slam_karto_g2o | catkin env -si /usr/bin/make --jobserver-auth=3,4; cd -

@nkuwenjian
Copy link
Owner

@MF-Ahmed
Hi, I have also encountered this problem. You need to download the source code of open karto from github and build it, instead of using binary installation.

This issue has been solved in the source code ros-perception/open_karto#24. However, the distribution of open karto in Noetic has not been updated.

@MF-Ahmed
Copy link
Author

Thanks,
I have successfully catkin built open_karto
git clone https://github.com/ros-perception/open_karto.git
and I have the above problem while building via catkin build from
git clone https://github.com/nkuwenjian/slam_karto_g2o.git
do I need to clone some specific branch?

@nkuwenjian
Copy link
Owner

@MF-Ahmed
Hi, both open_karto and slam_karto_g2o packages use the default branch, namely, the melodic-devel branch for both two packages. I have cloned and built successfully these two packages in Ubuntu 20.04 with ROS noetic. Maybe you need to remove the build and devel folders in the ROS workspace and recompile them.

@MF-Ahmed
Copy link
Author

I have managed to build it successfully, thanks a lot for your help.

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

2 participants