-
Notifications
You must be signed in to change notification settings - Fork 110
/
errors.go
36 lines (24 loc) · 1.16 KB
/
errors.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package motionplan
import (
"errors"
"fmt"
)
var (
errIKSolve = errors.New("zero IK solutions produced, goal positions appears to be physically unreachable")
errPlannerFailed = errors.New("motion planner failed to find path")
errNoPlannerOptions = errors.New("PlannerOptions are required but have not been specified")
errIKConstraint = "all IK solutions failed constraints. Failures: "
errNoNeighbors = errors.New("no neighbors found")
errInvalidCandidate = errors.New("candidate did not meet constraints")
errNoCandidates = errors.New("no candidates passed in, skipping")
errInvalidConstraint = errors.New("invalid constraint input")
errHighReplanCost = errors.New("unable to create a new plan within replanCostFactor from the original")
errBadPlanImpl = errors.New("rrtPlan is the only supported implementation of Plan by this function")
)
func genIKConstraintErr(failures map[string]int, constraintFailCnt int) error {
ikConstraintFailures := errIKConstraint
for failName, count := range failures {
ikConstraintFailures += fmt.Sprintf("{ %s: %.2f%% }, ", failName, 100*float64(count)/float64(constraintFailCnt))
}
return errors.New(ikConstraintFailures)
}