Hello,
How do I create a single node that has both a subscriber AND a publisher?
I need it to solve the quiz at the end of the forth model.
When I try to write the following
ros::Publisher pub = nh.advertise<geometry_msgs::Twist>("cmd_vel", 1000);
ros::Subscriber sub = nh.advertise<sensor_msgs::LaserScan>("LaserScan", 1000);
I get the following error:
"No viable conversion from ‘ros::Publisher’ to ‘ros::Subscriber’ "
I’ve looked for a solution for a few days but I can’t figure how to do it.