Question about TfClient

This issue has been tracked since 2022-08-08.

Description
I am using a TfClient to subscribe to tf2_web_republisher to get the transform feedback. However, the subscribe callback never called if I subscribe to the TF outside the topic.subscribe callback. If I subscribe to the TF inside a topic.subscribe, I can get the feedback. Does it mean I have to subscribe to the TF inside the topic subscribe callback?

  • Library Version: 1.3
  • ROS Version: Melodic
  • Platform / OS: Ubuntu

Steps To Reproduce

    const ros = new Ros({
        url: "ws://localhost:9090",
    });

   const reset = new ROSLIB.Topic({
        ros,
        name: "/reset_time",
        messageType: "std_msgs/String",
    });
    const msg = new ROSLIB.Message({ data: "" });
   // clear old TF data
    reset.publish(msg);

   const tfClient = new ROSLIB.TFClient({
          ros,
          fixedFrame: "base_link",
          angularThres: 0.01,
          transThres: 0.01,
           rate: 10.0,
   });

  const topic = new Topic({
        ros: ros,
        name: "/map",
        messageType: "nav_msgs/OccupancyGrid",
        queue_length: 1,
    });

    // This doesn't work
   tfClient.subscribe('grid_map',(tf)=>{
           console.log(tf);
   })

  topic.subscribe((message) => {
      // This works
      tfClient.subscribe('grid_map',(tf)=>{
           console.log(tf);
   })
})

Expected Behavior

Actual Behavior

More Details About Repo
Owner Name RobotWebTools
Repo Name roslibjs
Full Name RobotWebTools/roslibjs
Language JavaScript
Created Date 2013-03-15
Updated Date 2022-11-22
Star Count 549
Watcher Count 54
Fork Count 340
Issue Count 66

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date