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

How to use gscam with ar_pose?

asked 2014-06-23 09:12:25 -0600

VG gravatar image

updated 2014-06-23 09:16:36 -0600

BennyRe gravatar image

Hi, I'm new to ROS and I'm trying to use ar_pose live tracking with webcam in the laptop (using gscam). But I'm not receiving any image in rviz. This is the error I receive in the terminal

[ERROR] [1403618585.907565185]: No camera_parameters.txt file found.  Use default file if no other is available.
ERROR: cannot launch node of type [ar_pose/ar_single]: can't locate node [ar_single] in package [ar_pose]
Processing...
[rviz-1] process has died [pid 10906, exit code -11, cmd /opt/ros/hydro/lib/rviz/rviz -d /home/gautham/hydro_workspace/sandbox/src/ar_tools/ar_pose/launch/live_single.rviz __name:=rviz __log:=/home/gautham/.ros/log/8edb2bfe-fb8f-11e3-8219-b13485d129c0/rviz-1.log].

This is my launch file

<launch>
  <node pkg="rviz" type="rviz" name="rviz" 
    args="-d $(find ar_pose)/launch/live_single.rviz"/>
  <node pkg="tf" type="static_transform_publisher" name="world_to_cam" 
    args="0 0 0.5 -1.57 0 -1.57 world camera 10" />
  <node ns="camera/gscam" pkg="image_proc" type="image_proc" name="image_proc"/>
  <node ns="camera" pkg="gscam" type="gscam" name="gscam"
    respawn="false" output="screen">
    <param name="width" type="int" value="320" />
    <param name="height" type="int" value="240" />
    <param name="fps" type="int" value="30" />
    <param name="frame" type="string" value="camera" />
    <param name="device" type="string" value="/dev/video0" />
    <param name="camera_info_url" type="string"
      value="camera/gscam/camera_info" />
  </node>
  <node name="ar_pose" pkg="ar_pose" type="ar_single" respawn="false"
    output="screen">
    <param name="marker_pattern" type="string"
      value="$(find ar_pose)/data/4x4/4x4_1.patt"/>
    <param name="marker_width" type="double" value="152.4"/>
    <param name="marker_center_x" type="double" value="0.0"/>
    <param name="marker_center_y" type="double" value="0.0"/>
    <param name="threshold" type="int" value="100"/>
    <param name="use_history" type="bool" value="true"/>
  </node>
</launch>

And in the rviz file:
Image Topic: camera/gscam/image_raw

Any help is appreciated. Thanks in advance :)

edit retag flag offensive close merge delete

Comments

I've got the same problem, but I'm using the same node setting as in gscam/examples/v4l.launch. It gives no error in terminal but still cannot receive image.But the image_view worked fine .

EwingKang gravatar image EwingKang  ( 2014-06-30 05:50:24 -0600 )edit

Hi! Check the depencencies rosdep install ar_pose and then build it using rosmake ar_pose. it worked for me!

