Search code examples
ros

I want to use laser_filters but can't build it


I am using ubuntu 20.04 (noetic). I am trying to use laser filters( http://wiki.ros.org/laser_filters), but I cannot build it.

When I use catkin_make I get the following error

CMake Error at /opt/ros/noetic/share/catkin/cmake/catkin_workspace.cmake:100 (message):
  This workspace contains non-catkin packages in it, and catkin cannot build
  a non-homogeneous workspace without isolation.  Try the
  'catkin_make_isolated' command instead.
Call Stack (most recent call first):
  CMakeLists.txt:69 (catkin_workspace)

-- Configuring incomplete, errors occurred!
See also "/home/limlab/filter_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/limlab/filter_ws/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed

When I use catkin_make_isolated I get the following error

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~  traversing 1 packages in topological order:
~~  - laser_filters (unknown)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: Packages with unknown build types exist
Can not build workspace with packages of unknown build_type


Solution

  • I don't have enough reputation to comment so I'll write an answer

    My first guess would be that you downloaded laser_filters package for the wrong version of ROS. If you get package from source: https://github.com/ros-perception/laser_filters. After downloading you need to checkout to noetic-devel branch (default branch is ros2 and that would make sense because it doesn't use catkin build system).

    Cloning correct branch:

    # cd to your workspace src folder
    git clone https://github.com/ros-perception/laser_filters.git
    cd laser_filters
    git checkout noetic-devel
    

    Alternatively you could delete laser_filters package from your workspace and try getting it from apt

    sudo apt install ros-noetic-laser-filters