fzi-forschungszentrum-informatik / Lanelet2

Map handling framework for automated driving
BSD 3-Clause "New" or "Revised" License
800 stars 327 forks source link

lanelet2_core build fails because of missing includes #9

Closed odel4y closed 5 years ago

odel4y commented 5 years ago

Hello, I am trying to build the newest lanelet2 from git. I installed ROS Melodic from ros-melodic-ros-base in my Ubuntu 18.04 and then followed your installation instructions (including the extra dependencies). I also downloaded the catkin package into the workspace. When I try to build the workspace it fails with the following error:

--------------------------------------------------------------
Profile:                     default
Extending:             [env] /opt/ros/melodic
Workspace:                   /home/username/catkin_ws
--------------------------------------------------------------
Source Space:       [exists] /home/username/catkin_ws/src
Log Space:          [exists] /home/username/catkin_ws/logs
Build Space:        [exists] /home/username/catkin_ws/build
Devel Space:        [exists] /home/username/catkin_ws/devel
Install Space:      [unused] /home/username/catkin_ws/install
DESTDIR:            [unused] None
--------------------------------------------------------------
Devel Space Layout:          linked
Install Space Layout:        None
--------------------------------------------------------------
Additional CMake Args:       None
Additional Make Args:        None
Additional catkin Make Args: None
Internal Make Job Server:    True
Cache Job Environments:      False
--------------------------------------------------------------
Whitelisted Packages:        None
Blacklisted Packages:        None
--------------------------------------------------------------
Workspace configuration appears valid.
--------------------------------------------------------------
[build] Found '12' packages in 0.0 seconds.                                    
[build] Package table is up to date.                                           
Starting  >>> catkin                                                           
Finished  <<< catkin                                [ 0.1 seconds ]            
Starting  >>> mrt_cmake_modules                                                
Finished  <<< mrt_cmake_modules                     [ 0.1 seconds ]            
Starting  >>> lanelet2_core                                                    
_______________________________________________________________________________
Errors     << lanelet2_core:cmake /home/username/catkin_ws/logs/lanelet2_core/build.cmake.001.log
Traceback (most recent call last):
  File "/home/username/catkin_ws/src/mrt_cmake_modules/scripts/generate_cmake_dependency_file.py", line 291, in <module>
    main(sys.argv[1], sys.argv[2], sys.argv[3])
  File "/home/username/catkin_ws/src/mrt_cmake_modules/scripts/generate_cmake_dependency_file.py", line 177, in main
    catkin_packages = getCatkinPackages(workspaceRoot)
  File "/home/username/catkin_ws/src/mrt_cmake_modules/scripts/generate_cmake_dependency_file.py", line 135, in getCatkinPackages
    catkin_packages = subprocess.check_output(args).split('\n')
  File "/usr/lib/python2.7/subprocess.py", line 216, in check_output
    process = Popen(stdout=PIPE, *popenargs, **kwargs)
  File "/usr/lib/python2.7/subprocess.py", line 394, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
CMake Error at /home/username/catkin_ws/src/mrt_cmake_modules/cmake/Modules/GatherDeps.cmake:16 (include):
  include could not find load file:

    /home/username/catkin_ws/build/lanelet2_core/CMakeFiles/auto_dep_vars.cmake
Call Stack (most recent call first):
  CMakeLists.txt:16 (include)

cd /home/username/catkin_ws/build/lanelet2_core; catkin build --get-env lanelet2_core | catkin env -si  /usr/bin/cmake /home/username/catkin_ws/src/lanelet2/lanelet2_core --no-warn-unused-cli -DCATKIN_DEVEL_PREFIX=/home/username/catkin_ws/devel/.private/lanelet2_core -DCMAKE_INSTALL_PREFIX=/home/username/catkin_ws/install; cd -
...............................................................................
Failed     << lanelet2_core:cmake                   [ Exited with code 1 ]     
Failed    <<< lanelet2_core                         [ 0.9 seconds ]            
Abandoned <<< lanelet2_io                           [ Unrelated job failed ]   
Abandoned <<< lanelet2_maps                         [ Unrelated job failed ]   
Abandoned <<< lanelet2_projection                   [ Unrelated job failed ]   
Abandoned <<< lanelet2_traffic_rules                [ Unrelated job failed ]   
Abandoned <<< lanelet2_routing                      [ Unrelated job failed ]   
Abandoned <<< lanelet2_python                       [ Unrelated job failed ]  
Abandoned <<< lanelet2_examples                     [ Unrelated job failed ]

I am not sure whether this is due to a misconfiguration on my part or actually a bug in lanelet2.

poggenhans commented 5 years ago

Hey, thanks for reporting that. Can you check if ros-melodic-rospack is installed on your system?

Its not a direct dependency of lanelet2 but a dependency of mrt_cmake_modules. I guess we should mention that in the install instructions...

odel4y commented 5 years ago

Thanks for the quick answer. Rospack is installed: ros-melodic-rospack is already the newest version (2.5.2-0bionic.20180906.220829).

poggenhans commented 5 years ago

Hm. Can test if rospack list-names works?

That is the command that fails with OSError: [Errno 2] No such file or directory during the build process.

odel4y commented 5 years ago

Yeah that works. I attached the output just in case:

username@username-VirtualBox:~/catkin_ws$ rospack list-names
actionlib
actionlib_msgs
bond
bondcpp
bondpy
catkin
class_loader
cmake_modules
cpp_common
diagnostic_msgs
dynamic_reconfigure
gencpp
geneus
genlisp
genmsg
gennodejs
genpy
geometry_msgs
message_filters
message_generation
message_runtime
mk
nav_msgs
nodelet
nodelet_topic_tools
pluginlib
ros_environment
rosbag
rosbag_migration_rule
rosbag_storage
rosbash
rosboost_cfg
rosbuild
rosclean
rosconsole
rosconsole_bridge
roscpp
roscpp_serialization
roscpp_traits
roscreate
rosgraph
rosgraph_msgs
roslang
roslaunch
roslib
roslisp
roslz4
rosmake
rosmaster
rosmsg
rosnode
rosout
rospack
rosparam
rospy
rosservice
rostest
rostime
rostopic
rosunit
roswtf
sensor_msgs
shape_msgs
smclib
std_msgs
std_srvs
stereo_msgs
topic_tools
trajectory_msgs
visualization_msgs
xmlrpcpp
poggenhans commented 5 years ago

Are you sure you didn't install that after the build failed? Otherwise I don't see how

import subprocess
subprocess.check_call(["rospack", "list-names"])

should fail during the build process when it works fine if you run it youself...

odel4y commented 5 years ago

I tried a few things including installing the full ros-melodic-desktop package and cleaning the workspace. It compiles successfully now. The catkin clean seems to have solved my issue. It now also builds with the ros-melodic-ros-base package. Sorry for the false alert. Still a note about rospack is probably useful in the installation instructions so one does not need the full ROS environment.

For those that want to work with a minimum of ROS dependencies: You need to follow the ROS install instructions but instead of installing a full ROS environment you only need the following packages:

ros-melodic-catkin
ros-melodic-rosbash
ros-melodic-rospack

After that just follow the provided installation guide for Lanelet2.