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

Install custom catkin package on Raspbian

asked 2018-05-15 09:36:45 -0500

r00t8 gravatar image

updated 2018-05-16 07:10:44 -0500

Hello,

I have some problem. I made a custom package on ros kinetic (ubuntu 16.04) previously and is working fine. Recently I am trying to use it on a Raspberry Pi3 (Raspbian).

I have successfully installed ROS following official tutorial so actually I have a ros_catkin_ws directory with necessary sources compiled. I also manged to install a release package (p2os_driver) from github using ros-install, wstool, catkin_make_isolated.

So now I have my catkin package test (which contains launch and src directories with packgae.xml and CMake). On Ubuntu this folder was located in catkin_ws and all I had to do was catkin_make, source catkin_ws/devel/setup.bash.

So my question is, how can I import this package into my new installation on Raspbian ? I tried several things, copying it in ros_catkin_ws/src then catkin_make_isolated this specific package, tried to make an overlay catkin workspace (without amstering it at all so maybe I did it wrong) so I can use catkin_make (but this only get me a "can't find rosout" when doing "roslaunch test test.launch").

Maybe I got it wrong when using "source" also. Currently I have ROS_PACKAGE_PATH set to "/opt/ros/kinetic/share". Or I missed a catkin_init_workspace somehow.

Thanks for your help.

Edit :

Thanks for answering. Still in trouble though. When running catkin_make in my second worspace (catkin_ws), I got this (after having sourced ros_catkin_ws/devel/setup.bash):

    +++ processing catkin package: 'test'
-- ==> add_subdirectory(test)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
CMake Error at /opt/ros/kinetic/share/p2os_driver/cmake/p2os_driverConfig.cmake:148 (message):
  Project 'test' tried to find library 'p2os_driver'.  The library is
  neither a target nor built/installed properly.  Did you compile project
  'p2os_driver'? Did you find_package() it before the subdirectory containing
  its code is included?
Call Stack (most recent call first):
  /home/pi/ros_catkin_ws/devel/share/catkin/cmake/catkinConfig.cmake:76 (find_package)
  test/CMakeLists.txt:10 (find_package)

However p2os_driver is, I think, properly built in main workspace (ros_catwin_ws) since I got no error doing :

sudo ~/ros_catkin_ws/src/catkin/bin/catkin_make_isolated -j1 --install --install-space /opt/ros/kinetic -DCMAKE_BUILD_TYPE=Release --pkg p2os_driver

Is there something I am doing wrong with dependencies ? I created "test" package in catkin_ws doing

catkin_create_pkg test rospy p2os_driver nav_msgs tf
edit retag flag offensive close merge delete

Comments

Project 'test' tried to find library 'p2os_driver'.

could you show the CMakeLists.txt of the test pkg that you created? Please omit all the boilerplate comments (lines starting with #), they are not needed.

gvdhoorn gravatar image gvdhoorn  ( 2018-05-16 07:27:12 -0500 )edit

project(test)

find_package(catkin REQUIRED COMPONENTS nav_msgs p2os_driver rospy tf )

r00t8 gravatar image r00t8  ( 2018-05-16 07:47:42 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-05-15 10:14:12 -0500

gvdhoorn gravatar image

updated 2018-05-16 08:06:32 -0500

Overlaying (or chaining) is what would probably be the most natural (and efficient) way to do this.

I would:

  1. make sure you've not sourced anything
  2. source your current ros_catkin_ws (either devel or install, depending on how you set things up)
  3. go to the root of your new catkin ws
  4. run catkin_make

This should build just the new package, while making use of the other workspace as the underlay that contains all the base ROS packages.

After building, source the devel/setup.bash of your new workspace and everything should work.

PS: I've left out the step making sure all dependencies of your new package are actually present on your Pi. If they aren't, you'll need to fix that before trying to build.


Edit:

When running catkin_make in my second worspace (catkin_ws), I got this (after having sourced ros_catkin_ws/devel/setup.bash)

From your later comment you appear to have an install space under /opt/ros/kinetic. I would recommend you source that, not the devel space of your underlying workspace.

re: cannot find p2os_driver: if you open a new terminal (make sure to not auto-source anything), source /opt/ros/kinetic/setup.bash and then do a rospack find p2os_driver, does that return successfully?


Edit2: I believe you're running into this issue because the CMakeLists.txt of the p2os_driver package is faulty.

It has this (from here):

catkin_package(
  INCLUDE_DIRS include
  LIBRARIES p2os_driver
  CATKIN_DEPENDS p2os_msgs nav_msgs roscpp geometry_msgs diagnostic_updater tf std_msgs kdl_parser
)

Notice the LIBRARIES p2os_driver bit.

That makes Catkin believe that this package produces a library called libp2os_driver.so, and it will export that information to whoever find_package(catkin .. COMPONENTS p2os_driver ..). This is passed to CMake, and it will start looking for that library.

But p2os_driver does not build any libraries, only a single executable binary and that is called p2os_driver (here). That is most likely the cause of your problems.

For now: remove (or comment) the LIBRARIES p2os_driver line from the catkin_package(..) statement in the CMakeLists.txt of the p2os_driver package. You'll have to rebuild the package, and have Catkin install it to your install space as well.

And please report this in an issue over at allenh1/p2os/issues.

edit flag offensive delete link more

Comments

Yes, gives me /opt/ros/kinetic/share/p2os_driver

r00t8 gravatar image r00t8  ( 2018-05-16 07:22:48 -0500 )edit

Ok. Can you try what you did earlier, but now after source-ing /opt/ros/kinetic as you did just now?

gvdhoorn gravatar image gvdhoorn  ( 2018-05-16 07:26:15 -0500 )edit

Exactly the same error that previously when source-ing ~/ros_catkin_ws/devel/

r00t8 gravatar image r00t8  ( 2018-05-16 07:32:14 -0500 )edit

Editing CMakeLists.txt from p2os_driver package worked. Thanks for your help.

r00t8 gravatar image r00t8  ( 2018-05-16 09:18:10 -0500 )edit

Could you please post a link to the issue over at allenh1/p2os so we keep things connected?

gvdhoorn gravatar image gvdhoorn  ( 2018-05-16 09:19:19 -0500 )edit

Question Tools

Stats

Asked: 2018-05-15 09:36:45 -0500

Seen: 250 times

Last updated: May 16 '18