Communication between node and topic
Hi! I have this rqt_graph: rqt.png I wish /cmd_vel topic writes values on /mavros node. The node on which I work is mavros_node.cpp. Initially it was so:
#include <mavros/mavros.h>
int main(int argc, char *argv[])
{
ros::init(argc, argv, "mavros");
mavros::MavRos mavros;
mavros.spin();
return 0;
}
Now I have modified it for my case as well:
#include <mavros/mavros.h>
#include <geometry_msgs/TwistStamped.h>
int main(int argc, char **argv)
{
ros::init(argc, argv, "mavros");
ros::NodeHandle n;
ros::Subscriber mav_sub = n.subscribe<geometry_msgs::TwistStamped>("/cmd_vel", 10);
ros::Rate loop_rate(10);
mavros::MavRos mavros;
mavros.spin();
return 0;
}
but I can not fill with catkin_make because errors there are. Can anyone help me? Thanks in advance.
It would help if you list the commands you are running and the errors you are getting, and maybe a little about your workspace and environment (OS, ROS version).
I follow this steps:
(this is from https://github.com/mavlink/mavros/blo... )
can you paste your errors?