Open rahulgupta582 opened 2 years ago
Hi! I was having the same issue.
I followed:
Below are my steps. I'm not sure all of them are needed but it did work for me: I hope it helps.
#include <GeographicLib/MGRS.hpp>
and #include <GeographicLib/UTMUPS.hpp>
for the path installed in 1st Step:
#include "/**_your_path_**/geographiclib/include/GeographicLib/MGRS.hpp"
#include "/**_your_path_**/geographiclib/include/GeographicLib/UTMUPS.hpp"
#include <robot_localization/navsat_conversions.h>
to #include "/**_your_path_**/catkin_ws/src/robot_localization/include/robot_localization/navsat_conversions.h"
#include "/**_your_path_**/geographiclib/include/GeographicLib/MGRS.hpp"
#include "/**_your_path_**/geographiclib/include/GeographicLib/UTMUPS.hpp"
root1@root1-GP65-Leopard-9SD:~/workspace_test$ catkin_make Base path: /home/root1/workspace_test Source space: /home/root1/workspace_test/src Build space: /home/root1/workspace_test/build Devel space: /home/root1/workspace_test/devel Install space: /home/root1/workspace_test/install
Running command: "make cmake_check_build_system" in "/home/root1/workspace_test/build"
Running command: "make -j12 -l12" in "/home/root1/workspace_test/build"
Scanning dependencies of target gps_waypoint [ 0%] Built target nav_msgs_generate_messages_nodejs [ 4%] Built target calibrate_heading [ 4%] Built target _catkin_empty_exported_target [ 9%] Built target safety_node [ 13%] Built target collect_gps_waypoints [ 16%] Linking CXX executable /home/root1/workspace_test/devel/lib/outdoor_waypoint_nav/plot_gps_waypoints [ 18%] Linking CXX executable /home/root1/workspace_test/devel/lib/outdoor_waypoint_nav/gps_waypoint_continuous2 [ 20%] Linking CXX executable /home/root1/workspace_test/devel/lib/outdoor_waypoint_nav/gps_waypoint_mapping [ 23%] Linking CXX executable /home/root1/workspace_test/devel/lib/outdoor_waypoint_nav/gps_waypoint_continuous1 [ 25%] Building CXX object waypoint_nav/outdoor_waypoint_nav/CMakeFiles/gps_waypoint.dir/src/gps_waypoint.cpp.o [ 30%] Built target switch_controllers [ 37%] Built target slam_gmapping_nodelet [ 37%] Built target tf2_msgs_generate_messages_nodejs [ 37%] Built target tf2_msgs_generate_messages_lisp [ 37%] Built target tf2_msgs_generate_messages_py [ 37%] Built target tf2_msgs_generate_messages_eus [ 37%] Built target tf2_msgs_generate_messages_cpp [ 37%] Built target actionlib_msgs_generate_messages_py [ 37%] Built target actionlib_msgs_generate_messages_nodejs [ 37%] Built target actionlib_msgs_generate_messages_eus [ 37%] Built target std_msgs_generate_messages_py [ 37%] Built target std_msgs_generate_messages_nodejs [ 37%] Built target std_msgs_generate_messages_eus [ 37%] Built target actionlib_msgs_generate_messages_lisp [ 37%] Built target rosgraph_msgs_generate_messages_py [ 37%] Built target rosgraph_msgs_generate_messages_nodejs [ 37%] Built target std_msgs_generate_messages_cpp [ 37%] Built target tf_generate_messages_cpp [ 37%] Built target sensor_msgs_generate_messages_eus [ 37%] Built target std_msgs_generate_messages_lisp [ 37%] Built target rosgraph_msgs_generate_messages_lisp [ 37%] Built target sensor_msgs_generate_messages_cpp [ 37%] Built target rosgraph_msgs_generate_messages_eus [ 37%] Built target tf_generate_messages_eus [ 37%] Built target actionlib_msgs_generate_messages_cpp [ 37%] Built target rosgraph_msgs_generate_messages_cpp [ 37%] Built target tf_generate_messages_lisp [ 37%] Built target roscpp_generate_messages_lisp [ 37%] Built target roscpp_generate_messages_py [ 37%] Built target geometry_msgs_generate_messages_nodejs [ 37%] Built target roscpp_generate_messages_eus [ 37%] Built target roscpp_generate_messages_nodejs [ 37%] Built target tf_generate_messages_nodejs [ 37%] Built target geometry_msgs_generate_messages_eus [ 37%] Built target geometry_msgs_generate_messages_cpp [ 37%] Built target geometry_msgs_generate_messages_lisp [ 37%] Built target geometry_msgs_generate_messages_py [ 37%] Built target actionlib_generate_messages_cpp [ 37%] Built target roscpp_generate_messages_cpp [ 37%] Built target sensor_msgs_generate_messages_lisp [ 37%] Built target sensor_msgs_generate_messages_nodejs [ 37%] Built target tf_generate_messages_py [ 37%] Built target actionlib_generate_messages_eus [ 37%] Built target sensor_msgs_generate_messages_py [ 37%] Built target actionlib_generate_messages_lisp [ 37%] Built target actionlib_generate_messages_py [ 37%] Built target actionlib_generate_messages_nodejs [ 37%] Built target nav_msgs_generate_messages_eus [ 37%] Built target nav_msgs_generate_messages_lisp [ 37%] Built target nav_msgs_generate_messages_cpp [ 37%] Built target nav_msgs_generate_messages_py CMakeFiles/plot_gps_waypoints.dir/src/plot_gps_waypoints.cpp.o: In function, std::allocator >&, double&)':
gps_waypoint_mapping.cpp:(.text+0x64): undefined reference to cxx11::basic_string<char, std::char_traits, std::allocator >&)'
collect2: error: ld returned 1 exit status
waypoint_nav/outdoor_waypoint_nav/CMakeFiles/gps_waypoint_mapping.dir/build.make:122: recipe for target '/home/root1/workspace_test/devel/lib/outdoor_waypoint_nav/gps_waypoint_mapping' failed
make[2]: [/home/root1/workspace_test/devel/lib/outdoor_waypoint_nav/gps_waypoint_mapping] Error 1
CMakeFiles/Makefile2:2361: recipe for target 'waypoint_nav/outdoor_waypoint_nav/CMakeFiles/gps_waypoint_mapping.dir/all' failed
make[1]: [waypoint_nav/outdoor_waypoint_nav/CMakeFiles/gps_waypoint_mapping.dir/all] Error 2
CMakeFiles/gps_waypoint_continuous2.dir/src/gps_waypoint_continuous2.cpp.o: In function , std::allocator >&, double&)':
gps_waypoint_continuous1.cpp:(.text+0x64): undefined reference to cxx11::basic_string<char, std::char_traits, std::allocator >&)'
collect2: error: ld returned 1 exit status
waypoint_nav/outdoor_waypoint_nav/CMakeFiles/gps_waypoint_continuous2.dir/build.make:122: recipe for target '/home/root1/workspace_test/devel/lib/outdoor_waypoint_nav/gps_waypoint_continuous2' failed
make[2]: [/home/root1/workspace_test/devel/lib/outdoor_waypoint_nav/gps_waypoint_continuous2] Error 1
CMakeFiles/Makefile2:1225: recipe for target 'waypoint_nav/outdoor_waypoint_nav/CMakeFiles/gps_waypoint_continuous2.dir/all' failed
make[1]: [waypoint_nav/outdoor_waypoint_nav/CMakeFiles/gps_waypoint_continuous2.dir/all] Error 2
waypoint_nav/outdoor_waypoint_nav/CMakeFiles/gps_waypoint_continuous1.dir/build.make:122: recipe for target '/home/root1/workspace_test/devel/lib/outdoor_waypoint_nav/gps_waypoint_continuous1' failed
make[2]: [/home/root1/workspace_test/devel/lib/outdoor_waypoint_nav/gps_waypoint_continuous1] Error 1
CMakeFiles/Makefile2:1262: recipe for target 'waypoint_nav/outdoor_waypoint_nav/CMakeFiles/gps_waypoint_continuous1.dir/all' failed
make[1]: [waypoint_nav/outdoor_waypoint_nav/CMakeFiles/gps_waypoint_continuous1.dir/all] Error 2
[ 53%] Linking CXX executable /home/root1/workspace_test/devel/lib/outdoor_waypoint_nav/gps_waypoint
CMakeFiles/gps_waypoint.dir/src/gps_waypoint.cpp.o: In function , std::allocator >&)'
collect2: error: ld returned 1 exit status
waypoint_nav/outdoor_waypoint_nav/CMakeFiles/gps_waypoint.dir/build.make:122: recipe for target '/home/root1/workspace_test/devel/lib/outdoor_waypoint_nav/gps_waypoint' failed
make[2]: [/home/root1/workspace_test/devel/lib/outdoor_waypoint_nav/gps_waypoint] Error 1
CMakeFiles/Makefile2:2558: recipe for target 'waypoint_nav/outdoor_waypoint_nav/CMakeFiles/gps_waypoint.dir/all' failed
make[1]: [waypoint_nav/outdoor_waypoint_nav/CMakeFiles/gps_waypoint.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j12 -l12" failed
RobotLocalization::NavsatConversions::LLtoUTM(double, double, double&, double&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, double&)': plot_gps_waypoints.cpp:(.text+0x64): undefined reference to
GeographicLib::UTMUPS::Forward(double, double, int&, bool&, double&, double&, double&, double&, int, bool)' plot_gps_waypoints.cpp:(.text+0xa1): undefined reference toGeographicLib::MGRS::Forward(int, bool, double, double, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)' collect2: error: ld returned 1 exit status waypoint_nav/outdoor_waypoint_nav/CMakeFiles/plot_gps_waypoints.dir/build.make:122: recipe for target '/home/root1/workspace_test/devel/lib/outdoor_waypoint_nav/plot_gps_waypoints' failed make[2]: *** [/home/root1/workspace_test/devel/lib/outdoor_waypoint_nav/plot_gps_waypoints] Error 1 CMakeFiles/Makefile2:1151: recipe for target 'waypoint_nav/outdoor_waypoint_nav/CMakeFiles/plot_gps_waypoints.dir/all' failed make[1]: *** [waypoint_nav/outdoor_waypoint_nav/CMakeFiles/plot_gps_waypoints.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... [ 44%] Built target slam_gmapping_replay [ 51%] Built target slam_gmapping [ 51%] Built target _hector_mapping_nav_generate_messages_check_deps_HectorDebugInfo [ 51%] Built target _hector_mapping_nav_generate_messages_check_deps_HectorIterData CMakeFiles/gps_waypoint_mapping.dir/src/gps_waypoint_mapping.cpp.o: In function
RobotLocalization::NavsatConversions::LLtoUTM(double, double, double&, double&, std::cxx11::basic_string<char, std::char_traitsGeographicLib::UTMUPS::Forward(double, double, int&, bool&, double&, double&, double&, double&, int, bool)' gps_waypoint_mapping.cpp:(.text+0xa1): undefined reference to
GeographicLib::MGRS::Forward(int, bool, double, double, int, std::RobotLocalization::NavsatConversions::LLtoUTM(double, double, double&, double&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, double&)': gps_waypoint_continuous2.cpp:(.text+0x64): undefined reference to
GeographicLib::UTMUPS::Forward(double, double, int&, bool&, double&, double&, double&, double&, int, bool)' gps_waypoint_continuous2.cpp:(.text+0xa1): undefined reference toGeographicLib::MGRS::Forward(int, bool, double, double, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)' collect2: error: ld returned 1 exit status CMakeFiles/gps_waypoint_continuous1.dir/src/gps_waypoint_continuous1.cpp.o: In function
RobotLocalization::NavsatConversions::LLtoUTM(double, double, double&, double&, std::cxx11::basic_string<char, std::char_traitsGeographicLib::UTMUPS::Forward(double, double, int&, bool&, double&, double&, double&, double&, int, bool)' gps_waypoint_continuous1.cpp:(.text+0xa1): undefined reference to
GeographicLib::MGRS::Forward(int, bool, double, double, int, std::RobotLocalization::NavsatConversions::LLtoUTM(double, double, double&, double&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, double&)': gps_waypoint.cpp:(.text+0x64): undefined reference to
GeographicLib::UTMUPS::Forward(double, double, int&, bool&, double&, double&, double&, double&, int, bool)' gps_waypoint.cpp:(.text+0xa1): undefined reference to `GeographicLib::MGRS::Forward(int, bool, double, double, int, std::__cxx11::basic_string<char, std::char_traits