BehaviorTree / BehaviorTree.ROS2

BehaviorTree.CPP utilities to work with ROS2
Apache License 2.0
163 stars 68 forks source link

colcon build error #82

Open pipinet opened 4 months ago

pipinet commented 4 months ago

i import BehaviorTree.ROS2 as submodule. directory structure is

xxxx_ws
    dependencies
        BehaviorTree.CPP
        BehaviorTree.ROS2
    src
       package1
       package2
   colcon.pkg 
   pixi.toml

colcon.pkg

{
    "build": {
        "base-paths": ["src", "dependencies/BehaviorTree.CPP", "dependencies/BehaviorTree.ROS2"],
        "packages-skip": ["btcpp_ros2_samples"]
    }
}

use flow command will got error.

pixi shell

colcon build --symlink-install --cmake-args -DPython3_FIND_VIRTUALENV=ONLY
Starting >>> behaviortree_ros2
-- Found ament_cmake: 1.3.7 (/Users/pipinet/workspace/automation/.pixi/envs/default/share/ament_cmake/cmake)
-- Override CMake install command with custom implementation using symlinks instead of copying resources
-- Found rclcpp: 16.0.8 (/Users/pipinet/workspace/automation/.pixi/envs/default/share/rclcpp/cmake)
-- Found rosidl_generator_c: 3.1.5 (/Users/pipinet/workspace/automation/.pixi/envs/default/share/rosidl_generator_c/cmake)
-- Found rosidl_adapter: 3.1.5 (/Users/pipinet/workspace/automation/.pixi/envs/default/share/rosidl_adapter/cmake)
-- Found rosidl_generator_cpp: 3.1.5 (/Users/pipinet/workspace/automation/.pixi/envs/default/share/rosidl_generator_cpp/cmake)
-- Using all available rosidl_typesupport_c: rosidl_typesupport_fastrtps_c;rosidl_typesupport_introspection_c
-- Using all available rosidl_typesupport_cpp: rosidl_typesupport_fastrtps_cpp;rosidl_typesupport_introspection_cpp
-- Found rmw_implementation_cmake: 6.1.1 (/Users/pipinet/workspace/automation/.pixi/envs/default/share/rmw_implementation_cmake/cmake)
-- Found rmw_cyclonedds_cpp: 1.3.4 (/Users/pipinet/workspace/automation/.pixi/envs/default/share/rmw_cyclonedds_cpp/cmake)
-- Using RMW implementation 'rmw_cyclonedds_cpp' as default
-- Found rclcpp_action: 16.0.8 (/Users/pipinet/workspace/automation/.pixi/envs/default/share/rclcpp_action/cmake)
-- Found behaviortree_cpp: 4.6.0 (/Users/pipinet/workspace/automation/install/behaviortree_cpp/share/behaviortree_cpp/cmake)
-- Found btcpp_ros2_interfaces: 0.2.0 (/Users/pipinet/workspace/automation/install/btcpp_ros2_interfaces/share/btcpp_ros2_interfaces/cmake)
-- Found generate_parameter_library: 0.3.7 (/Users/pipinet/workspace/automation/.pixi/envs/default/share/generate_parameter_library/cmake)
-- Found parameter_traits: 0.3.7 (/Users/pipinet/workspace/automation/.pixi/envs/default/share/parameter_traits/cmake)
-- Found rclcpp_lifecycle: 16.0.8 (/Users/pipinet/workspace/automation/.pixi/envs/default/share/rclcpp_lifecycle/cmake)
-- Configuring done (2.2s)
-- Generating done (0.1s)
-- Build files have been written to: /Users/pipinet/workspace/automation/build/behaviortree_ros2
[ 20%] Running `/Users/pipinet/workspace/automation/.pixi/envs/default/bin/generate_parameter_library_cpp /Users/pipinet/workspace/automation/build/behaviortree_ros2/bt_executor_parameters/include//bt_executor_parameters.hpp /Users/pipinet/workspace/automation/dependencies/BehaviorTree.ROS2/behaviortree_ros2/src/bt_executor_parameters.yaml `
[ 20%] Built target bt_executor_parameters
[ 40%] Building CXX object CMakeFiles/behaviortree_ros2.dir/src/bt_ros2.cpp.o
[ 60%] Building CXX object CMakeFiles/behaviortree_ros2.dir/src/bt_utils.cpp.o
[ 80%] Building CXX object CMakeFiles/behaviortree_ros2.dir/src/tree_execution_server.cpp.o
/Users/pipinet/workspace/automation/dependencies/BehaviorTree.ROS2/behaviortree_ros2/src/tree_execution_server.cpp:206:28: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
      RCLCPP_WARN(kLogger, action_result->return_message.c_str());
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/pipinet/workspace/automation/.pixi/envs/default/include/rclcpp/rclcpp/logging.hpp:972:7: note: expanded from macro 'RCLCPP_WARN'
      __VA_ARGS__); \
      ^~~~~~~~~~~
