fmrico / book_ros2

542 stars 112 forks source link

Not able to build book_ros2 ! issue : Cmake Regex mode MATCH failed to compile regex #28

Closed mathanprasannakumar closed 11 months ago

mathanprasannakumar commented 1 year ago

Hey @fmrico ,

An awesome book that you had written . After installing the dependencies using rosdep , while building the book_ros2 , I am getting the below error , Please suggest me how to solve this , I am stuck here

System configuration: OS : Ubuntu 22.04 ros-distro : Humble Cmake : 3.27.7

Please consider my issue and let me know if you require further more information . Thanks

colcon build --symlink-install                                                                                                                              
[1.360s] WARNING:colcon.colcon_core.package_selection:Some selected packages are already built in one or more underlay workspaces:                                                     
        'launch_pal' is in: /opt/ros/humble                                                                                                                                            
If a package in a merged underlay workspace is overridden and it installs headers, then all packages in the overlay must sort their include directories by workspace order. Failure to 
do so may result in build failures or undefined behavior at run time.                                                                                                                  
If the overridden package is used by another package in any underlay, then the overriding package in the overlay must be API and ABI compatible or undefined behavior at run time may o
ccur.                                                                                                                                                                                  

If you understand the risks and want to override a package anyways, add the following to the command line:                                                                             
        --allow-overriding launch_pal                                                                                                                                                  

This may be promoted to an error in a future release of colcon-override-check.                                                                                                         
Starting >>> launch_pal                                                                                                                                                                
Starting >>> pal_gripper_controller_configuration                                                                                                                                      
Starting >>> pmb2_laser_sensors                                                                                                                                                        
Starting >>> hey5_description                                                                                                                                                          
Starting >>> pmb2_maps                                                                                                                                                                 
Starting >>> urdf_test                                                                                                                                                                 
Starting >>> pal_gazebo_worlds                                                                                                                                                         
Starting >>> br2_tracking_msgs                                                                                                                                                         
Starting >>> br2_basics                                                                                                                                                                
Starting >>> br2_bt_bumpgo                                                                                                                                                             
Starting >>> br2_bt_patrolling                                                                                                                                                         
Starting >>> br2_fsm_bumpgo_cpp                                                                                                                                                        
Finished <<< launch_pal [3.58s]                                                                                                                                                        
Starting >>> pmb2_controller_configuration                                                                                                                                             
Finished <<< pmb2_laser_sensors [4.76s]                                                                                                                                                
Finished <<< pmb2_maps [5.26s]                                                                                                                                                         
Starting >>> tiago_laser_sensors                                                                                                                                                       
--- stderr: hey5_description                                                                                                                                                           
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):                                                                                                                
  Compatibility with CMake < 3.5 will be removed from a future version of                                                                                                              
  CMake.                              

    Update the VERSION argument <min> value or use a ...<max> suffix to tell                                                                                                             
  CMake that the project does not need compatibility with older versions.                                                                                                              

---                                                                                                                                                                                    
Finished <<< hey5_description [5.38s]                                                                                                                                                  
Starting >>> pmb2_2dnav                                                                                                                                                                
Starting >>> br2_fsm_bumpgo_py         
Finished <<< pal_gripper_controller_configuration [6.22s]
Starting >>> tiago_controller_configuration
--- stderr: br2_basics                                             
CMake Error at /opt/ros/humble/share/ament_cmake_cppcheck/cmake/ament_cmake_cppcheck_lint_hook.cmake:73 (string):
  string sub-command REGEX, mode MATCH failed to compile regex
  "^/home/mat/Desktop/ros/c++/src/book_ros2/br2_basics/.*".
Call Stack (most recent call first):
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
  /opt/ros/humble/share/ament_lint_auto/cmake/ament_lint_auto_package_hook.cmake:21 (ament_execute_extensions)
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_package.cmake:66 (ament_execute_extensions)
  CMakeLists.txt:55 (ament_package)

CMake Error at /opt/ros/humble/share/ament_cmake_cppcheck/cmake/ament_cmake_cppcheck_lint_hook.cmake:75 (string):
  string sub-command REGEX, mode MATCH failed to compile regex
  "^\$<.*:/home/mat/Desktop/ros/c++/src/book_ros2/br2_basics/.*>$".
