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

ar_pose/ARMarkers.h not found

asked 2013-06-14 03:53:41 -0600

benngee gravatar image

updated 2013-06-27 02:13:54 -0600

Hi, i am trying to include the ar_pose/ARMarkers.h header in a ROS node with

#include <ar_pose/ARMarkers.h>

I added artoolkit and ar_pose to the dependencies in the manifest file. But when making my package, it says "ar_pose/ARMarkers.h : No such file or directory"

rospack find artoolkit and rospack find ar_pose successfully bring up the path to these packages

I am using fuerte and installed the ar toolkit through ccny_vision first

the ARMarker(s).h is located at ccny_vision/ar_pose/msg_gen/cpp/include/ar_pose. I copied the files to /ccny_vision/ar_pose/include/ar_pose but nothing helped.

update: The files using AR Toolkit should be in the correct path, i got some other includes (pcl and ros) that work. AR and my package are in an extra path i added in my /home/user space because i have to work without superuser rights. The path is included in the ROS_PACKAGE_PATH. What makes me wonder is, that the packages can be located with ROS but when compiling it fails...

update:

I downloaded the bag files today to test if the package itself works correct. The demo_mutli and demo_single do work properly

Also tried now with the newer ar_toolkti package from IHeartEngineering, getting the same error when including

manifest.xml
    <package>
      <description brief="obstacle_detection">

         obstacle_detection

  </description>
  <author>me</author>
  <license>BSD</license>
  <review status="unreviewed" notes=""/>
  link deleted, insufficient karma
  <depend package="pcl"/>
  <depend package="pcl_ros"/>
  <depend package="roscpp"/>
  <depend package="sensor_msgs"/>
  <depend package="artoolkit"/>
  <depend package="ar_pose"/>

</package>

code

#include <ros/ros.h>
#include <ar_pose/ARMarkers.h>

void processing (const ar_pose::ARMarkers::ConstPtr& msg){

    ar_pose::ARMarker ar_pose_marker;

    for(i=0;i<=msg->markers.size();i++){
      ar_pose_marker = msg->markers.at(i);
      std::cout<<"x " << ar_pose_marker.pose.pose.position.x<<st::endl;
      std::cout<<"y " << ar_pose_marker.pose.pose.position.y<<st::endl;
      std::cout<<"z " << ar_pose_marker.pose.pose.position.z<<st::endl;

    }
}


int main (int argc, char** argv)
{
  // Initialize ROS
  ros::init (argc, argv, "locateCamera");
  ros::NodeHandle nh;


  // Create a ROS subscriber
  ros::Subscriber sub = nh.subscribe ("input", 1, processing);

  ros::spin ();
}

What do i make wrong? Thanks for helping me.

Update:

Looks like the problem is solved now. When compiling the ARtoolkit packages indirect through my ros package, the ARMarkers.h gets found. So just cloning the AR Packages but not running make or rosmake in the folders and instead let the own package call this when rosmaking solved this problem.

Thank you very much

edit retag flag offensive close merge delete

Comments

1

This file is generated automatically by rosbuild_genmsg(). If you want to copy it in your package, you should copy the msg file in your package and do a rosmake, then you can include #include <yourPackage/ARMarkers.h> but normally you don't have to do that.

jep31 gravatar image jep31  ( 2013-06-14 04:06:06 -0600 )edit
1

did you managed to compile the examples that came with the ccny_vision stack?

Procópio gravatar image Procópio  ( 2013-06-14 04:08:01 -0600 )edit

i did not compile examples explicit, i ran rosmake for the packages successfully. Tomorrow i will look for these examples and post here what i found. The idea to copy the msg files will be an "emergency plan" but normally it should work out of the AR package

benngee gravatar image benngee  ( 2013-06-15 12:19:59 -0600 )edit
2

Copying the msg files will probably not work; you should really try to solve the underlying problem

Martin Günther gravatar image Martin Günther  ( 2013-06-17 22:03:22 -0600 )edit

Hmm, this is strange. Your manifest.xml file looks correct. Could you just upload your code somewhere?

Martin Günther gravatar image Martin Günther  ( 2013-06-18 03:38:13 -0600 )edit

3 Answers

Sort by » oldest newest most voted
3

answered 2013-06-19 01:40:51 -0600

I've tried your code, and it compiles for me without problems. I had to change two small things so it compiles, but here's the finished version: Github Gist.

Try it like this:

mkdir ~/test
cd ~/test
git clone https://gist.github.com/5813581.git obstacle_detection
git clone git://github.com/IHeartEngineering/ar_tools.git
source /opt/ros/fuerte/setup.sh
export ROS_PACKAGE_PATH=~/test:$ROS_PACKAGE_PATH
rosmake obstacle_detection

This is how your environment should look like:

$ env | grep ROS
ROS_ROOT=/opt/ros/fuerte/share/ros
ROS_PACKAGE_PATH=~/test:/opt/ros/fuerte/share:/opt/ros/fuerte/stacks
ROS_MASTER_URI=http://localhost:11311
ROS_ETC_DIR=/opt/ros/fuerte/etc/ros
ROS_DISTRO=fuerte
ROSLISP_PACKAGE_DIRECTORY=/opt/ros/fuerte/share/common-lisp/ros
edit flag offensive delete link more

Comments

Thank you for the hints. As soon as i finnished clonig i will try it out. My envirmonment looks like the one you posted above.

Great. it compiled now successful. It looks like the Problem was, that i ran "make" in the AR packages first and it somehow messed up the package

benngee gravatar image benngee  ( 2013-06-27 01:46:18 -0600 )edit
2

answered 2013-06-16 17:04:57 -0600

Kei Okada gravatar image

As far as I understand the maintainer of ar_tools has move to iheart engineering team, see https://github.com/IHeartEngineering/ar_tools

edit flag offensive delete link more

Comments

i tried today with the ar_tools package, it results in the same problem

benngee gravatar image benngee  ( 2013-06-18 01:23:24 -0600 )edit

This is the correct repo, it's what we use. Probably something wrong with your manifest.xml or ROS_PACKAGE_PATH, as the other answers/comments suggest.

Martin Günther gravatar image Martin Günther  ( 2013-06-18 02:39:43 -0600 )edit

the ROS_PACKAGE_PATH contains: opt/ros/fuerte/share:/opt/ros/fuerte/stacks:/home/myname/ros ar_toolkit and mypackage are located there. So the problem may be in the manifestxml. I will edit it in the startpost

benngee gravatar image benngee  ( 2013-06-18 02:49:54 -0600 )edit
1

answered 2013-06-15 13:09:00 -0600

Procópio gravatar image

if you did rosmake without any error, you should have compiled it properly. now the problem is that you are creating your new program at some folder that is not part of ROS path. as a test, you can try to move your file inside ar_pose src file and change your cmakelist to compile it to, see if it goes ok...

edit flag offensive delete link more

Comments

i got some other includes (pcl and ros) that work. AR and my package are in an extra path i added in my /home/user space because i have to work without superuser rights. The path is included in the ROS_PACKAGE_PATH

benngee gravatar image benngee  ( 2013-06-18 01:53:55 -0600 )edit

Question Tools

Stats

Asked: 2013-06-14 03:53:41 -0600

Seen: 1,075 times

Last updated: Jun 27 '13