ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

tf2_ros transform_broadcaster with node component

asked 2019-08-22 16:09:15 -0500

zipp39 gravatar image

updated 2019-08-22 19:39:14 -0500

Geoff gravatar image

OS: WIndows 10 ROS 2 Version: Dashing

HI! I am trying to use tf2_ros/transform_broadcaster with a Node Component. My class is inherited from node, and when I call this from within the class, it returns an rclcpp:node_interfaces::NodeTopicsInterface *.

So, I am passing in this to the constructor, which is a template that takes in a NodeT Object.

I am getting a compilation error, that there is no conversion for NodeT to my class.

Why wouldn't this work?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-08-22 16:36:13 -0500

alsora gravatar image

You should definitely add a code snippet...

However, if I'm correctly understanding you have a problem with the following code:

class MyNode : public rclcpp::Node
{
    MyNode() : Node("my_node")
    {
        auto broadcaster = std::make_shared<tf2_ros::TransformBroadcaster>(this);
    }
};

If that is the case, a fix has been recently merged to master. https://github.com/ros2/rclcpp/pull/8...

Build the ROS2 master instead of Dashing in order to use it.

edit flag offensive delete link more

Comments

Thank you very much! I used a workaround for now where I used the created a sub node and passed that in.

Would this change be pushed in a patch release? Or is the only way to update the code to the newest changes to build ROS 2 from master.

zipp39 gravatar image zipp39  ( 2019-08-22 17:08:01 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2019-08-22 16:09:15 -0500

Seen: 223 times

Last updated: Aug 22 '19