Jack Gamboa gravatar image Jack Gamboa  ( 2015-02-15 11:08:15 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2016-04-14 09:34:51 -0600

updated 2016-04-14 09:36:07 -0600

Looking at your error seems that ar_single is not located, therefore it's not a problem relative to gscam. Did you source the setub.bash file after compiling ar_pose?

Anyway I attached you my launch file:

<launch>

  <!-- Launch RVIZ as visualizer -->
  <node pkg="rviz" type="rviz" name="rviz"
    args="-d $(find ar_pose)/launch/live_single.rviz"/>

  <!-- Launch the static transform publisher for world to camera -->
  <node pkg="tf" type="static_transform_publisher" name="world_to_cam"  args="0 0 0.5 -1.57 0 -1.57 world camera 10" />

  <!-- Launch the image rectification node -->
  <!--<node ns="camera" pkg="image_proc" type="image_proc" name="image_proc"/>-->

  <!-- Start the GSCAM node -->
  <!-- devide=/dev/video0 for webcam, /dev/video1 for usbcamera -->
<env name="GSCAM_CONFIG" value="v4l2src device=/dev/video0 ! video/x-raw-yuv,framerate=30/1,width=640,height=480 ! ffm$
  <node pkg="gscam" type="gscam" name="gscam" output="screen">
    <param name="width" type="int" value="640" />
    <param name="height" type="int" value="480" />
    <param name="fps" type="int" value="30" />
    <param name="frame_id" type="string" value="camera" />
    <param name="camera_info_url" type="string"
      value="file://$(find gscam)/camera_calibration.yaml" />
  </node>

  <node name="ar_pose" pkg="ar_pose" type="ar_single" respawn="false"
    output="screen">
    <param name="marker_pattern" type="string"
      value="$(find ar_pose)/data/4x4/4x4_1.patt"/>
    <param name="marker_width" type="double" value="152.4"/>
    <param name="marker_center_x" type="double" value="0.0"/>
    <param name="marker_center_y" type="double" value="0.0"/>
    <param name="threshold" type="int" value="100"/>
    <param name="use_history" type="bool" value="true"/>


  </node>
</launch>
edit flag offensive delete link more
-1

answered 2014-08-04 14:31:26 -0600

Sudarshan gravatar image

updated 2014-08-04 14:55:30 -0600

Hi, I'm using gscam with ar_pose and am able to get an image in rviz. However, ar_pose_marker is only giving me "Failed to locate marker". Here is the launch file that I use:

<launch>
  <!-- Launch the camera acquisition node -->
  <node pkg="gscam" type="gscam" name="gscam" output="screen">      
    <param name="image_width" type="int" value="640" />
    <param name="image_height" type="int" value="480" />
    <param name="video_device" type="string" value="/dev/video0" />      
    <param name="pixel_format" type="string" value="yuyv" />
    <param name="frame_id" type="string" value="camera" />
  </node>

  <!-- Launch the static transform publisher for world to camera -->
  <node pkg="tf" type="static_transform_publisher" name="world_to_cam" 
    args="0 0 0.5 -1.57 0 -1.57 world camera 10" />

  <!-- Launch the ar_pose_single node -->
  <node name="ar_pose" pkg="ar_pose" type="ar_single" respawn="false"
    output="screen">
    <param name="marker_pattern" type="string"
      value="$(find ar_pose)/data/patt.hiro"/>
    <param name="marker_width" type="double" value="80.0"/>
    <param name="marker_center_x" type="double" value="0.0"/>
    <param name="marker_center_y" type="double" value="0.0"/>
    <param name="threshold" type="int" value="101"/>
    <param name="use_history" type="bool" value="true"/>
    <param name="publish_visual_markers" type="bool" value="true"/>
    <param name="publish_tf" type="bool" value="true"/>
    <param name="marker_frame" type="string" value="ar_marker"/>
    <param name="reverse_transform" type="bool" value="true"/>
  </node>

  <node pkg="rviz" type="rviz" name="rviz" 
    args="-d $(find ar_pose)/launch/live_single.rviz"/>

  <!-- Launch the image rectification node -->
  <node ns="camera" pkg="image_proc" type="image_proc" name="image_proc" output="screen"/>
</launch>

I also have set the GSCAM_CONFIG:

export GSCAM_CONFIG="v4l2src device=/dev/video0 ! video/x-raw-rgb,framerate=30/1 ! ffmpegcolorspace"

With this I am able to the image on rviz: rviz with image running ar_pose

However, as I said earlier ar_pose_marker doesn't really output anything with the ar_pose node printing "Failed to locate marker" debug message. All I get from the ar_pose_marker node is "??? 3" if I put the marker in front of the camera.

edit flag offensive delete link more

Comments

This is not an answer.

tfoote gravatar image tfoote  ( 2014-10-30 12:29:46 -0600 )edit

Question Tools

3 followers

Stats

Asked: 2014-06-23 09:12:25 -0600

Seen: 920 times

Last updated: Apr 14 '16