Trouble building Autoware Auto (which setup.bash to source?)
Hi. I am trying to build Autoware-Auto from source, following this guide.
I first installed ros2 foxy from source.
So now I have two directory that contains the ros2 files, and each have a setup.bash
file inside.
A: ~/ros2_foxy/install/setup.bash
and B: /opt/ros/foxy/setup.bash
When I only source A, Autoware-Auto build failes with this message:
~/AutowareAuto$ colcon build
Starting >>> autoware_auto_examples
--- stderr: autoware_auto_cmake
CMake Error at CMakeLists.txt:19 (find_package):
By not providing "Findament_cmake_auto.cmake" in CMAKE_MODULE_PATH this
project has asked CMake to find a package configuration file provided by
"ament_cmake_auto", but CMake did not find one.
Could not find a package configuration file provided by "ament_cmake_auto"
with any of the following names:
ament_cmake_autoConfig.cmake
ament_cmake_auto-config.cmake
Add the installation prefix of "ament_cmake_auto" to CMAKE_PREFIX_PATH or
set "ament_cmake_auto_DIR" to a directory containing one of the above
files. If "ament_cmake_auto" provides a separate development package or
SDK, be sure it has been installed.
---
Failed <<< autoware_auto_cmake [0.13s, exited with code 1]
When I source only B, or source both A & B, build also failes with this message:
~/AutowareAuto$ colcon build
Found package configuration file:
~/ros2_foxy/install/ament_cmake_cpplint/share/ament_cmake_cpplint/cmake/ament_cmake_cpplintConfig.cmake
but it set ament_cmake_cpplint_FOUND to FALSE so package
"ament_cmake_cpplint" is considered to be NOT FOUND.
CMake Warning at CMakeLists.txt:58 (find_package):
Found package configuration file:
~/ros2_foxy/install/ament_cmake_cpplint/share/ament_cmake_cpplint/cmake/ament_cmake_uncrustifyConfig.cmake
but it set ament_cmake_uncrustify_FOUND to FALSE so package
"ament_cmake_uncrustify" is considered to be NOT FOUND.
~/AutowareAuto/src/common/autoware_auto_common/test/test_message_field_adapters.cpp:20:10: fatal error: geometry_msgs/msg/transform_stamped.hpp: No such file or directory
20 | #include <geometry_msgs/msg/transform_stamped.hpp>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
---
Failed <<< autoware_auto_common [14.8s, exited with code 2]
This is very weird, because I find that <geometry_msgs/msg/transform_stamped.hpp
exists in /opt/ros/foxy/include/geometry_msgs/msg/transform_stamped.hpp
.
You can find the CMakeLists.txt file here.
Why am I getting these build errors?
Asked by upoque on 2021-01-20 11:25:36 UTC
Answers
which setup.bash to source?
If you want to build Autoware using the binary ROS packages, you should not source the setup.bash for your from source installation. Likewise if you want to build using your from-source installation you should not source the setup.bash from the binary installation. With the exception of using the binaries as an underlay workspace for customizations in the source installation there are very few circumstances where you would source both setup scripts in the same session and I would recommend you avoid it.
Both error messages indicate that some packages required by A are not available in the workspace. Did you run the rosdep command indicated in the installation instructions?
What is the output of dpkg -s ros-foxy-geometry-msgs
for your environment?
Asked by nuclearsandwich on 2021-01-22 16:49:04 UTC
Comments
Thanks. It cleared out some confusion that I had.
The output: $ dpkg -s ros-foxy-geometry-msgs Package: ros-foxy-geometry-msgs Status: install ok installed Priority: optional Section: misc Installed-Size: 10090 Maintainer: William Woodall william@osrfoundation.org Architecture: amd64 Version: 2.0.3-1focal.20201210.061405 Depends: libc6 (>= 2.14), libgcc-s1 (>= 3.0), libpython3.8 (>= 3.8.2), libstdc++6 (>= 5.2), ros-foxy-fastcdr, ros-foxy-rosidl-default-runtime, ros-foxy-std-msgs, ros-foxy-ros-workspace Description: A package containing some geometry related message definitions.
Asked by upoque on 2021-01-24 21:54:33 UTC
Anyways, I do not know exactly how, but I got it compiled by sourcing both A&B, and specifying header file location for tf2.
$ colcon build --cmake-args -Dtf2_INCLUDE_DIRS="/opt/ros/foxy/include/;/opt/ros/foxy/share/;/opt/ros2_foxy/install/tf2_sensor_msgs/include/" -DBUILD_TESTING=OFF -DCMAKE_CXX_FLAGS="-Wno-error=old-style-cast" -DCMAKE_BUILD_TYPE=Release
Asked by upoque on 2021-01-24 21:55:56 UTC
hi@nuclearsandwich i have to set up on my anther machine im getting error as mention below while building the package using command colcon build but in my previous machine its working fine.what i have missed??? --- stderr: autoware_auto_geometry_msgs make[2]: *** No rule to make target '/opt/ros/foxy/lib/libfastrtps.so.2.1.1', needed by 'libautoware_auto_geometry_msgs_rosidl_typesupport_fastrtps_cpp.so'. Stop. make[1]: *** [CMakeFiles/Makefile2:361: CMakeFiles/autoware_auto_geometry_msgs_rosidl_typesupport_fastrtps_cpp.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:141: all] Error 2
Failed <<< autoware_auto_geometry_msgs [0.64s, exited with code 2]
Aborted <<< grid_map_msgs [0.03s]
Aborted <<< grid_map_core [0.06s]
Aborted <<< autoware_auto_mapping_msgs [0.67s]
Aborted <<< time_utils [0.17s]
Aborted <<< autoware_auto_control_msgs [0.71s]
Aborted <<< autoware_auto_common [0.22s]
Aborted <<< autoware_auto_system_msgs
Asked by Sam123 on 2022-02-16 04:20:55 UTC
Comments