So far I achieved 7/10 of Quiz1 for failing to subscribe to /kobuki/laser/scan However, I do have a subscriber to that topic in my cpp file. And rostopic info /kobuki/laser/scan did display a subscriber to it.
I can not tell what is going wrong with my subscriber part.
This is my main function:
int main(int argc, char **argv) {
ros::init(argc, argv, “topics_quiz_node”);
ros::NodeHandle nh;
pub = nh.advertise<geometry_msgs::Twist>(“cmd_vel”, 1000);
ros::Subscriber sub = nh.subscribe("/kobuki/laser/scan", 1000, avoid_wall);
ros::spin();
return 0;
}