Skip to content

Commit 4667bbc

Browse files
author
Michael Koval
committed
Fixed smoothingitrs and psample args in CBiRRT
1 parent ce7b6e2 commit 4667bbc

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/prpy/planning/cbirrt.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ def PlanToConfigurations(self, robot, goals, **kw_args):
5656
@param goals list of goal configurations
5757
@return traj output path
5858
"""
59-
return self.Plan(robot, jointgoals=goals, smoothingitrs=0, **kw_args)
59+
kw_args.setdefault('smoothingitrs', 0)
60+
return self.Plan(robot, jointgoals=goals, **kw_args)
6061

6162
@PlanningMethod
6263
def PlanToConfiguration(self, robot, goal, **kw_args):
@@ -66,7 +67,8 @@ def PlanToConfiguration(self, robot, goal, **kw_args):
6667
@param goal goal configuration
6768
@return traj output path
6869
"""
69-
return self.Plan(robot, jointgoals=[goal], smoothingitrs=0, **kw_args)
70+
kw_args.setdefault('smoothingitrs', 0)
71+
return self.Plan(robot, jointgoals=[goal], **kw_args)
7072

7173
@PlanningMethod
7274
def PlanToEndEffectorPose(self, robot, goal_pose, **kw_args):
@@ -81,8 +83,10 @@ def PlanToEndEffectorPose(self, robot, goal_pose, **kw_args):
8183
goal_tsr = prpy.tsr.tsr.TSR(T0_w=goal_pose, manip=manipulator_index)
8284
tsr_chain = prpy.tsr.tsr.TSRChain(sample_goal=True, TSR=goal_tsr)
8385

84-
return self.Plan(robot, tsr_chains=[tsr_chain], psample=0.1,
85-
smoothingitrs=0, **kw_args)
86+
kw_args.setdefault('psample', 0.1)
87+
kw_args.setdefault('smoothingitrs', 0)
88+
89+
return self.Plan(robot, tsr_chains=[tsr_chain], **kw_args)
8690

8791
@PlanningMethod
8892
def PlanToEndEffectorOffset(self, robot, direction, distance,
@@ -137,8 +141,9 @@ def PlanToEndEffectorOffset(self, robot, direction, distance,
137141
manip = robot.GetActiveManipulatorIndex())
138142
traj_tsr_chain = prpy.tsr.tsr.TSRChain(constrain=True, TSRs=[trajtsr])
139143

144+
kw_args.setdefault('psample', 0.1)
145+
140146
return self.Plan(robot,
141-
psample=0.1,
142147
tsr_chains=[goal_tsr_chain, traj_tsr_chain],
143148
# Smooth since this is a constrained trajectory.
144149
smoothingitrs=smoothingitrs,
@@ -162,7 +167,7 @@ def PlanToTSR(self, robot, tsr_chains, smoothingitrs=100, **kw_args):
162167

163168
for chain in tsr_chains:
164169
if chain.sample_start or chain.sample_goal:
165-
psample = 0.1
170+
kw_args.setdefault('psample', 0.1)
166171

167172
if chain.constrain:
168173
is_constrained = True
@@ -172,7 +177,6 @@ def PlanToTSR(self, robot, tsr_chains, smoothingitrs=100, **kw_args):
172177
smoothingitrs = 0
173178

174179
return self.Plan(robot,
175-
psample=psample,
176180
smoothingitrs=smoothingitrs,
177181
tsr_chains=tsr_chains,
178182
**kw_args

0 commit comments

Comments
 (0)