26 #include <std_msgs/String.h> 28 #include "../include/turtlebot3_manipulation_gui/qnode.hpp" 74 std::string planning_group_name2 =
"gripper";
90 std::cout <<
"Ros shutdown, proceeding to close the gui." << std::endl;
101 std::vector<double> temp_angle;
102 temp_angle.push_back(jointValues.at(0));
103 temp_angle.push_back(jointValues.at(1));
104 temp_angle.push_back(jointValues.at(2));
105 temp_angle.push_back(jointValues.at(3));
106 temp_angle.push_back(jointValues2.at(0));
110 std::vector<double> temp_position;
111 temp_position.push_back(current_pose.position.x);
112 temp_position.push_back(current_pose.position.y);
113 temp_position.push_back(current_pose.position.z);
133 const robot_state::JointModelGroup* joint_model_group =
138 std::vector<double> joint_group_positions;
139 current_state->copyJointGroupPositions(joint_model_group, joint_group_positions);
142 joint_group_positions[0] = joint_angle.at(0);
143 joint_group_positions[1] = joint_angle.at(1);
144 joint_group_positions[2] = joint_angle.at(2);
145 joint_group_positions[3] = joint_angle.at(3);
149 bool success = (
move_group_->
plan(my_plan) == moveit::planning_interface::MoveItErrorCode::SUCCESS);
150 if (success ==
false)
179 geometry_msgs::Pose target_pose;
180 target_pose.position.x = kinematics_pose.at(0);
181 target_pose.position.y = kinematics_pose.at(1);
182 target_pose.position.z = kinematics_pose.at(2);
185 target_pose.position.x,
186 target_pose.position.y,
187 target_pose.position.z);
190 bool success = (
move_group_->
plan(my_plan) == moveit::planning_interface::MoveItErrorCode::SUCCESS);
191 if (success ==
false)
206 const robot_state::JointModelGroup* joint_model_group =
211 std::vector<double> joint_group_positions;
212 current_state->copyJointGroupPositions(joint_model_group, joint_group_positions);
215 joint_group_positions[0] = joint_angle.at(0);
219 bool success = (
move_group2_->
plan(my_plan) == moveit::planning_interface::MoveItErrorCode::SUCCESS);
220 if (success ==
false)
bool setToolControl(std::vector< double > joint_angle)
moveit::planning_interface::MoveGroupInterface * move_group2_
bool setPositionTarget(double x, double y, double z, const std::string &end_effector_link="")
bool setJointValueTarget(const std::vector< double > &group_variable_values)
std::vector< double > getCurrentJointValues()
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
std::vector< double > present_kinematics_position_
std::vector< double > getPresentKinematicsPosition()
std::vector< double > present_joint_angle_
moveit::planning_interface::MoveGroupInterface * move_group_
robot_state::RobotStatePtr getCurrentState(double wait=1)
geometry_msgs::PoseStamped getCurrentPose(const std::string &end_effector_link="")
MoveItErrorCode plan(Plan &plan)
std::vector< double > getPresentJointAngle()
ROSCPP_DECL bool isStarted()
bool setTaskSpacePath(std::vector< double > kinematics_pose, double path_time)
bool setJointSpacePath(std::vector< double > joint_angle, double path_time)
ROSCPP_DECL void shutdown()
QNode(int argc, char **argv)
ROSCPP_DECL void spinOnce()
ROSCPP_DECL void waitForShutdown()