/Users/pipinet/workspace/automation/.pixi/envs/default/include/rcutils/rcutils/logging_macros.h:750:5: note: expanded from macro 'RCUTILS_LOG_WARN_NAMED'
    __VA_ARGS__)
    ^~~~~~~~~~~
/Users/pipinet/workspace/automation/.pixi/envs/default/include/rcutils/rcutils/logging_macros.h:72:64: note: expanded from macro 'RCUTILS_LOG_COND_NAMED'
      rcutils_log(&__rcutils_logging_location, severity, name, __VA_ARGS__); \
                                                               ^~~~~~~~~~~
/Users/pipinet/workspace/automation/dependencies/BehaviorTree.ROS2/behaviortree_ros2/src/tree_execution_server.cpp:206:28: note: treat the string as an argument to avoid this
      RCLCPP_WARN(kLogger, action_result->return_message.c_str());
                           ^
                           "%s",
/Users/pipinet/workspace/automation/.pixi/envs/default/include/rclcpp/rclcpp/logging.hpp:972:7: note: expanded from macro 'RCLCPP_WARN'
      __VA_ARGS__); \
      ^
/Users/pipinet/workspace/automation/.pixi/envs/default/include/rcutils/rcutils/logging_macros.h:750:5: note: expanded from macro 'RCUTILS_LOG_WARN_NAMED'
    __VA_ARGS__)
    ^
/Users/pipinet/workspace/automation/.pixi/envs/default/include/rcutils/rcutils/logging_macros.h:72:64: note: expanded from macro 'RCUTILS_LOG_COND_NAMED'
      rcutils_log(&__rcutils_logging_location, severity, name, __VA_ARGS__); \
                                                               ^
/Users/pipinet/workspace/automation/dependencies/BehaviorTree.ROS2/behaviortree_ros2/src/tree_execution_server.cpp:238:24: error: no viable conversion from 'duration<[...], ratio<[...], __static_lcm<ratio<1, 1000000000>::den, ratio<1, 1000000000>::den>::value aka 1000000000>>' to 'duration<[...], ratio<[...], 1000000>>'
        p_->tree.sleep(loop_deadline - now);
                       ^~~~~~~~~~~~~~~~~~~
/Users/pipinet/workspace/automation/.pixi/envs/default/bin/../include/c++/v1/__chrono/duration.h:204:28: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'typename common_type<duration<long long, ratio<1, 1000000000>>, duration<long long, ratio<1, 1000000000>>>::type' (aka 'duration<long long, ratio<__static_gcd<ratio<1, 1000000000>::num, ratio<1, 1000000000>::num>::value, __static_lcm<ratio<1, 1000000000>::den, ratio<1, 1000000000>::den>::value>>') to 'const duration<long long, ratio<1, 1000000>> &' for 1st argument
class _LIBCPP_TEMPLATE_VIS duration
                           ^
