89 const std::vector<const moveit::core::JointModel*>& jmodels =
90 planning_scene->getRobotModel()->hasJointModelGroup(req.group_name) ?
91 planning_scene->getRobotModel()->getJointModelGroup(req.group_name)->getJointModels() :
95 const auto params = param_listener_->get_params();
97 bool changed_req =
false;
105 switch (jmodel->getType())
114 if (fabs(initial - after) > std::numeric_limits<double>::epsilon())
125 double copy[3] = { p[0], p[1], p[2] };
137 double copy[7] = { p[0], p[1], p[2], p[3], p[4], p[5], p[6] };
149 std::stringstream joint_values;
150 std::stringstream joint_bounds_low;
151 std::stringstream joint_bounds_hi;
153 for (std::size_t k = 0; k < jmodel->getVariableCount(); ++k)
155 joint_values << p[k] <<
' ';
160 joint_bounds_low << variable_bounds.min_position_ <<
' ';
161 joint_bounds_hi << variable_bounds.max_position_ <<
' ';
163 RCLCPP_ERROR(logger_,
164 "Joint '%s' from the starting state is outside bounds by: [%s] should be in "
165 "the range [%s], [%s].",
166 jmodel->getName().c_str(), joint_values.str().c_str(), joint_bounds_low.str().c_str(),
167 joint_bounds_hi.str().c_str());
174 if (params.fix_start_state && changed_req)
176 RCLCPP_WARN(logger_,
"Changing start state.");
185 status.val = moveit_msgs::msg::MoveItErrorCodes::SUCCESS;
189 status.val = moveit_msgs::msg::MoveItErrorCodes::START_STATE_INVALID;
190 status.message = std::string(
"Start state out of bounds.");