RoboStack / ros-humble

Recipes for ROS 2 Humble Hawksbill
81 stars 32 forks source link

Enable nav2-related packages on Windows #178

Open traversaro opened 2 weeks ago

traversaro commented 2 weeks ago

Failure:

2024-04-30T15:58:42.7252805Z 
2024-04-30T15:58:42.7253142Z Applying patch: D:\a\ros-humble\ros-humble\patch\ros-humble-nav2-waypoint-follower.patch
2024-04-30T15:58:42.7253966Z Applying patch: D:\a\ros-humble\ros-humble\patch\ros-humble-nav2-waypoint-follower.patch with args:
2024-04-30T15:58:42.7255053Z ['-Np1', '-i', 'C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\tmp6pw8r2af\\ros-humble-nav2-waypoint-follower.patch.native', '--binary']
2024-04-30T15:58:42.7255810Z Traceback (most recent call last):
2024-04-30T15:58:42.7256382Z   File "C:\Users\runneradmin\micromamba\envs\testpr_env\Scripts\boa-script.py", line 10, in <module>
2024-04-30T15:58:42.7256944Z     sys.exit(main())
2024-04-30T15:58:42.7257173Z              ^^^^^^
2024-04-30T15:58:42.7257717Z   File "C:\Users\runneradmin\micromamba\envs\testpr_env\Lib\site-packages\boa\cli\boa.py", line 245, in main
2024-04-30T15:58:42.7258301Z     run_build(args)
2024-04-30T15:58:42.7258891Z   File "C:\Users\runneradmin\micromamba\envs\testpr_env\Lib\site-packages\boa\core\run_build.py", line 530, in run_build
2024-04-30T15:58:42.7259538Z     raise e
2024-04-30T15:58:42.7260089Z   File "C:\Users\runneradmin\micromamba\envs\testpr_env\Lib\site-packages\boa\core\run_build.py", line 512, in run_build
2024-04-30T15:58:42.7260736Z     build_recipe(
2024-04-30T15:58:42.7261340Z   File "C:\Users\runneradmin\micromamba\envs\testpr_env\Lib\site-packages\boa\core\run_build.py", line 290, in build_recipe
2024-04-30T15:58:42.7262092Z     download_source(MetaData(recipe_path, o0), interactive)
2024-04-30T15:58:42.7262835Z   File "C:\Users\runneradmin\micromamba\envs\testpr_env\Lib\site-packages\boa\core\build.py", line 614, in download_source
2024-04-30T15:58:42.7263519Z     _try_download(m, interactive)
2024-04-30T15:58:42.7264165Z   File "C:\Users\runneradmin\micromamba\envs\testpr_env\Lib\site-packages\boa\core\build.py", line 568, in _try_download
2024-04-30T15:58:42.7264806Z     source.provide(m)
2024-04-30T15:58:42.7265402Z   File "C:\Users\runneradmin\micromamba\envs\testpr_env\Lib\site-packages\conda_build\source.py", line 1124, in provide
2024-04-30T15:58:42.7266181Z     apply_one_patch(src_dir, metadata.path, patch, metadata.config, git)
2024-04-30T15:58:42.7266998Z   File "C:\Users\runneradmin\micromamba\envs\testpr_env\Lib\site-packages\conda_build\source.py", line 1013, in apply_one_patch
2024-04-30T15:58:42.7267672Z     raise exception
2024-04-30T15:58:42.7268284Z   File "C:\Users\runneradmin\micromamba\envs\testpr_env\Lib\site-packages\conda_build\source.py", line 1007, in apply_one_patch
2024-04-30T15:58:42.7268954Z     try_apply_patch(
2024-04-30T15:58:42.7269565Z   File "C:\Users\runneradmin\micromamba\envs\testpr_env\Lib\site-packages\conda_build\source.py", line 948, in try_apply_patch
2024-04-30T15:58:42.7270297Z     raise e
2024-04-30T15:58:42.7270891Z   File "C:\Users\runneradmin\micromamba\envs\testpr_env\Lib\site-packages\conda_build\source.py", line 942, in try_apply_patch
2024-04-30T15:58:42.7271551Z     check_call_env(
2024-04-30T15:58:42.7272152Z   File "C:\Users\runneradmin\micromamba\envs\testpr_env\Lib\site-packages\conda_build\utils.py", line 445, in check_call_env
2024-04-30T15:58:42.7272959Z     return _func_defaulting_env_to_os_environ("call", *popenargs, **kwargs)
2024-04-30T15:58:42.7273434Z            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-04-30T15:58:42.7275051Z   File "C:\Users\runneradmin\micromamba\envs\testpr_env\Lib\site-packages\conda_build\utils.py", line 436, in _func_defaulting_env_to_os_environ
2024-04-30T15:58:42.7275853Z     subprocess.check_call(_args, **kwargs)
2024-04-30T15:58:42.7276436Z   File "C:\Users\runneradmin\micromamba\envs\testpr_env\Lib\subprocess.py", line 413, in check_call
2024-04-30T15:58:42.7277030Z     raise CalledProcessError(retcode, cmd)
2024-04-30T15:58:42.7278649Z subprocess.CalledProcessError: Command '['C:\\Users\\runneradmin\\micromamba\\envs\\testpr_env\\Library\\usr\\bin\\patch.exe', '--no-backup-if-mismatch', '--batch', '-Np1', '-i', 'C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\tmp6pw8r2af\\ros-humble-nav2-waypoint-follower.patch.native', '--binary', '--dry-run']' returned non-zero exit status 1.
2024-04-30T15:58:42.8618377Z ##[error]Process completed with exit code 1.

I guess that the patch has a conflict with https://github.com/open-navigation/navigation2/pull/4051 , probably most of the patch is not needed anymore.

traversaro commented 2 weeks ago
2024-04-30T19:39:27.9675135Z           ]
2024-04-30T19:39:27.9680118Z %SRC_DIR%\ros-humble-nav2-waypoint-follower\src\work\plugins\input_at_waypoint.cpp(72): message : see reference to function template instantiation 'std::shared_ptr<rclcpp::Subscription<std_msgs::msg::Empty,std::allocator<void>,std_msgs::msg::Empty_<std::allocator<void>>,std_msgs::msg::Empty_<std::allocator<void>>,rclcpp::message_memory_strategy::MessageMemoryStrategy<ROSMessageT,AllocatorT>>> rclcpp_lifecycle::LifecycleNode::create_subscription<std_msgs::msg::Empty,std::_Binder<std::_Unforced,void (__cdecl nav2_waypoint_follower::InputAtWaypoint::* )(std::shared_ptr<std_msgs::msg::Empty_<std::allocator<void>>>),nav2_waypoint_follower::InputAtWaypoint *,const std::_Ph<1> &>,std::allocator<void>,rclcpp::Subscription<std_msgs::msg::Empty,AllocatorT,std_msgs::msg::Empty_<std::allocator<void>>,ROSMessageT,rclcpp::message_memory_strategy::MessageMemoryStrategy<ROSMessageT,AllocatorT>>,rclcpp::message_memory_strategy::MessageMemoryStrategy<ROSMessageT,AllocatorT>>(const std::string &,const rclcpp::QoS &,CallbackT &&,const rclcpp::SubscriptionOptionsWithAllocator<std::allocator<void>> &,std::shared_ptr<rclcpp::message_memory_strategy::MessageMemoryStrategy<ROSMessageT,AllocatorT>>)' being compiled [%SRC_DIR%\build\input_at_waypoint.vcxproj]
2024-04-30T19:39:27.9685277Z           with
2024-04-30T19:39:27.9685472Z           [
2024-04-30T19:39:27.9685781Z               ROSMessageT=std_msgs::msg::Empty_<std::allocator<void>>,
2024-04-30T19:39:27.9686211Z               AllocatorT=std::allocator<void>,
2024-04-30T19:39:27.9687217Z               CallbackT=std::_Binder<std::_Unforced,void (__cdecl nav2_waypoint_follower::InputAtWaypoint::* )(std::shared_ptr<std_msgs::msg::Empty_<std::allocator<void>>>),nav2_waypoint_follower::InputAtWaypoint *,const std::_Ph<1> &>
2024-04-30T19:39:27.9688168Z           ]
2024-04-30T19:39:27.9688369Z   Auto build dll exports
2024-04-30T19:39:27.9689645Z      Creating library C:/Users/runneradmin/micromamba/envs/testpr_env/conda-bld/ros-0_1714494666021/work/build/Release/input_at_waypoint.lib and object C:/Users/runneradmin/micromamba/envs/testpr_env/conda-bld/ros-0_1714494666021/work/build/Release/input_at_waypoint.exp
2024-04-30T19:39:27.9691277Z   input_at_waypoint.vcxproj -> %SRC_DIR%\build\Release\input_at_waypoint.dll
2024-04-30T19:39:27.9692297Z   Building Custom Rule C:/Users/runneradmin/micromamba/envs/testpr_env/conda-bld/ros-0_1714494666021/work/ros-humble-nav2-waypoint-follower/src/work/CMakeLists.txt
2024-04-30T19:39:27.9693392Z   Ignoring COMPILE_WARNING_AS_ERROR target property and CMAKE_COMPILE_WARNING_AS_ERROR variable.
2024-04-30T19:39:27.9693925Z   photo_at_waypoint.cpp
2024-04-30T19:39:27.9695139Z %SRC_DIR%\ros-humble-nav2-waypoint-follower\src\work\include\nav2_waypoint_follower/plugins/photo_at_waypoint.hpp(35,10): fatal error C1083: Cannot open include file: 'opencv4/opencv2/core.hpp': No such file or directory [%SRC_DIR%\build\photo_at_waypoint.vcxproj]

I removed too much of the patch.

traversaro commented 2 weeks ago

I removed too much of the patch.

Patch proposed upstream in https://github.com/open-navigation/navigation2/pull/4287 .

Tobias-Fischer commented 2 weeks ago

There are still some issues with the patch @traversaro

Tobias-Fischer commented 2 weeks ago

It now fails with

2024-05-03T04:23:50.6918446Z   Could NOT find CSparse (missing: CSPARSE_INCLUDE_DIR)
2024-05-03T04:23:50.6918881Z Call Stack (most recent call first):
2024-05-03T04:23:50.6920132Z   C:/Users/runneradmin/micromamba/envs/testpr_env/conda-bld/ros-0_1714698402507/_build_env/Library/share/cmake-3.29/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
2024-05-03T04:23:50.6921325Z   CMake/FindCSparse.cmake:24 (find_package_handle_standard_args)
2024-05-03T04:23:50.6921779Z   CMakeLists.txt:79 (find_package)

for slam-toolbox

@traversaro - there are a few other packages somewhere where I have patched this; do you need slam-toolbox or can we get away with just the nav2 packages?

traversaro commented 2 weeks ago

@traversaro - there are a few other packages somewhere where I have patched this; do you need slam-toolbox or can we get away with just the nav2 packages?

I do not have an hard requirement at the moment, I just added nav2-bringup as it is installed in nav2 tutorials: https://navigation.ros.org/development_guides/build_docs/index.html .

traversaro commented 2 weeks ago

Ok, the CMake issue is fixed by https://github.com/SteveMacenski/slam_toolbox/pull/699, but slam_toolbox on windows requires a bit of work for the reasons described in https://github.com/RoboStack/ros-humble/issues/133#issuecomment-2094302630 . I do not plan to work on this, so either we can close this or just build the packages that build fine (not sure which are, I guess at the moment nav2-bringup requires slam-toolbox).