Call Stack (most recent call first):
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
  /opt/ros/humble/share/ament_lint_auto/cmake/ament_lint_auto_package_hook.cmake:21 (ament_execute_extensions)
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_package.cmake:66 (ament_execute_extensions)
  CMakeLists.txt:55 (ament_package)

CMake Error at /opt/ros/humble/share/ament_cmake_cppcheck/cmake/ament_cmake_cppcheck_lint_hook.cmake:73 (string):
  string sub-command REGEX, mode MATCH failed to compile regex
  "^/home/mat/Desktop/ros/c++/src/book_ros2/br2_basics/.*".
Call Stack (most recent call first):
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
  /opt/ros/humble/share/ament_lint_auto/cmake/ament_lint_auto_package_hook.cmake:21 (ament_execute_extensions)
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_package.cmake:66 (ament_execute_extensions)
  CMakeLists.txt:55 (ament_package)

CMake Error at /opt/ros/humble/share/ament_cmake_cppcheck/cmake/ament_cmake_cppcheck_lint_hook.cmake:75 (string):
  string sub-command REGEX, mode MATCH failed to compile regex
  "^\$<.*:/home/mat/Desktop/ros/c++/src/book_ros2/br2_basics/.*>$".
Call Stack (most recent call first):

CMake Error at /opt/ros/humble/share/ament_cmake_cppcheck/cmake/ament_cmake_cppcheck_lint_hook.cmake:73 (string):
  string sub-command REGEX, mode MATCH failed to compile regex
  "^/home/mat/Desktop/ros/c++/src/book_ros2/br2_basics/.*".
Call Stack (most recent call first):
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
  /opt/ros/humble/share/ament_lint_auto/cmake/ament_lint_auto_package_hook.cmake:21 (ament_execute_extensions)
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_package.cmake:66 (ament_execute_extensions)
  CMakeLists.txt:55 (ament_package)

CMake Error at /opt/ros/humble/share/ament_cmake_cppcheck/cmake/ament_cmake_cppcheck_lint_hook.cmake:75 (string):
  string sub-command REGEX, mode MATCH failed to compile regex
  "^\$<.*:/home/mat/Desktop/ros/c++/src/book_ros2/br2_basics/.*>$".
Call Stack (most recent call first):
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
  /opt/ros/humble/share/ament_lint_auto/cmake/ament_lint_auto_package_hook.cmake:21 (ament_execute_extensions)
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_package.cmake:66 (ament_execute_extensions)
  CMakeLists.txt:55 (ament_package)

CMake Error at /opt/ros/humble/share/ament_cmake_cppcheck/cmake/ament_cmake_cppcheck_lint_hook.cmake:73 (string):
  string sub-command REGEX, mode MATCH failed to compile regex
  "^/home/mat/Desktop/ros/c++/src/book_ros2/br2_basics/.*".
Call Stack (most recent call first):
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
  /opt/ros/humble/share/ament_lint_auto/cmake/ament_lint_auto_package_hook.cmake:21 (ament_execute_extensions)
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_package.cmake:66 (ament_execute_extensions)
  CMakeLists.txt:55 (ament_package)

CMake Error at /opt/ros/humble/share/ament_cmake_cppcheck/cmake/ament_cmake_cppcheck_lint_hook.cmake:75 (string):
  string sub-command REGEX, mode MATCH failed to compile regex
  "^\$<.*:/home/mat/Desktop/ros/c++/src/book_ros2/br2_basics/.*>$".
Call Stack (most recent call first):
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
  /opt/ros/humble/share/ament_lint_auto/cmake/ament_lint_auto_package_hook.cmake:21 (ament_execute_extensions)
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_package.cmake:66 (ament_execute_extensions)
  CMakeLists.txt:55 (ament_package)

CMake Error at /opt/ros/humble/share/ament_cmake_cppcheck/cmake/ament_cmake_cppcheck_lint_hook.cmake:73 (string):
  string sub-command REGEX, mode MATCH failed to compile regex
  "^/home/mat/Desktop/ros/c++/src/book_ros2/br2_basics/.*".
Call Stack (most recent call first):
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
  /opt/ros/humble/share/ament_lint_auto/cmake/ament_lint_auto_package_hook.cmake:21 (ament_execute_extensions)
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_package.cmake:66 (ament_execute_extensions)
  CMakeLists.txt:55 (ament_package)

