Quantcast
Channel: ROS Answers: Open Source Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 475

how to use rosbag API?

$
0
0
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; }

Viewing all articles
Browse latest Browse all 475

Trending Articles