Robowflex  v0.1
Making MoveIt Easy
ur5_ik.cpp
Go to the documentation of this file.
1 /* Author: Zachary Kingston */
2 
7 
8 using namespace robowflex;
9 
10 /* \file ur5_ik.cpp
11  * Simple demonstration of how to use IK.
12  */
13 
14 int main(int argc, char **argv)
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  ur5->setGroupState("manipulator", {0.0677, -0.8235, 0.9860, -0.1624, 0.0678, 0.0});
23 
24  // Use IK to shift robot arm over by desired amount.
25  RobotPose goal_pose = ur5->getLinkTF("ee_link");
26  goal_pose.translate(Eigen::Vector3d{0.0, -0.3, 0.0});
27 
28  if (not ur5->setFromIK(Robot::IKQuery("manipulator", goal_pose)))
29  {
30  RBX_ERROR("IK Failed");
31  return 1;
32  }
33 
34  return 0;
35 }
RAII-pattern for starting up ROS.
Definition: util.h:52
#define RBX_ERROR(fmt,...)
Output a error logging message.
Definition: log.h:102
Main namespace. Contains all library classes and functions.
Definition: scene.cpp:25
std::decay< decltype(std::declval< moveit::core::Transforms >().getTransform("")) >::type RobotPose
A pose (point in SE(3)) used in various functions. Defined from what MoveIt! uses.
Definition: adapter.h:24
Robot IK Query options. IK queries in Robowflex consist of: a) A position specified by some geometric...
int main(int argc, char **argv)
Definition: ur5_ik.cpp:14