33 targetRotationBase = fmod(targetRotationBase + M_PI, 2.0 * M_PI);
34 nav_msgs::Path navigationPath = this->
mRobotModel->getNavigationPath(sourcePosition, targetPosition, sourceRotationBase, targetRotationBase);
36 if (navigationPath.poses.size() > 2)
40 double currentDotProduct;
41 double absolutAngleChange = 0;
42 std::vector<geometry_msgs::PoseStamped>::iterator poseIterator = navigationPath.poses.end();
43 geometry_msgs::Pose previousPose_2 = poseIterator->pose;
45 geometry_msgs::Pose previousPose_1 = poseIterator->pose;
49 length += sqrt(pow(previousPose_1.position.x-(*poseIterator).pose.position.x, 2.0)+pow(previousPose_1.position.y-(*poseIterator).pose.position.y, 2.0));
50 Eigen::Vector2d v1(previousPose_1.position.x - previousPose_2.position.x, previousPose_1.position.y - previousPose_2.position.y);
51 Eigen::Vector2d v2(-previousPose_2.position.x + (*poseIterator).pose.position.x, -previousPose_2.position.y + (*poseIterator).pose.position.y);
54 currentDotProduct = v1.dot(v2);
55 if (currentDotProduct < -1.0) currentDotProduct = -1.0;
56 if (currentDotProduct > 1.0) currentDotProduct = 1.0;
57 absolutAngleChange += fabs(acos(currentDotProduct));
58 previousPose_2 = previousPose_1;
59 previousPose_1 = poseIterator->pose;
62 }
while(poseIterator > navigationPath.poses.begin() && length < 1.0);
63 double rating = pow(0.6, absolutAngleChange);
65 <<
" (absolutAngleChange: " << absolutAngleChange
66 <<
", length: " << length <<
")",
IKRatingModule is a generalization for the rating of the inverse kinematic parameters.
static boost::shared_ptr< DebugHelper > getInstance()
double getPanAngleRating(const geometry_msgs::Point &sourcePosition, const geometry_msgs::Point &targetPosition, double sourceRotationBase, double targetRotationBase)
this namespace contains all generally usable classes.
NavigationPathIKRatingModule(RobotModelPtr robotModel)
constructor of the NavigationPathIKRatingModule object
DebugHelperPtr mDebugHelperPtr
TFSIMD_FORCE_INLINE tfScalar length(const Quaternion &q)
RobotModelPtr mRobotModel
virtual ~NavigationPathIKRatingModule()
destructor of the NavigationPathIKRatingModule object.