First time here? Check out the FAQ!
answered 2016-03-26 20:16:34 -0500
Please don't post code that doesn't even compile. You should call the ros::init only once and you need to use ros::spin() so that the program does not terminate immediately.