Skip to content

Commit 3697eff

Browse files
erhbiotinker
andauthored
for small movements, focus on smaller joint movements in one thread
Co-authored-by: Peter LoVerso <[email protected]>
1 parent 0cb5cba commit 3697eff

File tree

11 files changed

+713
-23
lines changed

11 files changed

+713
-23
lines changed

motionplan/armplanning/cBiRRT.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ func (mp *cBiRRTMotionPlanner) constrainNear(
367367
}
368368

369369
// Spawn the IK solver to generate solutions until done
370-
err = mp.fastGradDescent.Solve(ctx, solutionGen, linearSeed, mp.linearizeFSmetric(mp.ConstraintHandler.pathMetric), randseed.Int())
370+
err = mp.fastGradDescent.Solve(ctx, solutionGen, linearSeed, 0, 0, mp.linearizeFSmetric(mp.ConstraintHandler.pathMetric), randseed.Int())
371371
// We should have zero or one solutions
372372
var solved *ik.Solution
373373
select {

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"time"
1212

1313
"go.viam.com/rdk/logging"
14+
"go.viam.com/rdk/motionplan"
1415
"go.viam.com/rdk/motionplan/armplanning"
1516
"go.viam.com/rdk/referenceframe"
1617
)
@@ -26,11 +27,17 @@ func realMain() error {
2627
ctx := context.Background()
2728
logger := logging.NewLogger("cmd-plan")
2829

30+
pseudolinearLine := flag.Float64("pseudolinear-line", 0, "")
31+
pseudolinearOrientation := flag.Float64("pseudolinear-orientation", 0, "")
32+
seed := flag.Int("seed", 0, "")
33+
2934
flag.Parse()
3035
if len(flag.Args()) == 0 {
3136
return fmt.Errorf("need a json file")
3237
}
3338

39+
logger.Infof("reading plan from %s", flag.Arg(0))
40+
3441
content, err := os.ReadFile(flag.Arg(0))
3542
if err != nil {
3643
return err
@@ -43,6 +50,12 @@ func realMain() error {
4350
return err
4451
}
4552

53+
if *pseudolinearLine > 0 || *pseudolinearOrientation > 0 {
54+
req.Constraints.AddPseudolinearConstraint(motionplan.PseudolinearConstraint{*pseudolinearLine, *pseudolinearOrientation})
55+
}
56+
57+
req.PlannerOptions.RandomSeed = *seed
58+
4659
start := time.Now()
4760

4861
plan, err := armplanning.PlanMotion(ctx, logger, &req)
@@ -76,9 +89,10 @@ func realMain() error {
7689
mylog.Printf("\t\t\t %v", t[c])
7790
if idx > 0 {
7891
p := plan.Trajectory()[idx-1][c]
79-
mylog.Printf("\t\t\t\t distances l2: %0.4f Linf %0.4f",
92+
mylog.Printf("\t\t\t\t distances l2: %0.4f Linf %0.4f cartesion: %0.2f",
8093
referenceframe.InputsL2Distance(p, t[c]),
8194
referenceframe.InputsLinfDistance(p, t[c]),
95+
pp.Pose().Point().Distance(plan.Path()[idx-1][c].Pose().Point()),
8296
)
8397
}
8498
}

0 commit comments

Comments
 (0)