Ask Your Question
0

Multiple TF issues while running SLAM

asked 2018-06-02 07:20:16 -0500

Salahuddin_Khan gravatar image

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,

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

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
---
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-01-16 04:37:34 -0500

songyima gravatar image

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

edit flag offensive delete link more

Comments

Yes, you're right, that was the problem.

Salahuddin_Khan gravatar image Salahuddin_Khan  ( 2020-01-16 05:35:03 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-06-02 07:20:16 -0500

Seen: 203 times

Last updated: Jun 02 '18