CMake Error at /opt/ros/humble/share/ament_cmake_cppcheck/cmake/ament_cmake_cppcheck_lint_hook.cmake:75 (string):
  string sub-command REGEX, mode MATCH failed to compile regex
  "^\$<.*:/home/mat/Desktop/ros/c++/src/book_ros2/br2_basics/.*>$".
Call Stack (most recent call first):
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
  /opt/ros/humble/share/ament_lint_auto/cmake/ament_lint_auto_package_hook.cmake:21 (ament_execute_extensions)
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_package.cmake:66 (ament_execute_extensions)
  CMakeLists.txt:55 (ament_package)

CMake Error at /opt/ros/humble/share/ament_cmake_cppcheck/cmake/ament_cmake_cppcheck_lint_hook.cmake:73 (string):
  string sub-command REGEX, mode MATCH failed to compile regex
  "^/home/mat/Desktop/ros/c++/src/book_ros2/br2_basics/.*".
Call Stack (most recent call first):
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
  /opt/ros/humble/share/ament_lint_auto/cmake/ament_lint_auto_package_hook.cmake:21 (ament_execute_extensions)
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_package.cmake:66 (ament_execute_extensions)
  CMakeLists.txt:55 (ament_package)

CMake Error at /opt/ros/humble/share/ament_cmake_cppcheck/cmake/ament_cmake_cppcheck_lint_hook.cmake:75 (string):
  string sub-command REGEX, mode MATCH failed to compile regex
  "^\$<.*:/home/mat/Desktop/ros/c++/src/book_ros2/br2_basics/.*>$".
Call Stack (most recent call first):
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
  /opt/ros/humble/share/ament_lint_auto/cmake/ament_lint_auto_package_hook.cmake:21 (ament_execute_extensions)
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_package.cmake:66 (ament_execute_extensions)
  CMakeLists.txt:55 (ament_package)

CMake Error at /opt/ros/humble/share/ament_cmake_cppcheck/cmake/ament_cmake_cppcheck_lint_hook.cmake:73 (string):
  string sub-command REGEX, mode MATCH failed to compile regex
  "^/home/mat/Desktop/ros/c++/src/book_ros2/br2_basics/.*".
Call Stack (most recent call first):
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
  /opt/ros/humble/share/ament_lint_auto/cmake/ament_lint_auto_package_hook.cmake:21 (ament_execute_extensions)
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_package.cmake:66 (ament_execute_extensions)
  CMakeLists.txt:55 (ament_package)

CMake Error at /opt/ros/humble/share/ament_cmake_cppcheck/cmake/ament_cmake_cppcheck_lint_hook.cmake:75 (string):
  string sub-command REGEX, mode MATCH failed to compile regex
  "^\$<.*:/home/mat/Desktop/ros/c++/src/book_ros2/br2_basics/.*>$".
Call Stack (most recent call first):
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
  /opt/ros/humble/share/ament_lint_auto/cmake/ament_lint_auto_package_hook.cmake:21 (ament_execute_extensions)
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_package.cmake:66 (ament_execute_extensions)
  CMakeLists.txt:55 (ament_package)

CMake Error at /opt/ros/humble/share/ament_cmake_cppcheck/cmake/ament_cmake_cppcheck_lint_hook.cmake:73 (string):
  string sub-command REGEX, mode MATCH failed to compile regex
  "^/home/mat/Desktop/ros/c++/src/book_ros2/br2_basics/.*".
Call Stack (most recent call first):
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
  /opt/ros/humble/share/ament_lint_auto/cmake/ament_lint_auto_package_hook.cmake:21 (ament_execute_extensions)
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_package.cmake:66 (ament_execute_extensions)
  CMakeLists.txt:55 (ament_package)

CMake Error at /opt/ros/humble/share/ament_cmake_cppcheck/cmake/ament_cmake_cppcheck_lint_hook.cmake:75 (string):
  string sub-command REGEX, mode MATCH failed to compile regex
  "^\$<.*:/home/mat/Desktop/ros/c++/src/book_ros2/br2_basics/.*>$".
Call Stack (most recent call first):
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
  /opt/ros/humble/share/ament_lint_auto/cmake/ament_lint_auto_package_hook.cmake:21 (ament_execute_extensions)
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_package.cmake:66 (ament_execute_extensions)
  CMakeLists.txt:55 (ament_package)

