92 auto ur5 = std::make_shared<UR5Robot>();
96 ur5->setGroupState(
GROUP, {0.0677, -0.8235, 0.9860, -0.1624, 0.0678, 0.0});
97 const auto &ee = ur5->getModel()->getEndEffectors()[0]->getLinkModelNames()[0];
102 RBX_INFO(
"RViz Initialized! Press enter to continue (after your RViz is setup)...");
106 auto scene = std::make_shared<Scene>(ur5);
107 scene->getCurrentState() = *ur5->getScratchState();
108 rviz.updateScene(
scene);
111 auto planner = std::make_shared<CustomTrajOptPlanner>(ur5,
GROUP);
112 planner->initialize(
GROUP);
113 planner->options.num_waypoints = 17;
116 EigenSTL::vector_Vector3d directions = {
117 {0.0, -0.3, 0.0}, {0.0, 0.0, -0.2}, {0.0, 0.3, 0.0}, {0.0, 0.0, 0.2}};
120 for (
size_t i = 0; i < directions.size(); ++i)
123 pose.translate(directions[i]);
130 planner->constraints_.push_back(term);
134 auto response = planner->plan(
scene, ur5->getScratchState());
137 RBX_INFO(
"Optimization did not converge");
143 rviz.updateTrajectory(trajectory);
146 scene->getCurrentState() = *ur5->getScratchState();
147 rviz.updateScene(
scene);
RVIZ visualization helper. See Live Visualization with RViz for more information.
RAII-pattern for starting up ROS.
The Trajectory class is a wrapper around MoveIt!'s robot_trajectory::RobotTrajectory,...
#define RBX_INFO(fmt,...)
Output a info logging message.
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.
Functions for loading and animating scenes in Blender.
robot_trajectory::RobotTrajectory trajectory(rmodel,"right_arm")
static const std::string GROUP