Skip to content

Commit 3e8f3e8

Browse files
authored
clean up ik loop
1 parent f538ede commit 3e8f3e8

File tree

5 files changed

+3620
-110
lines changed

5 files changed

+3620
-110
lines changed

motionplan/armplanning/cmd-plan/cmd-plan.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"fmt"
99
"log"
1010
"os"
11+
"sort"
1112
"time"
1213

1314
"go.viam.com/rdk/logging"
@@ -71,6 +72,15 @@ func realMain() error {
7172

7273
mylog.Printf("planning took %v", time.Since(start))
7374

75+
relevantParts := []string{}
76+
for c := range plan.Path()[0] {
77+
if len(c) == 0 {
78+
continue
79+
}
80+
relevantParts = append(relevantParts, c)
81+
}
82+
sort.Strings(relevantParts)
83+
7484
for idx, p := range plan.Path() {
7585
mylog.Printf("step %d", idx)
7686

@@ -80,7 +90,8 @@ func realMain() error {
8090
return fmt.Errorf("p and t are different sizes %d vs %d", len(p), len(t))
8191
}
8292

83-
for c, pp := range p {
93+
for _, c := range relevantParts {
94+
pp := p[c]
8495
if len(t[c]) == 0 {
8596
continue
8697
}

0 commit comments

Comments
 (0)