0
$\begingroup$

Rosanswers logo

I am running ETH zurich's version of ORB SLAM on a bagfile of Kitti dataset of Stereo Images which I am playing at 0.1 r. The SLAM publishes TF in the camera's frame, world->cam0

  1. I am trying to publish a static transform between cam0 and base-link the following code using in the launch file,

while I am able to see it when I echo /tf_static

sal@sal:~/helper_ws$ rostopic echo /tf_static 
transforms: 
  - 
    header: 
      seq: 0
      stamp: 
        secs: 0
        nsecs:         0
      frame_id: "base_link"
    child_frame_id: "cam0"
    transform: 
      translation: 
        x: 1.0
        y: 0.0
        z: 0.5
      rotation: 
        x: -0.499999841466
        y: 0.499601836645
        z: -0.499999841466
        w: 0.500398163355
---

but when I do rosrun tf view_frames this is what I get image description

I am also unable to visualize it in Rviz which says no transform exists between cam0 and base_link

This same problem exists when I run S-PTAM slam ,I wrote a small code to subscribe to pose and republish a transform between a new frame odom to the cam_link and still face the same issue. This issue only occurs when I publish a static transform on moving frame like cam0 if I instead publish on some other new random frame everything works perfectly.

Not sure what is wrong.

<node pkg="tf2_ros" type="static_transform_publisher" name="camera_broadcaster" args="1 0 0.5 -1.57 0 -1.57 base_link camera_link" />

image description

here is sample tf data from orb_slam:

transforms: 
  - 
    header: 
      seq: 0
      stamp: 
        secs: 1385798169
        nsecs:  22117622
      frame_id: "world"
    child_frame_id: "cam0"
    transform: 
      translation: 
        x: 25.4732408315
        y: -1.2908452135
        z: 79.1472754724
      rotation: 
        x: 0.0172311913033
        y: 0.69976084093
        z: 0.00217123302013
        w: 0.714166043224
---
transforms: 
  - 
    header: 
      seq: 0
      stamp: 
        secs: 1385798169
        nsecs:  22117622
      frame_id: "world"
    child_frame_id: "cam0"
    transform: 
      translation: 
        x: 25.4732408315
        y: -1.2908452135
        z: 79.1472754724
      rotation: 
        x: 0.0172311913033
        y: 0.69976084093
        z: 0.00217123302013
        w: 0.714166043224
---
transforms: 
  - 
    header: 
      seq: 0
      stamp: 
        secs: 1385798169
        nsecs:  23126248
      frame_id: "world"
    child_frame_id: "cam0"
    transform: 
      translation: 
        x: 25.4732408315
        y: -1.2908452135
        z: 79.1472754724
      rotation: 
        x: 0.0172311913033
        y: 0.69976084093
        z: 0.00217123302013
        w: 0.714166043224
---

Originally posted by Salahuddin_Khan on ROS Answers with karma: 50 on 2018-06-02

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Hey, Did you solve the problem? I think it is because that one child frame can not have more one parent.


Originally posted by songyima with karma: 26 on 2020-01-16

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by Salahuddin_Khan on 2020-01-16:
Yes, you're right, that was the problem.

$\endgroup$

Your Answer

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