/Users/pipinet/workspace/automation/.pixi/envs/default/bin/../include/c++/v1/__chrono/duration.h:204:28: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'typename common_type<duration<long long, ratio<1, 1000000000>>, duration<long long, ratio<1, 1000000000>>>::type' (aka 'duration<long long, ratio<__static_gcd<ratio<1, 1000000000>::num, ratio<1, 1000000000>::num>::value, __static_lcm<ratio<1, 1000000000>::den, ratio<1, 1000000000>::den>::value>>') to 'duration<long long, ratio<1, 1000000>> &&' for 1st argument
/Users/pipinet/workspace/automation/.pixi/envs/default/bin/../include/c++/v1/__chrono/duration.h:267:9: note: candidate template ignored: requirement 'treat_as_floating_point<long long>::value || (__no_overflow<ratio<1, 1000000000>, ratio<1, 1000000>>::ratio<1, 1000>::den == 1 && !treat_as_floating_point<long long>::value)' was not satisfied [with _Rep2 = long long, _Period2 = std::ratio<1, 1000000000>]
        duration(const duration<_Rep2, _Period2>& __d,
        ^
/Users/pipinet/workspace/automation/.pixi/envs/default/bin/../include/c++/v1/__chrono/duration.h:255:18: note: explicit constructor is not a candidate
        explicit duration(const _Rep2& __r,
                 ^
/Users/pipinet/workspace/automation/install/behaviortree_cpp/include/behaviortree_cpp/bt_factory.h:124:50: note: passing argument to parameter 'timeout' here
  void sleep(std::chrono::system_clock::duration timeout);
                                                 ^
/Users/pipinet/workspace/automation/dependencies/BehaviorTree.ROS2/behaviortree_ros2/src/tree_execution_server.cpp:246:27: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
    RCLCPP_ERROR(kLogger, action_result->return_message.c_str());
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/pipinet/workspace/automation/.pixi/envs/default/include/rclcpp/rclcpp/logging.hpp:1407:7: note: expanded from macro 'RCLCPP_ERROR'
      __VA_ARGS__); \
      ^~~~~~~~~~~
/Users/pipinet/workspace/automation/.pixi/envs/default/include/rcutils/rcutils/logging_macros.h:997:5: note: expanded from macro 'RCUTILS_LOG_ERROR_NAMED'
    __VA_ARGS__)
    ^~~~~~~~~~~
/Users/pipinet/workspace/automation/.pixi/envs/default/include/rcutils/rcutils/logging_macros.h:72:64: note: expanded from macro 'RCUTILS_LOG_COND_NAMED'
      rcutils_log(&__rcutils_logging_location, severity, name, __VA_ARGS__); \
                                                               ^~~~~~~~~~~
/Users/pipinet/workspace/automation/dependencies/BehaviorTree.ROS2/behaviortree_ros2/src/tree_execution_server.cpp:246:27: note: treat the string as an argument to avoid this
    RCLCPP_ERROR(kLogger, action_result->return_message.c_str());
                          ^
                          "%s",
/Users/pipinet/workspace/automation/.pixi/envs/default/include/rclcpp/rclcpp/logging.hpp:1407:7: note: expanded from macro 'RCLCPP_ERROR'
      __VA_ARGS__); \
      ^
/Users/pipinet/workspace/automation/.pixi/envs/default/include/rcutils/rcutils/logging_macros.h:997:5: note: expanded from macro 'RCUTILS_LOG_ERROR_NAMED'
    __VA_ARGS__)
    ^
/Users/pipinet/workspace/automation/.pixi/envs/default/include/rcutils/rcutils/logging_macros.h:72:64: note: expanded from macro 'RCUTILS_LOG_COND_NAMED'
      rcutils_log(&__rcutils_logging_location, severity, name, __VA_ARGS__); \
                                                               ^
/Users/pipinet/workspace/automation/dependencies/BehaviorTree.ROS2/behaviortree_ros2/src/tree_execution_server.cpp:269:26: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
    RCLCPP_INFO(kLogger, action_result->return_message.c_str());
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/pipinet/workspace/automation/.pixi/envs/default/include/rclcpp/rclcpp/logging.hpp:537:7: note: expanded from macro 'RCLCPP_INFO'
      __VA_ARGS__); \
      ^~~~~~~~~~~
/Users/pipinet/workspace/automation/.pixi/envs/default/include/rcutils/rcutils/logging_macros.h:503:5: note: expanded from macro 'RCUTILS_LOG_INFO_NAMED'
    __VA_ARGS__)
    ^~~~~~~~~~~
