how to include turtlesim/msg/pose in my ROS2 program?

169 Views Asked by At

this is the error i keep on getting after working out different ways, what could be the possible error? I can clearly see the topic turtlesim/pose and the msg type turtlesim/msg/pose in the topic list in terminal but the compile is not detecting the directory and cannot able to include these are the CMakelist file and .xml file

what could be the problem?

1

There are 1 best solutions below

0
On

It would be better if you posted your code too. Or atleast a MRE

It is probably a typo, as starball mentioned in comments.

In any case, You can look at a working example in git. specificly:

  • you should include it with
#include <turtlesim/msg/pose.hpp>
  • and you can use it like:
pose_subscription_ = this->create_subscription<turtlesim::msg::Pose>(
            "turtle1/pose",
            1, std::bind(&SquareMove::pose_callback_, this, std::placeholders::_1));