open-navigation / opennav_coverage

Nav2 Compatible Complete Cover Task Server, Navigator, & BT Utils
Apache License 2.0
107 stars 28 forks source link

ROS2 Iron Wont build #60

Closed Marc-Morcos closed 2 months ago

Marc-Morcos commented 2 months ago

When I run colcon build, I get the following (I cut it off since it is extremely long

Running Ubuntu 22.04 with Ros2 Iron. Fields2Cover is properly installed

colcon build Starting >>> opennav_coverage_msgs Finished <<< opennav_coverage_msgs [0.68s] Starting >>> opennav_coverage Starting >>> opennav_coverage_bt Finished <<< opennav_coverage_bt [0.15s] --- stderr: opennav_coverage In file included from /home/marc/Documents/opennav_coverage/opennav_coverage/include/opennav_coverage/visualizer.hpp:25, from /home/marc/Documents/opennav_coverage/opennav_coverage/src/visualizer.cpp:19: /home/marc/Documents/opennav_coverage/opennav_coverage/include/opennav_coverage/utils.hpp: In function ‘opennav_coverage_msgs::msg::PathComponents opennav_coverage::util::toCoveragePathMsg(const Path&, const F2CField&, const Header&, bool)’: /home/marc/Documents/opennav_coverage/opennav_coverage/include/opennav_coverage/utils.hpp:131:16: error: ‘const Path’ {aka ‘const struct f2c::types::Path’} has no member named ‘states’; did you mean ‘std::vector<f2c::types::PathState> f2c::types::Path::states_’? (not accessible from this context) 131 | if (raw_path.states.size() == 0) {

SteveMacenski commented 2 months ago

Compile with a v1 version of F2C. See https://github.com/open-navigation/opennav_coverage/issues/58 & check the issue tracker before filing please!

Marc-Morcos commented 2 months ago

I had already seen that this only works with v1, but even with v1 I get the same error n file included from /home/marc/open_navigation_ws/src/opennav_coverage/opennav_coverage/include/opennav_coverage/visualizer.hpp:25, from /home/marc/open_navigation_ws/src/opennav_coverage/opennav_coverage/src/visualizer.cpp:19: /home/marc/open_navigation_ws/src/opennav_coverage/opennav_coverage/include/opennav_coverage/utils.hpp: In function ‘opennav_coverage_msgs::msg::PathComponents opennav_coverage::util::toCoveragePathMsg(const Path&, const F2CField&, const Header&, bool)’: /home/marc/open_navigation_ws/src/opennav_coverage/opennav_coverage/include/opennav_coverage/utils.hpp:131:16: error: ‘const Path’ {aka ‘const struct f2c::types::Path’} has no member named ‘states’; did you mean ‘std::vector<f2c::types::PathState> f2c::types::Path::states_’? (not accessible from this context) 131 | if (raw_path.states.size() == 0) {

Marc-Morcos commented 2 months ago

Here are my steps if you want to reproduce @SteveMacenski


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/src/Fields2Cover
colcon build --symlink-install
cd ~/open_navigation_ws/src/opennav_coverage/
colcon build --symlink-install
source install/setup.bash
ros2 launch opennav_coverage_demo coverage_demo_launch.py
Marc-Morcos commented 2 months ago

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