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

ros::package::getPath() Problem

asked 2012-07-23 03:44:26 -0500

Dark-Valentine gravatar image

Hey there,

i've a problem using the getPath() function from roslib package. I need the package path to read out some images for a gui. In ROS Electric the code snippet below works, but since the import to ROS Fuerte I get following error while linking the package:

...RoombaDashboard.cpp:43: undefined reference to `ros::package::getPath(std::basic_string<char, std::char_traits<char="">, std::allocator<char> > const&)'

#include <ros/package.h>

...

/* Load PNGs */
wxString imgPath = wxString::FromAscii((
    ros::package::getPath("roomba_dashboard") + "/gui/").c_str());

Does anyone have an idea why this error occurs!? The source code seems to be right...

Thank you und best regards Stefan

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
10

answered 2012-07-23 04:14:04 -0500

Dark-Valentine gravatar image

The problem is solved...

It seems that the roslib package isn't a dependency of roscpp anymore. Adding the roslib package as dependency to my package makes it linkable.

roscpp manifest.xml in electric

...
<depend package="roslib"/>
...

roscpp manifest.xml in fuerte

<package>
  <description brief="ROS C++ client library">

...

  </description>
  <author>Morgan Quigley mquigley@cs.stanford.edu, Josh Faust jfaust@willowgarage.com, Brian Gerkey gerkey@willowgarage.com, Troy Straszheim straszheim@will$
  <license>BSD</license>
  <review status="Doc reviewed"/>
  <url>http://ros.org/wiki/roscpp</url>
  <depend package="roslang"/>
  <export>
    <cpp cflags="`PKG_CONFIG_PATH=${prefix}/../../lib/pkgconfig pkg-config --cflags roscpp`"
         lflags="`PKG_CONFIG_PATH=${prefix}/../../lib/pkgconfig pkg-config --libs roscpp`"/>
    <roslang cmake="${prefix}/rosbuild/roscpp.cmake"/>
  </export>
  <rosdep name="pkg-config"/>

</package>

Thanks anyway!

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-07-23 03:44:26 -0500

Seen: 9,961 times

Last updated: Jul 23 '12