Robowflex  v0.1
Making MoveIt Easy
ur5.cpp
Go to the documentation of this file.
1 /* Author: Zachary Kingston */
2 
4 #include <robowflex_library/io.h>
6 
7 using namespace robowflex;
8 
9 const std::string //
10  UR5Robot::DEFAULT_URDF{"package://ur_description/urdf/ur5_robotiq_robot_limited.urdf.xacro"};
11 const std::string //
12  UR5Robot::DEFAULT_SRDF{"package://ur5_robotiq85_moveit_config/config/ur5_robotiq85.srdf"};
13 const std::string //
14  UR5Robot::DEFAULT_LIMITS{"package://ur5_robotiq85_moveit_config/config/joint_limits.yaml"};
15 const std::string //
16  UR5Robot::DEFAULT_KINEMATICS{"package://ur5_robotiq85_moveit_config/config/kinematics.yaml"};
17 const std::string //
19  "package://ur5_robotiq85_moveit_config/config/ompl_planning.yaml" //
20  };
21 
22 const std::string //
23  UR5Robot::RESOURCE_URDF{"package://robowflex_resources/ur/robots/ur5_robotiq_robot_limited.urdf.xacro"};
24 const std::string //
25  UR5Robot::RESOURCE_SRDF{"package://robowflex_resources/ur/config/ur5/ur5_robotiq85.srdf.xacro"};
26 const std::string //
27  UR5Robot::RESOURCE_LIMITS{"package://robowflex_resources/ur/config/ur5/joint_limits.yaml"};
28 const std::string //
29  UR5Robot::RESOURCE_KINEMATICS{"package://robowflex_resources/ur/config/ur5/kinematics.yaml"};
30 const std::string //
32  "package://robowflex_resources/ur/config/ur5/ompl_planning.yaml" //
33  };
34 
36 {
37 }
38 
40 {
41  bool success = false;
42 
43  // First attempt the `robowflex_resources` package, then attempt the "actual" resource files.
45  {
46  RBX_INFO("Initializing UR5 with `ur_description`");
48  }
49  else
50  {
51  RBX_INFO("Initializing UR5 with `robowflex_resources`");
53  }
54 
55  loadKinematics("manipulator");
56 
57  return success;
58 }
59 
61  : OMPLPipelinePlanner(robot, name)
62 {
63 }
64 
66  const std::vector<std::string> &adapters)
67 {
68  if (IO::resolvePackage(RESOURCE_CONFIG).empty())
69  return OMPLPipelinePlanner::initialize(DEFAULT_CONFIG, settings, DEFAULT_PLUGIN, adapters);
70  return OMPLPipelinePlanner::initialize(RESOURCE_CONFIG, settings, DEFAULT_PLUGIN, adapters);
71 }
A robowflex::PipelinePlanner that uses the MoveIt! default OMPL planning pipeline.
bool initialize(const std::string &config_file="", const Settings &settings=Settings(), const std::string &plugin=DEFAULT_PLUGIN, const std::vector< std::string > &adapters=DEFAULT_ADAPTERS)
Initialize planning pipeline. Loads OMPL planning plugin plugin with the planning adapters adapters....
Settings descriptor for settings provided by the default MoveIt! OMPL planning pipeline.
bool initialize(const Settings &settings=Settings(), const std::vector< std::string > &adapters=DEFAULT_ADAPTERS)
Initialize the planning context. All parameter provided are defaults.
Definition: ur5.cpp:65
UR5OMPLPipelinePlanner(const RobotPtr &robot, const std::string &name="")
Constructor.
Definition: ur5.cpp:60
static const std::string DEFAULT_CONFIG
Default planning configuration.
Definition: ur5.h:82
static const std::string RESOURCE_CONFIG
Planning configuration from robowflex_resources.
Definition: ur5.h:83
A shared pointer wrapper for robowflex::Robot.
Loads information about a robot and maintains information about a robot's state.
bool initialize(const std::string &urdf_file)
Initializes a robot from a kinematic description. A default semantic description is used.
bool loadKinematics(const std::string &group, bool load_subgroups=true)
Loads the kinematics plugin for a joint group and its subgroups. No kinematics are loaded by default.
bool initialize()
Initialize the robot with manipulator kinematics.
Definition: ur5.cpp:39
UR5Robot()
Constructor.
Definition: ur5.cpp:35
static const std::string RESOURCE_KINEMATICS
kinematics from robowflex_resources
Definition: ur5.h:47
static const std::string DEFAULT_SRDF
Default SRDF.
Definition: ur5.h:40
static const std::string DEFAULT_LIMITS
Default Limits.
Definition: ur5.h:41
static const std::string DEFAULT_URDF
Default URDF.
Definition: ur5.h:39
static const std::string RESOURCE_URDF
URDF from robowflex_resources.
Definition: ur5.h:44
static const std::string RESOURCE_LIMITS
Limits from robowflex_resources.
Definition: ur5.h:46
static const std::string RESOURCE_SRDF
SRDF from robowflex_resources.
Definition: ur5.h:45
static const std::string DEFAULT_KINEMATICS
Default kinematics.
Definition: ur5.h:42
#define RBX_INFO(fmt,...)
Output a info logging message.
Definition: log.h:118
Functions for loading and animating robots in Blender.
std::string resolvePackage(const std::string &path)
Resolves package:// URLs to their canonical form. The path does not need to exist,...
Main namespace. Contains all library classes and functions.
Definition: scene.cpp:25