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

ROS2 Humble: Failed to build #58

Closed
grboguz21 opened this issue May 24, 2024 · 12 comments
Closed

ROS2 Humble: Failed to build #58

grboguz21 opened this issue May 24, 2024 · 12 comments

Comments

@grboguz21
Copy link

Hi,
I'm using Ubuntu 22.04 and ROS2 Humble. I'm following the steps below but can't build the humble branch:

git clone https://github.com/Fields2Cover/Fields2Cover.git
git clone https://github.com/open-navigation/opennav_coverage.git -b humble
colcon build --packages-select opennav_coverage opennav_coverage_demo opennav_coverage_msgs fields2cover

ros2 launch opennav_coverage_demo coverage_demo_launch.py

When I build the packages as above, I'm getting lots of error. The last part of the error is something like this:

gmake[2]: *** [CMakeFiles/opennav_coverage_core.dir/build.make:90: CMakeFiles/opennav_coverage_core.dir/src/headland_generator.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
gmake[2]: *** [CMakeFiles/opennav_coverage_core.dir/build.make:118: CMakeFiles/opennav_coverage_core.dir/src/route_generator.cpp.o] Error 1
gmake[2]: *** [CMakeFiles/opennav_coverage_core.dir/build.make:104: CMakeFiles/opennav_coverage_core.dir/src/swath_generator.cpp.o] Error 1
gmake[2]: *** [CMakeFiles/opennav_coverage_core.dir/build.make:146: CMakeFiles/opennav_coverage_core.dir/src/visualizer.cpp.o] Error 1
gmake[2]: *** [CMakeFiles/opennav_coverage_core.dir/build.make:132: CMakeFiles/opennav_coverage_core.dir/src/path_generator.cpp.o] Error 1
gmake[2]: *** [CMakeFiles/opennav_coverage_core.dir/build.make:76: CMakeFiles/opennav_coverage_core.dir/src/coverage_server.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:188: CMakeFiles/opennav_coverage_core.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
---
Failed   <<< opennav_coverage [13.1s, exited with code 2]

Summary: 2 packages finished [1min 8s]
  1 package failed: opennav_coverage
  2 packages had stderr output: fields2cover opennav_coverage
  1 package not processed

Error Message (whole message):

Screenshot from 2024-05-24 21-16-26

Thanks for your time !

@SteveMacenski
Copy link
Member

Its setup for F2C v1.X, not v2.X. Please clone v1's F2C tags :-)

@grboguz21
Copy link
Author

grboguz21 commented May 25, 2024

I replaced fields2cover package to v1.2.0 which is in this link: https://github.com/Fields2Cover/Fields2Cover/releases/tag/v1.2.0
but interestingly still getting same error:

gmake[2]: *** [CMakeFiles/opennav_coverage_core.dir/build.make:90: CMakeFiles/opennav_coverage_core.dir/src/headland_generator.cpp.o] Error 1
gmake[2]: *** [CMakeFiles/opennav_coverage_core.dir/build.make:132: CMakeFiles/opennav_coverage_core.dir/src/path_generator.cpp.o] Error 1
gmake[2]: *** [CMakeFiles/opennav_coverage_core.dir/build.make:76: CMakeFiles/opennav_coverage_core.dir/src/coverage_server.cpp.o] Error 1
gmake[2]: *** [CMakeFiles/opennav_coverage_core.dir/build.make:146: CMakeFiles/opennav_coverage_core.dir/src/visualizer.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:188: CMakeFiles/opennav_coverage_core.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
---
Failed   <<< opennav_coverage [16.1s, exited with code 2]
Aborted  <<< Fields2Cover [1min 5s]                                        

Summary: 1 package finished [1min 5s]
  1 package failed: opennav_coverage
  1 package aborted: Fields2Cover
  2 packages had stderr output: Fields2Cover opennav_coverage
  1 package not processed

Error Message (whole message):
Screenshot from 2024-05-25 17-09-38

@datnguyen2803
Copy link

Hi @grboguz21 ,
I faced the same issue and you need v1.2.1.

@grboguz21
Copy link
Author

grboguz21 commented May 27, 2024

I tried your method but unfortunately getting the almost same error message.
In order to help to find stabil installation process at least Humble users, I want to share my whole steps:

First of all, I created folders listed below:

cd ~
mkdir open_navigation_ws
mkdir open_navigation_ws/src
cd open_navigation_ws/src

and after that I downloaded packages using a bunch of commands below:

git clone https://github.com/Fields2Cover/Fields2Cover.git -b v1.2.1
git clone https://github.com/open-navigation/opennav_coverage.git -b humble

Finally, I got back to the main project folder and build the workspace:

cd ~/open_navigation_ws
colcon build --packages-select opennav_coverage opennav_coverage_demo opennav_coverage_msgs fields2cover

After building that, getting errors related to swath_generator.cpp and coverage_server.cpp:
Screenshot from 2024-05-27 09-13-21

Something interestingly was getting wrong.

@datnguyen2803
Copy link

datnguyen2803 commented May 27, 2024

Hi @grboguz21 ,
After cloning F2C v1.2.1, shouldn't you build and install that library first? I follow the guideline in F2C repo.
image
After that, "colcon build" opennav_coverage source
Ah, if you installed F2C before but with v2.x, I think you should uninstall first, by deleting all related directories in /usr or /opt

@grboguz21
Copy link
Author

grboguz21 commented May 28, 2024

First of all, thank you for your time.

I missed the point that installing and building library.
As you said, I deleted all files related directories in /usr or /opt.

After that, I got back to the main folder of Fields2Cover package which is ~/open_navigation_ws/src/Fields2Cover.
In this directory, I ran these commands:

mkdir -p build;
cd build;
cmake -DCMAKE_BUILD_TYPE=Release ..;
make -j$(nproc);
sudo make install;

After that, I wanted to test this library in Python first. In order to do that, I ran these commands below:

Screenshot from 2024-05-28 09-38-08

Everything was fine so far. As you see library is successfully installed:
Screenshot from 2024-05-28 09-46-26

But when I try to build with colcon it failed:
Screenshot from 2024-05-28 09-47-02

@emusman-lab
Copy link

Hi @grboguz21 Try these steps

first get the version fields2cover v1.2.1 frorm this link
https://github.com/Fields2Cover/Fields2Cover/releases/tag/v1.2.1
than extract and run the following commands as mentioned at https://github.com/Fields2Cover/Fields2Cover also
mkdir -p build; cd build; cmake -DCMAKE_BUILD_TYPE=Release ..; make -j$(nproc); sudo make install;

dont run "Compilation with python interface" comands yet which are
cd build; cmake -DBUILD_PYTHON=ON ..; make -j$(nproc); sudo make install;

now clone the repo from here

https://github.com/open-navigation/opennav_coverage.git

dont add anything else to the repo yet. now cd to the repo and run the following command

colcon build --base-paths src/ --symlink-install

it should compile now. if Iyou still face same error than attach the full colcon build error log as txt file so that we can have a detailed look at the error.

@SteveMacenski
Copy link
Member

Thanks for everyone jumping in here to help! Once we settle on the right tag version that folks agree is right (which I think v1.2.1 is right), I'll add that into the readme to clarify in the future. Maybe add some instructions.

@grboguz21
Copy link
Author

grboguz21 commented May 29, 2024

I finally solved it !
Your kind support save my life @emusman-lab, I would like to special thank to you.

Screenshot from 2024-05-29 08-23-42

Now, I'm going to create a clear installation steps of your awesome package for ROS2 Humble users and share here @SteveMacenski if you are considering using it for people looking for a solution.

Installation Steps:

This instruction is for Ubuntu 22.04 - ROS2 Humble users.

First of all, create folders listed below:

cd ~
mkdir open_navigation_ws
mkdir open_navigation_ws/src
cd open_navigation_ws/src

and after that download packages using a bunch of commands below:

git clone https://github.com/Fields2Cover/Fields2Cover.git -b v1.2.1
git clone https://github.com/open-navigation/opennav_coverage.git -b humble

Go to the main project folder of Fields2Cover and build the library:

cd ~/open_navigation_ws/src/Fields2Cover-1.2.1
mkdir -p build; 
cd build; cmake -DCMAKE_BUILD_TYPE=Release ..; 
make -j$(nproc); 
sudo make install;

Finally, get back to the main project folder, build & source the project and launch it:

cd ~/open_navigation_ws
colcon build --base-paths src/ --symlink-install
source install/setup.bash
ros2 launch opennav_coverage_demo coverage_demo_launch.py

I hope this will be helpful for everyone who are interested in this package.
If anyone faces errors in any step who looking for solution, don't hesitate to send to mail me: grboguz@gmail.com

@Marc-Morcos
Copy link
Contributor

Marc-Morcos commented Jun 14, 2024

I have the same error on iron,
here are the steps I used, but they dont work

source /opt/ros/iron/setup.bash
cd ~
mkdir open_navigation_ws
mkdir open_navigation_ws/src
cd open_navigation_ws/src

git clone https://github.com/Fields2Cover/Fields2Cover.git -b v1.2.1
git clone https://github.com/open-navigation/opennav_coverage.git -b iron

cd ~/open_navigation_ws/src/Fields2Cover
mkdir -p build; 
cd build; cmake -DCMAKE_BUILD_TYPE=Release ..; 
make -j$(nproc); 
sudo make install;

source /opt/ros/iron/setup.bash
cd ~/open_navigation_ws
colcon build --base-paths src/ --symlink-install
source install/setup.bash
ros2 launch opennav_coverage_demo coverage_demo_launch.py

@Marc-Morcos
Copy link
Contributor

Nevermind, I fixed it by removing anything related to fields2cover from my pc before reinstalling

@SteveMacenski
Copy link
Member

Closing, since this ticket covers that need to update the instructions since F2C v2.0 is API breaking, but thanks for the thread folks! #56

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

5 participants