9 #include <choreo_msgs/MoveToTargetPose.h> 12 #include <trajectory_msgs/JointTrajectory.h> 19 #include <control_msgs/FollowJointTrajectoryAction.h> 28 choreo_msgs::MoveToTargetPose::Request& req,
29 choreo_msgs::MoveToTargetPose::Response& res)
31 if(req.type == req.JOINT_POSE)
34 const std::vector<std::string>& joint_names =
37 if(current_joints == req.pose)
43 std::vector<double> target_pose(req.pose.end() - joint_names.size(), req.pose.end());
52 double sim_time_scale = 0.6;
53 for (
int i = 0; i < ros_traj.points.size(); i++)
55 ros_traj.points[i].time_from_start -= base_time;
58 ros_traj.points[i].time_from_start *= sim_time_scale;
68 ROS_WARN(
"[Reset Exe] Exec timed out");
72 ROS_INFO(
"[Reset Exe] Found action server");
75 control_msgs::FollowJointTrajectoryGoal goal;
76 goal.trajectory = ros_traj;
static const std::string JOINT_TOPIC_NAME
bool waitForServer(const ros::Duration &timeout=ros::Duration(0, 0)) const
moveit::core::RobotModelConstPtr moveit_model_
std::vector< double > getCurrentJointState(const std::string &topic)
void fillTrajectoryHeaders(const std::vector< std::string > &joints, trajectory_msgs::JointTrajectory &traj, const std::string world_frame)
std::string hotend_group_name_
SimpleClientGoalState sendGoalAndWait(const Goal &goal, const ros::Duration &execute_timeout=ros::Duration(0, 0), const ros::Duration &preempt_timeout=ros::Duration(0, 0))
trajectory_msgs::JointTrajectory getMoveitPlan(const std::string &group_name, const std::vector< double > &joints_start, const std::vector< double > &joints_stop, moveit::core::RobotModelConstPtr model)
bool handleMoveToTargetPosePlanAndExecution(choreo_msgs::MoveToTargetPose::Request &req, choreo_msgs::MoveToTargetPose::Response &res)