Visp_auto_tracker how to create a TF

asked 2018-01-17 03:54:56 -0500

Jeroenvdk gravatar image

updated 2018-01-17 04:33:01 -0500

Hi, I want to use visp_auto_tracker with 2 camera's so we have a better positioning. But what i don't understand is how I create a TF for this.. Can some one help me out with writing a TF for this? For example : https://www.youtube.com/watch?v=0cQXU5X0Yyk But then with visp, I don't understand where he is creating his TF.

Github StereoColorTracking

Comment on jayess:

So what I've tried is, understanding TF reading some tutorials. I looked into the github of the example I showed but I don't understand where he is using a TF function . Also there is a localization_tf in the visp_tracker but it is wrt to the map and not the camera. Also I found a package called external_camera_tf but it won't work on Indigo.. I'am very new to ros .

So I created a new launch file to launch the visp_auto_tracker with 2 cams. As you can see I made 2 static transforms for 2 webcams. But when i go to RVIZ the object is moving wrt to the map and to the camera's...

<!-- -*- xml -*-
   This launch file is made to launch the visp_auto_tracker with 2 camera's.
   The file is created and used by Fontys Hogescholen Engineering project group 10 S7.
   See http://www.ros.org/wiki/visp_auto_tracker for more information.
  -->
<launch>
<!-- camera transforms -->
    <node pkg="tf" type="static_transform_publisher" 
        name="front_cam_tf" args="0 0 1.0 3.14159265359 3.14159265359 1.570796326795 /map /front_camera 100"/>
        <node pkg="tf" type="static_transform_publisher" 
        name="top_cam_tf" args="0.20 0 1.0 3.14159265359 3.14159265359 1.570796326795 /map /top_camera 100"/>


  <!-- Launch the "front" tracking node -->
  <node pkg="visp_auto_tracker" type="visp_auto_tracker" name="visp_auto_tracker1" output="screen">
    <param name="model_path" value="$(find visp_auto_tracker)/models" />
    <param name="model_name" value="pattern" />
    <param name="debug_display" value="True" />       
    <remap from="/visp_auto_tracker1/camera_info" to="/usb_cam1/camera_info"/>
    <remap from="/visp_auto_tracker1/image_raw" to="/usb_cam1/image_raw"/>
  </node>

  <!-- Launch the "top" tracking node -->
  <node pkg="visp_auto_tracker" type="visp_auto_tracker" name="visp_auto_tracker2" output="screen">
    <param name="model_path" value="$(find visp_auto_tracker)/models" />
    <param name="model_name" value="pattern" />
    <param name="debug_display" value="True" />     
    <remap from="/visp_auto_tracker2/camera_info" to="/usb_cam2/camera_info"/>
    <remap from="/visp_auto_tracker2/image_raw" to="/usb_cam2/image_raw"/>
  </node>

  <!-- Launch the "front" usb camera acquisition node -->
  <node pkg="usb_cam" type="usb_cam_node" name="usb_cam1" output="screen">
    <param name="image_width" value="640" />
    <param name="image_height" value="480" />
    <param name="video_device" value="/dev/video2" />      
    <param name="pixel_format" value="yuyv" />
    <param name="auto_focus" type="bool" value="False" />
    <param name="camera_name" value="/camera/image_raw" />
    <param name="camera_info_url" value="package://visp_auto_tracker/models/calibration_top.ini" type="string" />
  </node>

  <!-- Launch the "top"usb camera acquisition node -->
  <node pkg="usb_cam" type="usb_cam_node" name="usb_cam2" output="screen">
    <param name="image_width" value="640" />
    <param name="image_height" value="480" />
    <param name="video_device" value="/dev/video1" />      
    <param name="pixel_format" value="yuyv" />
    <param name="auto_focus" type="bool" value="False" /> 
    <param name="camera_name" value="/camera/image_raw" />
    <param name="camera_info_url" value="package://visp_auto_tracker/models/calibration_front.ini" type="string" />
  </node>
</launch>

RVIZ viewhttps://imgur.com/a/37fkn

edit retag flag offensive close merge delete

Comments

What do you know? What have you tried so far (update your question with your attempts)? Anything that you can show that you've attempted something will better help you to get your question answered. Otherwise, it reads as "can you do my homework for me?"

jayess gravatar image jayess  ( 2018-01-17 04:00:41 -0500 )edit

So what I've tried is, understanding TF reading some tutorials. I looked into the github of the example I showed. Also there is a localization_tf in the visp_tracker but it is wrt to the map and not the camera. Also I found a package called external_camera_tf but it won't work on Indigo..

Jeroenvdk gravatar image Jeroenvdk  ( 2018-01-17 04:03:13 -0500 )edit

Can you please provide the link to the Github repo?

jayess gravatar image jayess  ( 2018-01-17 04:07:55 -0500 )edit
Jeroenvdk gravatar image Jeroenvdk  ( 2018-01-17 04:09:42 -0500 )edit

I searched the repo and only a static_transform is being used. Look at the tracker1 and tracker2 launch files.

jayess gravatar image jayess  ( 2018-01-17 04:17:19 -0500 )edit

Hi, jayess see my updated post please

Jeroenvdk gravatar image Jeroenvdk  ( 2018-01-17 04:32:13 -0500 )edit