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

Starting procrob_functional with a launchfile

asked 2013-02-20 00:49:22 -0600

Bison gravatar image

updated 2013-02-20 01:15:39 -0600

Hello there, i'm trying to launch the procrob_funtional face recognition tool via launchfile. By starting the Fserver via rosrun you have to go to the directory in which the "facedata.xml" etc. are stored. How can I realize that in a launchfile? I'm using ros groovy and the following code:

<launch>
  <node name="usb_cam" pkg="usb_cam" type="usb_cam_node" output="screen" >
    <param name="video_device" value="/dev/video0" />
    <param name="image_width" value="640" />
    <param name="image_height" value="480" />
    <param name="pixel_format" value="mjpeg" />
    <param name="camera_frame_id" value="usb_cam" />
    <param name="io_method" value="mmap"/>
  </node>
  <node name="Fserver" pkg="face_recognition" type="Fserver" output="screen"> 
    <param name="haarcascade_frontalface_alt" value="$(find face_recognition)/haarcascade_frontalface_alt.xml"/>
    <param name="facedata" value="$(find face_recognition)/facedata.xml"/>
    <param name="train" value="$(find face_recognition)/train.txt"/>
  </node>
  <node name="Fclient" pkg="face_recognition" type="Fclient" output="screen">
  </node>
</launch>

Thanks for your help!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-06-17 22:48:36 -0600

Pouyan gravatar image

you can use the 'cwd' attribute in your launch file. E.g.

<node name="fr_server" pkg="face_recognition" type="Fserver" cwd="node"/>

This sets the working directory to the directory where the executable is placed. In this case, then you just need to put all required input files ( haarcascade_frontalface_alt.xml, train.txt, facedata.xml and the data folder) in the bin folder of the face_recognition package.

edit flag offensive delete link more

Comments

Hi Pouyan, first of all, thanks for your answer. I tried the way you proposed, but when I enter the command for recognition nothing happens.

Bison gravatar image Bison  ( 2013-06-20 21:26:32 -0600 )edit

Hi Bison. Then the problem should be from somewhere else. Because if the working directory is not set correctly, you get error like "can not find haarcascade_frontalface_alt.xml" or so ..

Pouyan gravatar image Pouyan  ( 2013-06-23 05:54:44 -0600 )edit

Question Tools

Stats

Asked: 2013-02-20 00:49:22 -0600

Seen: 161 times

Last updated: Jun 17 '13