18 int main(
int argc,
char **argv)
24 auto ur5 = std::make_shared<UR5Robot>();
26 ur5->setGroupState(
"manipulator", {0.0677, -0.8235, 0.9860, -0.1624, 0.0678, 0.0});
31 RBX_INFO(
"RViz Initialized! Press enter to continue (after your RViz is setup)...");
34 auto scene = std::make_shared<Scene>(ur5);
37 auto cartesian_planner = std::make_shared<SimpleCartesianPlanner>(ur5,
"cartesian");
39 EigenSTL::vector_Vector3d directions = {
40 {0.0, -0.3, 0.0}, {0.0, 0.0, -0.2}, {0.0, 0.3, 0.0}, {0.0, 0.0, 0.2},
41 {0.2, 0.0, 0.0}, {0.0, -0.3, 0.0}, {-0.2, 0.0, 0.0}, {0.0, 0.3, 0.0},
42 {0.4, -0.3, 0.2}, {-0.4, 0.3, -0.2}
45 for (
const auto &direction : directions)
47 RBX_INFO(
"Moving end-effector in direction [%1%, %2%, %3%]",
48 direction[0], direction[1], direction[2]);
51 scene->getCurrentState() = *ur5->getScratchState();
56 Robot::IKQuery query(
"manipulator",
"ee_link", *ur5->getScratchState(), direction);
60 auto response = cartesian_planner->plan(*ur5->getScratchState(), query);
61 if (response.error_code_.val != moveit_msgs::MoveItErrorCodes::SUCCESS)
74 RBX_INFO(
"Press enter to continue to next direction.");
79 scene->getCurrentState() = *ur5->getScratchState();
RVIZ visualization helper. See Live Visualization with RViz for more information.
void updateScene(const SceneConstPtr &scene)
Updates the scene being visualized.
void updateTrajectory(const planning_interface::MotionPlanResponse &response)
Updates the trajectory being visualized.
RAII-pattern for starting up ROS.
The Trajectory class is a wrapper around MoveIt!'s robot_trajectory::RobotTrajectory,...
#define RBX_ERROR(fmt,...)
Output a error logging message.
#define RBX_INFO(fmt,...)
Output a info logging message.
Main namespace. Contains all library classes and functions.
Functions for loading and animating scenes in Blender.
Robot IK Query options. IK queries in Robowflex consist of: a) A position specified by some geometric...
SceneConstPtr scene
If provided, use this scene for collision checking.
robot_trajectory::RobotTrajectory trajectory(rmodel,"right_arm")
int main(int argc, char **argv)