29 double angleBetweenPoints = 0.0;
30 if (fabs(targetPosition.y - sourcePosition.y) > 0.000001f && fabs(targetPosition.x - sourcePosition.x) > 0.000001f)
33 angleBetweenPoints = std::atan2(targetPosition.y - sourcePosition.y, targetPosition.x - sourcePosition.x);
36 if (sourceRotationBase <= 0) {sourceRotationBase += 2.0*M_PI;}
37 if (targetRotationBase <= 0) {targetRotationBase += 2.0*M_PI;}
38 double sourceRotDiff = fmod(sourceRotationBase - angleBetweenPoints, 2.0*M_PI);
39 double targetRotDiff = fmod(targetRotationBase - angleBetweenPoints, 2.0*M_PI);
41 if (sourceRotDiff <= 0) {sourceRotDiff += 2.0*M_PI;}
42 if (targetRotDiff <= 0) {targetRotDiff += 2.0*M_PI;}
45 double rotationCosts = std::min(fabs(targetRotDiff), (2.0
f*M_PI-fabs(targetRotDiff))) + std::min(fabs(sourceRotDiff), (2.0
f*M_PI-fabs(sourceRotDiff)));
47 double rating = pow(0.6, rotationCosts);
IKRatingModule is a generalization for the rating of the inverse kinematic parameters.
double getPanAngleRating(const geometry_msgs::Point &sourcePosition, const geometry_msgs::Point &targetPosition, double sourceRotationBase, double targetRotationBase)
this namespace contains all generally usable classes.
AngleApproximationIKRatingModule()
constructor of the AngleApproximationIKRatingModule object
virtual ~AngleApproximationIKRatingModule()
destructor of the AngleApproximationIKRatingModule object.