I'm following the [C++ tutorial](http://wiki.ros.org/rosbag/Code%20API) and after I write down the code as .cpp file. What should I do next?
#include
#include
#include
int main(argc, char** argv)
{
ros::init(argc,argv,"bagit");
rosbag::Bag bag;
bag.open('test.bag',rosbag::bagmode::Write);
std_msgs::String str;
str.data=std::string("foo");
std_msgs::Int32 i;
i.data=42;
bag.write("chatter",ros::Time::now(),str);
bag.write("number",ros::Time::now(),i);
bag.close();
return 0;
}
↧