Ask Your Question

Unable to load ROS2 workspace into CLion

asked 2019-03-27 15:27:09 -0500

jhassold gravatar image

I've been trying to get Ros2 to work with my copy of CLion using this guide on the Discussion Forums, but have been having no luck. I was wondering if there were more up-to-date instructions, since these were written in 2017. Or if I'm inadvertently messing something up. Probably the latter.

Before we start, this is all on Ubuntu version 18.04 LTE, running on a Lenovo ThinkPad P52.

So first off, the step for compilation seems to have a couple stderrors for me. I don't think they're the cause of my pain, but I'm a bit new to this, so who knows!

Starting >>> ament_package
Starting >>> ament_flake8
Starting >>> fastcdr
Starting >>> poco_vendor
Starting >>> ament_cppcheck
Starting >>> tinydir_vendor
Starting >>> gtest_vendor
Starting >>> osrf_pycommon
Starting >>> tinyxml2_vendor
Starting >>> tinyxml_vendor
Starting >>> urdfdom_headers
Starting >>> orocos_kdl
Finished <<< ament_package [0.97s]                                                                                                                                                               
Starting >>> ament_cmake_core
Finished <<< gtest_vendor [1.18s]                                                                                                                                                                   
Starting >>> gmock_vendor
Finished <<< gmock_vendor [0.24s]                                                                                                                                                            
Starting >>> osrf_testing_tools_cpp
Finished <<< poco_vendor [1.61s]                                                                                                                                                               
Starting >>> ament_pep8
Finished <<< ament_flake8 [2.03s]                                                                                                                                                                
Starting >>> ament_pep257
Finished <<< ament_cmake_core [1.54s]                                                                                                                                              
Starting >>> ament_cmake_test                                                                                                                                                      
Finished <<< ament_cppcheck [2.67s]                                                                                                                                                  
Starting >>> ament_cmake_libraries
Finished <<< tinyxml2_vendor [2.71s]
Finished <<< tinyxml_vendor [2.73s]
Finished <<< urdfdom_headers [2.76s]                                                                                                                                                   
Starting >>> ament_cmake_export_libraries
Starting >>> ament_cmake_include_directories
Starting >>> ament_cmake_export_definitions
Finished <<< osrf_pycommon [3.41s]                                                                                                                                                                   
Starting >>> ament_cmake_export_include_directories                                                                                                                                               
Finished <<< ament_cmake_test [1.85s]                                                                                                                                                               
Starting >>> ament_cmake_export_link_flags
Finished <<< ament_pep8 [2.88s]                                                                                                                                                                     
Starting >>> ament_cmake_python
Finished <<< ament_cmake_include_directories [2.23s]                                                                                                                                                  
Starting >>> ament_lint_auto
Finished <<< ament_cmake_libraries [2.41s]                                                                                                                                                            
Finished <<< ament_cmake_export_definitions [2.40s]                                                                                                                                                
Starting >>> ament_cmake_export_dependencies
Starting >>> ament_cmake_target_dependencies
Finished <<< ament_cmake_export_libraries [2.55s]                                                                                                                                                  
Starting >>> ament_cmake_export_interfaces                                                                                                                                                         
Finished <<< fastcdr [5.66s]                                                                                                                                                                            
Starting >>> fastrtps
Finished <<< ament_pep257 [3.96s]                                                                                                                                         
Starting >>> ament_copyright
Finished <<< ament_cmake_export_include_directories [3.61s]                                                                                         
Finished <<< ament_cmake_export_link_flags [2.81s]                                                                                                                                            
Starting >>> ament_index_python
Starting >>> ament_cmake_gtest
Finished <<< ament_cmake_python [4.27s]                                                                                                                                                 
Starting >>> ament_cmake_pytest                                                                                                                                                      
Finished <<< ament_copyright [3.01s]                                                                                                                                                 
Starting >>> ament_lint_cmake
Finished <<< ament_cmake_target_dependencies [5.25s]                                                                                                                                    
Finished <<< ament_cmake_export_dependencies [5.42s]                                                                                                                                 
Finished <<< ament_lint_auto [5.65s]
Finished <<< ament_cmake_export_interfaces [5.33s]
Starting >>> ament_cmake
Starting >>> ament_cpplint                                                                                                                                                                             
Starting >>> ament_xmllint
Starting >>> launch
Finished <<< ament_index_python [3.66s]                                                                                                                                          
Starting >>> ament_pyflakes                                                                                                                                                      
Finished <<< tinydir_vendor [11.9s]                                                                                                                                               
Starting >>> ament_clang_format                                                                                                                                                
Finished <<< ament_lint_cmake [5.24s]                                                                                                                                          
Finished <<< ament_cmake_pytest [5.55s]                                                                                                                                        
Finished <<< ament_cmake_gtest [7.18s]
Starting >>> ament_cmake_lint_cmake
Starting >>> ament_cmake_gmock                                                                                                                                                                
Starting >>> ament_pclint
Finished <<< ament_xmllint [5.40s]                                                                                                                                                             
Starting >>> ros_environment
Finished <<< ament_cmake [5.96s]                                                                                                                                                                 
Starting >>> uncrustify_vendor                                                                                                                                                      
Finished <<< ament_cmake_lint_cmake [2.33s]
Starting >>> ament_cmake_copyright
Finished <<< ament_cmake_gmock [2.34s]                                                                                                                                              
Starting >>> libyaml_vendor
Finished <<< ament_cpplint [6.25s]                                                                                                                                                     
Starting >>> console_bridge_vendor
Finished <<< ament_pyflakes [7.62s]                                                                                                                                                      
Starting >>> libcurl_vendor                                                                                                                                                                  
Finished <<< ros_environment [2.52s]                                                                                                                                                         
Starting >>> ament_cmake_auto
Finished <<< ament_cmake_copyright [3.01s]                                                                                                                                                    
Starting >>> ament_cmake_cppcheck                                                                                                                                                             
Finished <<< launch [9.10s]
Starting >>> ament_cmake_cpplint                                                                                                                                                                    
Finished <<< ament_clang_format [6.95s]                                                                                                                                                              
Starting >>> ament_cmake_flake8
Finished <<< osrf_testing_tools_cpp [20.9s]                                                                                                                                                                
Starting >>> ament_cmake_pep257
Finished <<< ament_cmake_auto [3.87s]                                                                                                                                                      
Starting >>> ament_cmake_xmllint
Finished <<< ament_pclint [8.25s]                                                                                                                                                          
Starting >>> rviz_assimp_vendor
Finished <<< ament_cmake_cpplint [3.38s]                                                                                                                                                                  
Starting >>> rviz_ogre_vendor
Finished <<< ament_cmake_cppcheck [3.68s]                                                                                                                                                                 
Starting >>> yaml_cpp_vendor
Finished <<< ament_cmake_flake8 [3.38s]                                                                                                                                                                   
Starting >>> test_osrf_testing_tools_cpp
Finished <<< ament_cmake_pep257 [3.53s]                                                                                                                                       
Starting >>> ament_cmake_nose
Finished <<< orocos_kdl [26.3s]                                                                                                                                                 
Starting >>> ament_cmake_clang_format
Finished <<< ament_cmake_xmllint [3.81s]                                                                                                                                               
Starting >>> ament_cmake_pclint
Finished <<< libcurl_vendor [9.30s]                                                                                                                                                       
Starting >>> ament_cmake_pep8                                                                                                                                                             
Finished <<< ament_cmake_nose [2.78s]                                                                                                                                                     
Starting >>> ament_cmake_pyflakes                                                                                                                                                         
Finished <<< ament_cmake_clang_format [3.51s]                                                                                                                                             
Finished <<< ament_cmake_pclint [3.48s]                                                                                                                                                   
Finished <<< ament_cmake_pep8 [3.15s]                                                                                                                                                     
Finished <<< ament_cmake_pyflakes [3.33s]                                                                                                                                                 
Finished <<< rviz_assimp_vendor [9.36s]                                                                                                                                                   
Finished <<< libyaml_vendor [17.1s]                                                                                                                                                         
Finished <<< test_osrf_testing_tools_cpp [25.1s]                                                                                                                                           
Finished <<< yaml_cpp_vendor [27.7s]                                                                                                                                                       
Finished <<< console_bridge_vendor [35.7s]                                                                                                                                                
Starting >>> urdfdom
Finished <<< uncrustify_vendor [45.3s]                                                                                                                                         
Starting >>> ament_uncrustify
Finished <<< ament_uncrustify [0.95s]                                                                                                                            
Starting >>> ament_cmake_uncrustify ...
edit retag flag offensive close merge delete


CLion has JUST added support for compilation databases, and external build tools. I'm currently experimenting on seeing if these can solve the issue, and will report back.

If anyone has experience generating top-level compilation database files via colcon, please let me know.

FURTHER UPDATE Colcon is indeed able to generate compilation databases. However, it makes one for each package, and I can't figure out how to get one in the root directory that covers all of them.

jhassold gravatar imagejhassold ( 2019-03-29 13:45:27 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2019-04-01 12:54:53 -0500

jhassold gravatar image

After significant fighting, I have not been able to successfully get the entire workspace into CLion. However, you can still work with packages individually by opening their respective CMakeLists.txt files as projects.

It's theoretically possible to open the entire workspace if there's a top-level CMakeLists.txt file. But I'm not sure how feasible that is to implement, given the amount of trouble I've had with it.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2019-03-27 15:27:09 -0500

Seen: 105 times

Last updated: Apr 01