solved problem with file read and ros::rate thing error by declaring it in the main()