CMake Error at /opt/ros/humble/share/ament_cmake_cppcheck/cmake/ament_cmake_cppcheck_lint_hook.cmake:73 (string):
  string sub-command REGEX, mode MATCH failed to compile regex
  "^/home/mat/Desktop/ros/c++/src/book_ros2/br2_basics/.*".
Call Stack (most recent call first):
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
  /opt/ros/humble/share/ament_lint_auto/cmake/ament_lint_auto_package_hook.cmake:21 (ament_execute_extensions)
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_package.cmake:66 (ament_execute_extensions)
  CMakeLists.txt:55 (ament_package)

CMake Error at /opt/ros/humble/share/ament_cmake_cppcheck/cmake/ament_cmake_cppcheck_lint_hook.cmake:75 (string):
  string sub-command REGEX, mode MATCH failed to compile regex
  "^\$<.*:/home/mat/Desktop/ros/c++/src/book_ros2/br2_basics/.*>$".
Call Stack (most recent call first):
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
  /opt/ros/humble/share/ament_lint_auto/cmake/ament_lint_auto_package_hook.cmake:21 (ament_execute_extensions)
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_package.cmake:66 (ament_execute_extensions)
  CMakeLists.txt:55 (ament_package)

CMake Error at /opt/ros/humble/share/ament_cmake_cppcheck/cmake/ament_cmake_cppcheck_lint_hook.cmake:73 (string):
  string sub-command REGEX, mode MATCH failed to compile regex
  "^/home/mat/Desktop/ros/c++/src/book_ros2/br2_basics/.*".
Call Stack (most recent call first):
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
  /opt/ros/humble/share/ament_lint_auto/cmake/ament_lint_auto_package_hook.cmake:21 (ament_execute_extensions)
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_package.cmake:66 (ament_execute_extensions)
  CMakeLists.txt:55 (ament_package)

CMake Error at /opt/ros/humble/share/ament_cmake_cppcheck/cmake/ament_cmake_cppcheck_lint_hook.cmake:75 (string):
  string sub-command REGEX, mode MATCH failed to compile regex
  "^\$<.*:/home/mat/Desktop/ros/c++/src/book_ros2/br2_basics/.*>$".
Call Stack (most recent call first):
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
  /opt/ros/humble/share/ament_lint_auto/cmake/ament_lint_auto_package_hook.cmake:21 (ament_execute_extensions)
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
  /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_package.cmake:66 (ament_execute_extensions)
  CMakeLists.txt:55 (ament_package)

---
Failed   <<< br2_basics [6.71s, exited with code 1]
Aborted  <<< br2_bt_bumpgo [6.71s]
Aborted  <<< br2_fsm_bumpgo_cpp [6.62s]                                      
Aborted  <<< pal_gazebo_worlds [6.85s]
Aborted  <<< urdf_test [6.90s]
Aborted  <<< br2_bt_patrolling [6.67s]
Aborted  <<< br2_fsm_bumpgo_py [1.50s]
Aborted  <<< tiago_controller_configuration [0.86s]
Aborted  <<< pmb2_controller_configuration [3.56s]
Aborted  <<< tiago_laser_sensors [2.38s]                                               
Aborted  <<< pmb2_2dnav [2.50s]                                                        
Aborted  <<< br2_tracking_msgs [8.30s]                                  

Summary: 5 packages finished [10.1s]
  1 package failed: br2_basics
  11 packages aborted: br2_bt_bumpgo br2_bt_patrolling br2_fsm_bumpgo_cpp br2_fsm_bumpgo_py br2_tracking_msgs pal_gazebo_worlds pmb2_2dnav pmb2_controller_configuration tiago_controller_configuration tiago_laser_sensors urdf_test
  7 packages had stderr output: br2_basics br2_bt_bumpgo br2_bt_patrolling br2_fsm_bumpgo_cpp br2_tracking_msgs hey5_description pal_gazebo_worlds
  20 packages not processed
fmrico commented 1 year ago

Are you using clang or gcc?

mathanprasannakumar commented 1 year ago

@fmrico , Thanks for the reply ,

I am using gcc

gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0

fmrico commented 11 months ago

It is a very strange message. I suppose you removed build, install, and log, open a new terminal an build again, right?

mathanprasannakumar commented 11 months ago

Thank you @fmrico ,

Apologies , the issue is at my end , i placed the workspace inside nested directories along with other workspaces.

Thank you so much for your support and awesome book to the community.