Robowflex  v0.1
Making MoveIt Easy
ur5_io.cpp File Reference

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 14 of file ur5_io.cpp.

15 {
16  // Startup ROS
17  ROS ros(argc, argv);
18 
19  // Create the default UR5 robot.
20  auto ur5 = std::make_shared<UR5Robot>();
21  ur5->initialize();
22 
23  // Load a scene from a file.
24  auto scene = std::make_shared<Scene>(ur5);
25  scene->fromYAMLFile("package://robowflex_library/yaml/test.yml");
26 
27  // Output scene to a rosbag file.
28  {
29  IO::Bag bag_out("scene.bag", IO::Bag::WRITE);
30  bag_out.addMessage("scene", scene->getMessage());
31  }
32 
33  // Load the same scene from the rosbag file.
34  {
35  IO::Bag bag_in("scene.bag", IO::Bag::READ);
36 
37  // Load all `moveit_msgs::PlanningScene` from the topic `scene`.
38  auto msgs = bag_in.getMessages<moveit_msgs::PlanningScene>({"scene"});
39  }
40 
41  return 0;
42 }
rosbag management class to ease message saving and loading.
Definition: bag.h:23
RAII-pattern for starting up ROS.
Definition: util.h:52
Functions for loading and animating scenes in Blender.