Ask Your Question
1

ROS Gmapping

asked 2017-04-14 04:40:32 -0500

user_123 gravatar image

I have tried to modify the openslam sourcecode of GMapping algorithm. I have replaced the GridSlamProcessor class with GridSlamProcessor_Server class with the existing function as well as new methods. Now After running catkin_make I am getting several "undefined reference to..." error. The errors are like---

CMakeFiles/g_server.dir/src/slam_gmapping.cpp.o: In function `SlamGMapping::init()':
slam_gmapping.cpp:(.text+0x1196): undefined reference to `GMapping::GridSlamProcessor_Server::GridSlamProcessor_Server()'
CMakeFiles/g_server.dir/src/slam_gmapping.cpp.o: In function `SlamGMapping::startServer()':
slam_gmapping.cpp:(.text+0x33bc): undefined reference to `GMapping::GridSlamProcessor_Server::initServer(std::vector<unsigned int, std::allocator<unsigned int> >, unsigned int)'
CMakeFiles/g_server.dir/src/slam_gmapping.cpp.o: In function `SlamGMapping::initMapper(sensor_msgs::LaserScan_<std::allocator<void> > const&)':
slam_gmapping.cpp:(.text+0x63e9): undefined reference to 

`GMapping::GridSlamProcessor_Server::setSensorMap(std::map<std::string, GMapping::Sensor*, std::less<std::string>, std::allocator<std::pair<std::string const, GMapping::Sensor*> > > const&)'
slam_gmapping.cpp:(.text+0x67f6): undefined reference to `

GMapping::GridSlamProcessor_Server::setMatchingParameters(double, double, double, int, double, double, int, double, double, unsigned int)'
slam_gmapping.cpp:(.text+0x687d): undefined reference to `GMapping::GridSlamProcessor_Server::setMotionModelParameters(double, double, double, double)'
slam_gmapping.cpp:(.text+0x68ea): undefined reference to `GMapping::GridSlamProcessor_Server::setUpdateDistances(double, double, double)'
slam_gmapping.cpp:(.text+0x6a13): undefined reference to `GMapping::GridSlamProcessor_Server::init(unsigned int, double, double, double, double, double, GMapping::orientedpoint<double, double>)'
CMakeFiles/g_server.dir/src/slam_gmapping.cpp.o: In function `SlamGMapping::addScan(sensor_msgs::LaserScan_<std::allocator<void> > const&, GMapping::orientedpoint<double, double>&)':

slam_gmapping.cpp:(.text+0x78b4): undefined reference to `GMapping::GridSlamProcessor_Server::processScan(GMapping::RangeReading const&, int)'
CMakeFiles/g_server.dir/src/slam_gmapping.cpp.o: In function `SlamGMapping::laserCallback(boost::shared_ptr<sensor_msgs::LaserScan_<std::allocator<void> > const> const&)':
slam_gmapping.cpp:(.text+0x7bbb): undefined reference to `GMapping::GridSlamProcessor_Server::getBestParticleIndex() const'
CMakeFiles/g_server.dir/src/slam_gmapping.cpp.o: In function `SlamGMapping::updateMap(sensor_msgs::LaserScan_<std::allocator<void> > const&)':
slam_gmapping.cpp:(.text+0x89e4): undefined reference to `

GMapping::GridSlamProcessor_Server::getBestParticleIndex() 

const'
collect2: error: ld returned 1 exit status
make[2]: *** [/home/collab/catkin_ws/devel/lib/gmapping_server/g_server] Error 1
make[1]: *** [slam_gmapping/gmapping_server/CMakeFiles/g_server.dir/all] Error 2
make: *** [all] Error 2

Invoking "make -j12 -l12" failed

The result is something related to include statements..I am unable to debug it.Please help me.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-04-14 17:30:42 -0500

eugene.katsevman gravatar image

is your new class linked ? you'll have to modify CMakeLists.txt for that

edit flag offensive delete link more

Comments

There is no link for the classes in CMakelists.txt, actually both the existing and new classes are under same namespace, and in both the classes there are public methods having same name, I'm not sure whether those are creating troubles.

user_123 gravatar image user_123  ( 2017-04-17 03:54:02 -0500 )edit

If possible can you please tell me how to link the new class by editing CmakeLists.txt

user_123 gravatar image user_123  ( 2017-04-17 04:04:54 -0500 )edit

Sorry, can't write it here, but here is a link to cmake documentation on that matter : https://cmake.org/cmake/help/v3.0/com...

eugene.katsevman gravatar image eugene.katsevman  ( 2017-04-17 12:51:14 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-04-14 04:40:32 -0500

Seen: 545 times

Last updated: Apr 14 '17