malintha / multi_uav_simulator

A drone swarm simulator based on ROS (Robot Operating System).
GNU General Public License v3.0
144 stars 15 forks source link

Missing Waypoint.h file #11

Open surendhar091992 opened 2 years ago

surendhar091992 commented 2 years ago

While attempting the catkin_make as instructed by the document, it gives the fatal error of not having simulator_utils\Waypoint.h

malintha commented 2 years ago

Thanks for opening the issue. Did you managed to get it fixed?

surendhar091992 commented 2 years ago

No, i couldnt resolve it

malintha commented 2 years ago

Can you share the complete console output? :)

Qishunpeng commented 2 years ago

Can you share the complete console output? :)

origin_img_v2_4d296520-7894-490a-99d1-da938d086bfg origin_img_v2_780a3db0-17af-41ed-91fc-1477d9b3b53g

While attempting the catkin_make as instructed by the document, it gives the fatal error of not having simulator_utils\Waypoint.h

malintha commented 2 years ago

@Qishunpeng @surendhar091992 Could you try building the simulator_utils package separately and then the whole repo?

First, catkin build simulator_utils Then, catkin build

malintha commented 2 years ago

While attempting the catkin_make as instructed by the document, it gives the fatal error of not having simulator_utils\Waypoint.h

Try using catkin build instead of catkin_make

malintha commented 2 years ago

@Qishunpeng hope this has solved your issue.

wpower12 commented 1 year ago

In an attempt to get things working (i have an issue/question for installing this on Ubuntu 20,04 open), I switched to trying on a ubuntu-16.04/ros-kinetic installation. This got me further, but then I this exact issue; missing Waypoint.h file. When I run the suggested step of building the simulator_utils first, I get the following error;

Errors     << simulator_utils:make /home/vboxuser/Documents/catkin_ws/logs/simulator_utils/build.make.002.log                  
/home/vboxuser/Documents/catkin_ws/src/multi_uav_simulator/simulator_utils/src/Drone.cpp: In constructor ‘Drone::Drone(int, const ros::NodeHandle&)’:
/home/vboxuser/Documents/catkin_ws/src/multi_uav_simulator/simulator_utils/src/Drone.cpp:24:34: error: ‘to_string’ was not declared in this scope
     ss << "/robot_"<<to_string(id)<<"/current_state";
                                  ^
make[2]: *** [CMakeFiles/simulator_utils.dir/src/Drone.cpp.o] Error 1
make[1]: *** [CMakeFiles/simulator_utils.dir/all] Error 2
make: *** [all] Error 2
cd /home/vboxuser/Documents/catkin_ws/build/simulator_utils; catkin build --get-env simulator_utils | catkin env -si  /usr/bin/make --jobserver-fds=3,4 -j; cd -
malintha commented 1 year ago

I guess the problem is that it's trying to look for the message header whilst it is being built which is inside the same package. Typically, this goes away when you execute catkin build for the entire workspace for a second time. That is why it worked for you the next time. If you check within the devel/ and build/ spaces you should find Waypoint.h inside the simulator utils. But an ideal solution would be to separate the message source to a different package that would be built prior to the simulation_utils.

But the to_string() issue is new. This should work with c++ 11, may be Ubuntu 16.04 doesn't have it enabled by default? Can you check what your c++ version is and switch the compiler?

wpower12 commented 1 year ago

Currently on c++ --version 5.4.0 I ran some apt updates and a dist-upgrade and reinstalled build-essentials to be sure, and its def the most 'up to date' i can get through those sources.

Sorry for not having more to give you, and that I'm clogging up your issues. Just been chasing my tail on getting this, or any UAV sims up and running.

malintha commented 1 year ago

I just do not have a machine with kinetic with me; so this would be a good build test for Ubuntu 16.04/Kinetic. Are you still getting the to_string error? Can you try forcing it to use c++ 11 by uncommenting this line? https://github.com/malintha/multi_uav_simulator/blob/master/simulator_utils/CMakeLists.txt#L5 Use catkin build simulator_utils to build only the utils package.

However, I'd recommend using Ubuntu 20.04 + Noetic, that's the one I have tested this on. Referring to your previous bug (https://github.com/malintha/multi_uav_simulator/issues/14) on Noetic, did you get that one on a clean catkin_ws?

malintha commented 1 year ago

@wpower12 Alright. I did a bit of searching and apparently to_string issue is a known bug in GCC 5.4 on Ubuntu. So it won't compile without a workaround to the code (adding D_GLIBCXX_USE_C99 to the CMakeLists.txt). https://bugs.launchpad.net/ubuntu/+source/gcc-5/+bug/1739778

If it is the "newest" you get on Ubuntu 16.04, I would recommend you to switch to Ubuntu 20.04. So we can focus on solving https://github.com/malintha/multi_uav_simulator/issues/14.

matteovidali commented 1 year ago

I experienced this issue as well, and the solution of first running catkin build simulation_utils, and then catkin build seemed to solve this build issue for me (Ubuntu 20.04.5 with kernel 5.15.0-67-generic)