0
$\begingroup$

Rosanswers logo

I have 2 kinects (v1 1414) running from the same launch file. I can access both in rviz but I have to switch Global Options > Fixed Frame from kinect1_link to kinect2_link.

#Question

How can I make both cameras be viewed in the same Fixed Frame ?

Launch file:

<launch>

    <arg name="camera1_id" default="#1" />
    <arg name="camera2_id" default="#2" />
    
    <arg name="camera1_name" default="kinect1" />
    <arg name="camera2_name" default="kinect2" />

  <!-- Launching first kinect-->
    <include file="$(find freenect_launch)/launch/freenect.launch">
        <arg name="device_id" value="$(arg camera1_id)" />
        <arg name="camera" value="$(arg camera1_name)" />
        <!--arg name="depth_registration" value="$(arg depth_registration)" /-->
     </include>

 <!-- Launching second kinect-->
    <include file="$(find freenect_launch)/launch/freenect.launch">
        <arg name="device_id" value="$(arg camera2_id)" />
        <arg name="camera" value="$(arg camera2_name)" />
     </include>

  </launch>

Originally posted by jacksonkr_ on ROS Answers with karma: 396 on 2017-05-08

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I needed to setup a new frame "multi_map" in my launch file which I set as the "fixed frame" in rviz:

<node pkg="tf" type="static_transform_publisher" name="kinect1_tf"
    args="0.0 0.0 0.0 0 0 0 1 multi_map kinect1_link 100" />

<node pkg="tf" type="static_transform_publisher" name="kinect2_tf"
    args="0.0 0.0 0.0 0 0 0 1 multi_map kinect2_link 100" />

You have to modify the args to get your camera images to display where you want them. You can find more info about that at http://wiki.ros.org/tf#static_transform_publisher under item 6.3


Originally posted by jacksonkr_ with karma: 396 on 2017-05-08

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.