ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
As @tfoote pointed out, you have to add geometry_msgs
package to the dependencies.
However, even after that, there are 2 errors in your C++ code
RCLCPP_INFO("derp");
This is not allowed, as the first argument to RCLCPP_* should be a logger object.
msg->linear[0]
this is not correct. The linear
field of the message is of type Vector3
, but it's not a vector.
Look at the implementation of this type here and you will see that you have to access to its fields using msg->linear.x
, msg->linear.y
, msg->linear.z