Ask Your Question
0

TurtleBot3 Simulation With ROS Noetic on Fedora: Could not find a package configuration file provided by "gazebo_ros"

asked 2020-09-01 15:51:12 -0500

RobbieTheK gravatar image

updated 2020-09-04 11:08:24 -0500

I'm following this tutorial.

The build fails with

Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output:
Change Dir: /root/catkin_ws/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/gmake cmTC_989a3/fast && /usr/bin/gmake  -f CMakeFiles/cmTC_989a3.dir/build.make CMakeFiles/cmTC_989a3.dir/build
gmake[1]: Entering directory '/root/catkin_ws/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_989a3.dir/src.c.o
/usr/bin/cc   -DCMAKE_HAVE_LIBC_PTHREAD   -o CMakeFiles/cmTC_989a3.dir/src.c.o   -c /root/catkin_ws/build/CMakeFiles/CMakeTmp/src.c
Linking C executable cmTC_989a3
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_989a3.dir/link.txt --verbose=1
/usr/bin/cc  -DCMAKE_HAVE_LIBC_PTHREAD    -rdynamic CMakeFiles/cmTC_989a3.dir/src.c.o  -o cmTC_989a3 
/usr/bin/ld: CMakeFiles/cmTC_989a3.dir/src.c.o: in function `main':
src.c:(.text+0x2d): undefined reference to `pthread_create'
/usr/bin/ld: src.c:(.text+0x39): undefined reference to `pthread_detach'
/usr/bin/ld: src.c:(.text+0x45): undefined reference to `pthread_cancel'
/usr/bin/ld: src.c:(.text+0x56): undefined reference to `pthread_join'
collect2: error: ld returned 1 exit status
gmake[1]: *** [CMakeFiles/cmTC_989a3.dir/build.make:107: cmTC_989a3] Error 1
gmake[1]: Leaving directory '/root/catkin_ws/build/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:141: cmTC_989a3/fast] Error 2


Source file was:
#include <pthread.h>

void* test_func(void* data)
{
  return data;
}

int main(void)
{
  pthread_t thread;
  pthread_create(&thread, NULL, test_func, NULL);
  pthread_detach(thread);
  pthread_cancel(thread);
  pthread_join(thread, NULL);
  pthread_atfork(NULL, NULL, NULL);
  pthread_exit(NULL);

  return 0;
}

Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /root/catkin_ws/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/gmake cmTC_c1118/fast && /usr/bin/gmake  -f CMakeFiles/cmTC_c1118.dir/build.make CMakeFiles/cmTC_c1118.dir/build
gmake[1]: Entering directory '/root/catkin_ws/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_c1118.dir/CheckFunctionExists.c.o
/usr/bin/cc   -DCHECK_FUNCTION_EXISTS=pthread_create   -o CMakeFiles/cmTC_c1118.dir/CheckFunctionExists.c.o   -c /usr/share/cmake/Modules/CheckFunctionExists.c
Linking C executable cmTC_c1118
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_c1118.dir/link.txt --verbose=1
/usr/bin/cc  -DCHECK_FUNCTION_EXISTS=pthread_create    -rdynamic CMakeFiles/cmTC_c1118.dir/CheckFunctionExists.c.o  -o cmTC_c1118  -lpthreads 
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
gmake[1]: *** [CMakeFiles/cmTC_c1118.dir/build.make:107: cmTC_c1118] Error 1
gmake[1]: Leaving directory '/root/catkin_ws/build/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:141: cmTC_c1118/fast] Error 2

as wel as:

-- Could not find the required component 'gazebo_ros'. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found.
CMake Error at /root/ros_catkin_ws/install_isolated/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
  Could not find a package configuration file provided by "gazebo_ros" with
  any of the following names:

    gazebo_rosConfig.cmake
    gazebo_ros-config.cmake

  Add the installation prefix of "gazebo_ros" to CMAKE_PREFIX_PATH or set
  "gazebo_ros_DIR" to a directory containing one of the above files.  If
  "gazebo_ros" provides a separate development package or SDK, be sure it has
  been installed.
Call Stack (most ...
(more)
edit retag flag offensive close merge delete

Comments

1

Note I have Gazebo 11 installed and working.

"Gazebo 11" and gazebo_ros are two different things.

The latter depends on the former, but the former does not have any dependency on the latter.

gazebo_ros is part of the gazebo_ros_pkgs metapackage, and brings in Gazebo support for ROS.

If you've installed Gazebo yourself, following the dependencies on the gazebosim website, it could well be you have Gazebo 11 working, but you don't have the gazebo_ros package, which is what the error message is about.

gvdhoorn gravatar image gvdhoorn  ( 2020-09-02 02:08:40 -0500 )edit

How does one get the gazebo_ros package on Fedora 32? I only see it for Debian/Ubuntu.

RobbieTheK gravatar image RobbieTheK  ( 2020-09-02 08:25:29 -0500 )edit

Aren't you already building everything from source?

You'd build it from sources as well then.

I don't know how you manage your source checkout right now.

gvdhoorn gravatar image gvdhoorn  ( 2020-09-02 08:28:00 -0500 )edit

I am following the build instructions here but again, they say Ubuntu/Debian. I'd prefer an RPM.

And there's no noetic version mentioned on that page.

RobbieTheK gravatar image RobbieTheK  ( 2020-09-02 08:31:14 -0500 )edit

I tried to insert noetic in the tutorial but I get:

[ERROR[gazebo_dev]: No definition of [libgazebo11-dev] for OS [fedora]
        rosdep key : libgazebo11-dev
        OS name    : fedora
        OS version : 32
        Data:
debian:
                  buster:
                  - libgazebo11-dev
                ubuntu:
                  focal:
                  - libgazebo11-dev
RobbieTheK gravatar image RobbieTheK  ( 2020-09-02 08:34:59 -0500 )edit

You'll have to follow the Install from source instructions and translate the instructions to how you'd do those things on Fedora.

I'd prefer an RPM

Those aren't available.

Or at least not publicly afaik. You may want to post a comment on RPM Packaging Support in ros_buildfarm to let ppl know there are users interested in the RPM packaging/packages.

gvdhoorn gravatar image gvdhoorn  ( 2020-09-02 09:00:32 -0500 )edit

In general the workflow would be something like this:

  1. install Gazebo 11 and the Gazebo 11 development packages or build things from source. I don't know whether there are any packages available for Fedora. That would be something you'd need to figure out. You did mention you had "installed Gazebo 11"
  2. git clone the gazebo_ros_pkgs repository into a Catkin workspace
  3. use rosdep to install all dependencies. If rosdep doesn't recognise your Gazebo installation, try using skip-keys to make it ignore dependencies you are sure are present
  4. build your workspace

If that is successful, you now have gazebo_ros_pkgs and related packages.

See #q252478 for an overview of the steps.

gvdhoorn gravatar image gvdhoorn  ( 2020-09-02 09:03:41 -0500 )edit

Yes that's what I did, I ran rosdep check --from-paths . --ignore-src --rosdistro noetic then got:

ERROR[gazebo_dev]: No definition of [libgazebo11-dev] for OS [fedora]
        rosdep key : libgazebo11-dev
        OS name    : fedora
        OS version : 32
        Data:
debian:
                  buster:
                  - libgazebo11-dev
                ubuntu:
                  focal:
                  - libgazebo11-dev

I don't think I should use the skip-keys option on that, correct? Is there a way to get libgazebo11-dev on Centos/Fedora?

RobbieTheK gravatar image RobbieTheK  ( 2020-09-02 09:20:39 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-09-08 10:29:49 -0500

RobbieTheK gravatar image

I'll try to recap what I did to get this working.

  • First I git clone cmake_modules, control_toolbox, googletest, image_common, realtime_tools, ros_control, turtlebot3, turtlebot3_msgs, and tutrtlebot3_simulations in to src.

  • For Simbody I had to compile and make sure visualizer was turned on:

      cmake ~/simbody-source/simbody -DCMAKE_INSTALL_PREFIX=/usr/local/bin -DBUILD_VISUALIZER=on
    
  • For $PATH I made sure Anaconda Python was not listed.

Then it worked.

I'm still trying to get gazebo_ros working but I'll start a new discussion.

ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
gazebo_dev: No definition of [libgazebo11-dev] for OS [fedora]

Thanks for all of your help gvdhoorn.

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

1 follower

Stats

Asked: 2020-09-01 15:51:12 -0500

Seen: 552 times

Last updated: Sep 08 '20