28 const std::string& link_name,
29 const std::vector<double>& config)
35 const std::string& link_name,
36 const std::vector<double>& config,
37 const moveit::core::RobotModelConstPtr& robot_model)
42 std::string msg{
"Link \"" };
43 msg.append(link_name).append(
"\" not known to robot model");
44 throw std::invalid_argument(msg);
49 std::string msg{
"Tranform of \"" };
50 msg.append(link_name).append(
"\" is unknown");
51 throw std::invalid_argument(msg);
57 geometry_msgs::Pose pose_msg;
58 pose_msg.position.x = pose.at(0);
59 pose_msg.position.y = pose.at(1);
60 pose_msg.position.z = pose.at(2);
61 pose_msg.orientation.x = pose.at(3);
62 pose_msg.orientation.y = pose.at(4);
63 pose_msg.orientation.z = pose.at(5);
64 pose_msg.orientation.w = pose.at(6);
71 geometry_msgs::PoseStamped pose_stamped_msg;
72 pose_stamped_msg.pose = pose;
73 return pose_stamped_msg;
80 throw std::runtime_error(
"No robot model set");
84 rstate.setToDefaultValues();
93 Eigen::Isometry3d start_pose;
95 if (!rstate.setFromIK(rstate.getRobotModel()->getJointModelGroup(
group_name_), start_pose,
link_name_))
97 std::ostringstream os;
98 os <<
"No solution for ik \n" << start_pose.translation() <<
"\n" << start_pose.linear();
99 throw std::runtime_error(os.str());
103 moveit_msgs::RobotState robot_state_msg;
105 return robot_state_msg;
111 os <<
" | link name: \"" << obj.
getLinkName() <<
"\"";
geometry_msgs::Pose pose_
void poseMsgToEigen(const geometry_msgs::Pose &m, Eigen::Affine3d &e)
moveit::core::RobotModelConstPtr robot_model_
std::string getGroupName() const
static geometry_msgs::PoseStamped toStampedPose(const geometry_msgs::Pose &pose)
static geometry_msgs::Pose toPose(const std::vector< double > &pose)
std::ostream & operator<<(std::ostream &, const CartesianConfiguration &)
Class to define robot configuration in space.
bool hasSeed() const
States if a seed for the cartesian configuration is set.
void robotStateToRobotStateMsg(const RobotState &state, moveit_msgs::RobotState &robot_state, bool copy_attached_bodies=true)
Class to define a robot configuration in space with the help of cartesian coordinates.
const geometry_msgs::Pose & getPose() const
virtual moveit_msgs::RobotState toMoveitMsgsRobotState() const override
const JointConfiguration & getSeed() const
const std::string & getLinkName() const