ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Book: Mastering ROS for Robotics Programming, 2nd Edn; Chapter 3 - Simulating Robot using ROS & Gazebo

asked 2016-08-30 21:43:46 -0500

updated 2016-09-06 20:48:47 -0500

I am facing many problems. I am trying to learn ROS from the book they have supported officially but unfortunately, I am facing problem. I tried to simulate the model given in Chapter 2 of the same book and faced problem which is already reported here.

Now in the sequel, I am trying to learn Gazebo to simulate 7DOF robot given in that chapter given online but when I run it, I get this error.

-- Could not find the required component 'controller_manager'. 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 /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
  Could not find a package configuration file provided by
  "controller_manager" with any of the following names:

    controller_managerConfig.cmake
    controller_manager-config.cmake

  Add the installation prefix of "controller_manager" to CMAKE_PREFIX_PATH or
  set "controller_manager_DIR" to a directory containing one of the above
  files.  If "controller_manager" provides a separate development package or
  SDK, be sure it has been installed.
Call Stack (most recent call first):
  chapter_3_codes/diff_wheeled_robot_control/CMakeLists.txt:7 (find_package)

-- Configuring incomplete, errors occurred!

I am using Ubuntu 16.04 under ROS Kinetic. I have also tried to run under Virtual Machine for Ubuntu 14.04 and ROS Indigo and got this error.

CMake Warning at /opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:76 (find_package): 

Could not find a package configuration file provided by "joy" with any of
  the following names:
joyConfig.cmake
joy-config.cmake

Add the installation prefix of "joy" to CMAKE_PREFIX_PATH or set "joy_DIR"
  to a directory containing one of the above files.  If "joy" provides a
  separate development package or SDK, be sure it has been installed.
Call Stack (most recent call first):
  chapter_3_codes/diff_wheeled_robot_control/CMakeLists.txt:7 (find_package)


-- Could not find the required component 'joy'. 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.

Edit 1: September 6, 2016

Are you sure you ran the rosdep commands properly? Were there any errors? If I look at chapter_3_codes/diff_wheeled_robot_control/package.xml for instance, I definitely see a <build_depend>controller_manager</build_depend> and a run_depend, which should have resulted in rosdep installing ros-$distro-controller-manager for you.

I followed these official tutorials (link) to thoroughly check the rosdep.. I also checked the installed packages by using command

apt-cache search ros-kinetic

and I did see these packages available in installation

ros-kinetic-control-msgs - control_msgs contains base messages and actions useful for controlling robots.
ros-kinetic-control-toolbox - The control toolbox contains modules that are useful across all controllers. 
ros-kinetic-controller-interface - Interface base class for controllers
ros-kinetic-controller-manager - The controller manager.
ros-kinetic-controller-manager-msgs - Messages and services for the controller manager.
ros-kinetic-controller-manager-tests - controller_manager_tests

So, I guess the necessary packages are still there. But still I tried to run as per your instructions to run this command.

sudo apt-get install python-rosinstall

and simply got this

Reading package lists... Done
Building dependency tree       
Reading state ...
(more)
edit retag flag offensive close merge delete

Comments

1

[..] the book they have supported officially [..]

Who is 'they' here, exactly? Afaict, the book is written by an author not affiliated with the OSRF?

gvdhoorn gravatar image gvdhoorn  ( 2016-08-31 02:54:30 -0500 )edit

This book is officially recommended by ROS for the beginners who wants to understand ROS step by step in 3-4 months.

Abdul Mannan gravatar image Abdul Mannan  ( 2016-09-01 01:37:59 -0500 )edit
1

Please update your question with the exact commands you used, in which order and the resulting output of all of them. Especially the command line and output of rosdep.

gvdhoorn gravatar image gvdhoorn  ( 2016-09-01 02:18:11 -0500 )edit
1

This book is officially recommended by ROS for the beginners