/Users/pipinet/workspace/automation/.pixi/envs/default/include/rcutils/rcutils/logging_macros.h:72:64: note: expanded from macro 'RCUTILS_LOG_COND_NAMED'
      rcutils_log(&__rcutils_logging_location, severity, name, __VA_ARGS__); \
                                                               ^~~~~~~~~~~
/Users/pipinet/workspace/automation/dependencies/BehaviorTree.ROS2/behaviortree_ros2/src/tree_execution_server.cpp:269:26: note: treat the string as an argument to avoid this
    RCLCPP_INFO(kLogger, action_result->return_message.c_str());
                         ^
                         "%s",
/Users/pipinet/workspace/automation/.pixi/envs/default/include/rclcpp/rclcpp/logging.hpp:537:7: note: expanded from macro 'RCLCPP_INFO'
      __VA_ARGS__); \
      ^
/Users/pipinet/workspace/automation/.pixi/envs/default/include/rcutils/rcutils/logging_macros.h:503:5: note: expanded from macro 'RCUTILS_LOG_INFO_NAMED'
    __VA_ARGS__)
    ^
/Users/pipinet/workspace/automation/.pixi/envs/default/include/rcutils/rcutils/logging_macros.h:72:64: note: expanded from macro 'RCUTILS_LOG_COND_NAMED'
      rcutils_log(&__rcutils_logging_location, severity, name, __VA_ARGS__); \
                                                               ^
/Users/pipinet/workspace/automation/dependencies/BehaviorTree.ROS2/behaviortree_ros2/src/tree_execution_server.cpp:274:27: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
    RCLCPP_ERROR(kLogger, action_result->return_message.c_str());
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/pipinet/workspace/automation/.pixi/envs/default/include/rclcpp/rclcpp/logging.hpp:1407:7: note: expanded from macro 'RCLCPP_ERROR'
      __VA_ARGS__); \
      ^~~~~~~~~~~
/Users/pipinet/workspace/automation/.pixi/envs/default/include/rcutils/rcutils/logging_macros.h:997:5: note: expanded from macro 'RCUTILS_LOG_ERROR_NAMED'
    __VA_ARGS__)
    ^~~~~~~~~~~
/Users/pipinet/workspace/automation/.pixi/envs/default/include/rcutils/rcutils/logging_macros.h:72:64: note: expanded from macro 'RCUTILS_LOG_COND_NAMED'
      rcutils_log(&__rcutils_logging_location, severity, name, __VA_ARGS__); \
                                                               ^~~~~~~~~~~
/Users/pipinet/workspace/automation/dependencies/BehaviorTree.ROS2/behaviortree_ros2/src/tree_execution_server.cpp:274:27: note: treat the string as an argument to avoid this
    RCLCPP_ERROR(kLogger, action_result->return_message.c_str());
                          ^
                          "%s",
/Users/pipinet/workspace/automation/.pixi/envs/default/include/rclcpp/rclcpp/logging.hpp:1407:7: note: expanded from macro 'RCLCPP_ERROR'
      __VA_ARGS__); \
      ^
/Users/pipinet/workspace/automation/.pixi/envs/default/include/rcutils/rcutils/logging_macros.h:997:5: note: expanded from macro 'RCUTILS_LOG_ERROR_NAMED'
    __VA_ARGS__)
    ^
/Users/pipinet/workspace/automation/.pixi/envs/default/include/rcutils/rcutils/logging_macros.h:72:64: note: expanded from macro 'RCUTILS_LOG_COND_NAMED'
      rcutils_log(&__rcutils_logging_location, severity, name, __VA_ARGS__); \
                                                               ^
4 warnings and 1 error generated.
make[2]: *** [CMakeFiles/behaviortree_ros2.dir/src/tree_execution_server.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/behaviortree_ros2.dir/all] Error 2
make: *** [all] Error 2
Failed   <<< behaviortree_ros2 [13.7s, exited with code 2]
tony-p commented 2 months ago

Can you give the output of pixi list?

I also build in a pixi env but don't see this issue

tony-p commented 2 months ago

are you building on windows with MSVC?

I got some build errors on windows (not as verbose as what you get) but for me are solved by https://github.com/BehaviorTree/BehaviorTree.ROS2/pull/91 (MSVC v19 - VS2022)