Can we see where this takes place? I do not think ROS (assuming you meant OSRF) recommends any book officially IMO.

130s gravatar image 130s  ( 2016-09-05 23:15:39 -0500 )edit

Good to hear you got it to work. For the future: if you download someone's code, always first run a rosdep install .. to make sure you have all dependencies installed. Assuming the author of the pkgs did his work, that should be enough.

And no need to thank me; this is why ROS Answers exists.

gvdhoorn gravatar image gvdhoorn  ( 2016-09-07 02:16:40 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
3

answered 2016-08-31 01:34:25 -0500

gvdhoorn gravatar image

updated 2016-09-06 02:40:02 -0500

You are missing packages. The errors you get tell you that at least controller_manager is not installed on your machine.

Most efficient way to fix this:

source /opt/ros/$DISTRO/setup.bash
rosdep update
rosdep install --from-paths /path/to/your/catkin_ws/src --ignore-src

Then follow the prompts.

I'd be surprised if the book didn't tell you about this though, it's a basic step to get someone else's sources working in your workspace.


Edit:

I am using Ubuntu 16.04 under ROS Kinetic. I have also tried to run it under Ubuntu 14.04 and ROS Indigo.

The controller_manager package has been released on both Indigo and Kinetic, so it should install on both. I cannot guarantee that all the other dependencies of the Mastering ROS for Robotics Programming book are available on Kinetic though. rosdep will tell you when it can't find something.


Edit2:

I tried but still the same. It is not working. Same error and same thing.

Are you sure you ran the rosdep commands properly? Were there any errors? If I look at chapter_3_codes/diff_wheeled_robot_control/package.xml for instance, I definitely see a <build_depend>controller_manager</build_depend> and a run_depend, which should have resulted in rosdep installing ros-$distro-controller-manager for you.

Did it install any new packages?


Edit3: just noticed that chapter_3_codes/seven_dof_arm_gazebo/package.xml does not list controller_manager as either a run or a build depend. But it also doesn't use it. So I'm wondering what kind of output you got from rosdep: does it say "All system dependencies have been satisified"?


Edit4:

I also checked the installed packages by using command

apt-cache search ros-kinetic

and I did see these packages available in installation

Afaik, apt-cache searches in all available packages, not just those installed on your machine. See what dpkg -l | grep controller-manager returns.

But still I tried to run as per your instructions to run this command.

sudo apt-get install python-rosinstall

I don't think I asked you to run that command. I asked you to run rosdep update and rosdep install .. (see top of answer).

I tried running this command rosdep install --from-paths src --ignore-src --rosdistro kinetic -y

and then I got this error. I guess, the problem lies here.

ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
amr_robots_description: Cannot locate rosdep definition for [urdf_tools]

That was indeed the command I asked you to run at the very beginning. The fact that it is failing here could mean that it doesn't continue to install all the other dependencies.

Can you please try the following command:

rosdep install --from-paths src --ignore-src --rosdistro kinetic -y -r

notice the -r that makes rosdep continue in case it can't find/install something.

Please run that command, and add the output of it to your original question.

We're particularly interested in any output mentioning the controller_manager package, or any of its dependencies.

edit flag offensive delete link more

Comments

Thank you so much gvdhoorn for your answer. I have tried the solution you proposed but it is not working. Please suggest me something. I am so stuck up here.

Abdul Mannan gravatar image Abdul Mannan  ( 2016-09-01 01:29:22 -0500 )edit
-2

answered 2017-11-27 19:35:42 -0500

Angel-J gravatar image

sudo apt-get install ros-indigo-controller-manager rosdep install --from-paths /path/to/your/catkin_ws/src --ignore-src

edit flag offensive delete link more

Comments

2

This is exactly what the accepted answer says to do, except this has less information and no explanation.

jayess gravatar image jayess  ( 2017-11-28 01:00:55 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2016-08-30 21:43:46 -0500

Seen: 2,984 times

Last updated: Nov 27 '17