Skip to content

Commit 0c51dd2

Browse files
committed
improved joint space planning
1 parent 3bfed9d commit 0c51dd2

28 files changed

+1135
-213
lines changed

CHANGELOG.md

+21-1
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,19 @@ its affiliates is strictly prohibited.
1010
-->
1111
# Changelog
1212

13-
## Latest Commit
13+
## Version 0.7.3
1414

1515
### New Features
1616
- Add start state checks for world collision, self-collision, and joint limits.
17+
- Add finetune with dt scaling for `motion_gen.plan_single_js` to get more time optimal
18+
trajectories in joint space planning.
19+
- Improve joint space planning convergence, now succeeds in more planning problems with higher
20+
accuracy.
21+
22+
### Changes in default behavior
23+
- Some warp kernels are now compiled based on runtime parameters (dof), causing a slowdown in load
24+
time for motion_gen. To avoid this slowdown, add an environment variable `CUROBO_USE_LRU_CACHE=1`
25+
which will cache the runtime generated kernels.
1726

1827
### BugFixes & Misc.
1928
- Fix bug in evaluator to account for dof maximum acceleration and jerk.
@@ -23,6 +32,17 @@ its affiliates is strictly prohibited.
2332
- Add `g_dim` check for `int` in batched planning.
2433
- Add `link_poses` for motion_gen.warmup() in batch planning mode.
2534
- Add `link_poses` as input to `batch_goalset`.
35+
- Add finetune js trajopt solver.
36+
- Pass raw velocity, acceleration, and jerk values to dt computation function to prevent
37+
interpolation errors from causing out of joint limit failures
38+
- Add `finetune_js_dt_scale` with a default value > 1.0 as joint space trajectories are
39+
time optimal in sparse obstacle environments.
40+
- Add note on deterministic behavior to website. Use lbfgs history < 12 for deterministic
41+
optimization results.
42+
- Add warning when adding a mesh with the same name as in existing cache.
43+
- Remove warmup for batch motion gen reacher isaac sim example.
44+
- Fix python examples in getting started webpage.
45+
- Refactor warp mesh query kernels to use a `wp.func` for signed distance queries.
2646

2747
## Version 0.7.2
2848

benchmark/ik_benchmark.py

+15-3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
)
3838
from curobo.wrap.reacher.ik_solver import IKSolver, IKSolverConfig
3939

40+
# set seeds
41+
torch.manual_seed(2)
42+
4043
torch.backends.cudnn.benchmark = True
4144
torch.backends.cuda.matmul.allow_tf32 = True
4245
torch.backends.cudnn.allow_tf32 = True
@@ -49,6 +52,7 @@ def run_full_config_collision_free_ik(
4952
use_cuda_graph=False,
5053
collision_free=True,
5154
high_precision=False,
55+
num_seeds=12,
5256
):
5357
tensor_args = TensorDeviceType()
5458
robot_data = load_yaml(join_path(get_robot_configs_path(), robot_file))["robot_cfg"]
@@ -67,7 +71,7 @@ def run_full_config_collision_free_ik(
6771
robot_cfg,
6872
world_cfg,
6973
position_threshold=position_threshold,
70-
num_seeds=16,
74+
num_seeds=num_seeds,
7175
self_collision_check=collision_free,
7276
self_collision_opt=collision_free,
7377
tensor_args=tensor_args,
@@ -120,10 +124,15 @@ def run_full_config_collision_free_ik(
120124
default="ik",
121125
help="File name prefix to use to save benchmark results",
122126
)
123-
127+
parser.add_argument(
128+
"--num_seeds",
129+
type=int,
130+
default=16,
131+
help="Number of seeds to use for IK",
132+
)
124133
args = parser.parse_args()
125134

126-
b_list = [1, 10, 100, 2000][-1:]
135+
b_list = [1, 10, 100, 500, 2000][:]
127136

128137
robot_list = get_motion_gen_robot_list() + get_multi_arm_robot_list()[:2]
129138
world_file = "collision_test.yml"
@@ -142,6 +151,7 @@ def run_full_config_collision_free_ik(
142151
"Orientation-Error-Collision-Free-IK": [],
143152
}
144153
for robot_file in robot_list[:-1]:
154+
print("running for robot: ", robot_file)
145155
# create a sampler with dof:
146156
for b_size in b_list:
147157
# sample test configs:
@@ -153,13 +163,15 @@ def run_full_config_collision_free_ik(
153163
use_cuda_graph=True,
154164
collision_free=False,
155165
high_precision=args.high_precision,
166+
num_seeds=args.num_seeds,
156167
)
157168
dt_cu_ik_cfree, success, p_err_c, q_err_c = run_full_config_collision_free_ik(
158169
robot_file,
159170
world_file,
160171
batch_size=b_size,
161172
use_cuda_graph=True,
162173
collision_free=True,
174+
num_seeds=args.num_seeds,
163175
# high_precision=args.high_precision,
164176
)
165177
# print(dt_cu/b_size, dt_cu_cg/b_size)

examples/isaac_sim/batch_motion_gen_reacher.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,11 @@ def main():
156156
default_config = robot_cfg["kinematics"]["cspace"]["retract_config"]
157157

158158
print("warming up...")
159-
motion_gen.warmup(
160-
batch=n_envs,
161-
batch_env_mode=True,
162-
warmup_js_trajopt=False,
163-
)
159+
# motion_gen.warmup(
160+
# batch=n_envs,
161+
# batch_env_mode=True,
162+
# warmup_js_trajopt=False,
163+
# )
164164

165165
add_extensions(simulation_app, args.headless_mode)
166166
config = RobotWorldConfig.load_from_config(

examples/motion_gen_example.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def demo_motion_gen_simple():
134134
)
135135

136136
result = motion_gen.plan_single(start_state, goal_pose, MotionGenPlanConfig(max_attempts=1))
137-
traj = result.get_interpolated_plan() # result.optimized_dt has the dt between timesteps
137+
traj = result.get_interpolated_plan() # result.interpolation_dt has the dt between timesteps
138138
print("Trajectory Generated: ", result.success)
139139

140140

setup.cfg

+6-5
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,13 @@ install_requires =
5050
torch>=1.10
5151
trimesh
5252
yourdfpy>=0.0.53
53-
warp-lang>=0.9.0
53+
warp-lang>=0.11.0
5454
scipy>=1.7.0
5555
tqdm
5656
wheel
5757
importlib_resources
5858
scikit-image
59+
5960
packages = find_namespace:
6061
package_dir =
6162
= src
@@ -85,10 +86,10 @@ ci =
8586

8687

8788
# this is only available in 3.8+
88-
smooth =
89+
smooth =
8990
trajectory_smoothing @ https://github.com/balakumar-s/trajectory_smoothing/raw/main/dist/trajectory_smoothing-0.3-cp38-cp38-linux_x86_64.whl
9091

91-
usd =
92+
usd =
9293
usd-core
9394

9495
dev =
@@ -101,12 +102,12 @@ dev =
101102
pytest>6.2.5
102103
pytest-cov
103104

104-
isaacsim =
105+
isaacsim =
105106
tomli
106107
wheel
107108
ninja
108109

109-
doc =
110+
doc =
110111
sphinx
111112
sphinx_rtd_theme
112113
graphviz>=0.20.1

src/curobo/content/configs/robot/jaco7.yml

+46-23
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
##
1111

1212
robot_cfg:
13-
13+
1414
kinematics:
1515

1616
urdf_path: "robot/jaco/jaco_7s.urdf"
@@ -37,13 +37,13 @@ robot_cfg:
3737
base_link: "root"
3838
ee_link: "j2s7s300_end_effector"
3939
link_names: null
40-
40+
4141
collision_link_names: [
4242
"j2s7s300_link_base", "j2s7s300_link_1", "j2s7s300_link_2",
4343
"j2s7s300_link_3", "j2s7s300_link_4", "j2s7s300_link_5", "j2s7s300_link_6", "j2s7s300_link_7",
4444
"j2s7s300_link_finger_tip_1", "j2s7s300_link_finger_tip_2",
45-
"j2s7s300_link_finger_tip_3",
46-
"j2s7s300_link_finger_3",
45+
"j2s7s300_link_finger_tip_3",
46+
"j2s7s300_link_finger_3",
4747
"j2s7s300_link_finger_2",
4848
"j2s7s300_link_finger_1",
4949
]
@@ -151,37 +151,60 @@ robot_cfg:
151151
collision_sphere_buffer: 0.005
152152
self_collision_ignore: {
153153
"j2s7s300_link_base":["j2s7s300_link_1"],
154-
"j2s7s300_link_1":["j2s7s300_link_2"],
154+
"j2s7s300_link_1":["j2s7s300_link_2"],
155155
"j2s7s300_link_2":["j2s7s300_link_3"],
156-
"j2s7s300_link_3":["j2s7s300_link_4"],
157-
"j2s7s300_link_4":["j2s7s300_link_5"],
158-
"j2s7s300_link_5":["j2s7s300_link_6"],
159-
"j2s7s300_link_6":["j2s7s300_link_7"],
156+
"j2s7s300_link_3":["j2s7s300_link_4"],
157+
"j2s7s300_link_4":["j2s7s300_link_5"],
158+
"j2s7s300_link_5":["j2s7s300_link_6",
159+
"j2s7s300_link_finger_tip_1",
160+
"j2s7s300_link_finger_tip_2",
161+
"j2s7s300_link_finger_tip_3",
162+
"j2s7s300_link_finger_1",
163+
"j2s7s300_link_finger_2",
164+
"j2s7s300_link_finger_3"],
165+
"j2s7s300_link_6":["j2s7s300_link_7",
166+
"j2s7s300_link_finger_tip_1",
167+
"j2s7s300_link_finger_tip_2",
168+
"j2s7s300_link_finger_tip_3",
169+
"j2s7s300_link_finger_1",
170+
"j2s7s300_link_finger_2",
171+
"j2s7s300_link_finger_3"],
160172
"j2s7s300_link_7":[
161-
"j2s7s300_link_finger_tip_1",
173+
"j2s7s300_link_finger_tip_1",
162174
"j2s7s300_link_finger_tip_2",
163175
"j2s7s300_link_finger_tip_3",
164176
"j2s7s300_link_finger_1",
165177
"j2s7s300_link_finger_2",
166178
"j2s7s300_link_finger_3",
167179
],
168-
169-
"j2s7s300_link_finger_3":["j2s7s300_link_finger_tip_3","j2s7s300_link_finger_2",
170-
"j2s7s300_link_finger_1"],
180+
181+
"j2s7s300_link_finger_3":
182+
["j2s7s300_link_finger_tip_3","j2s7s300_link_finger_2",
183+
"j2s7s300_link_finger_1", "j2s7s300_link_finger_tip_1", "j2s7s300_link_finger_tip_2"],
184+
171185
"j2s7s300_link_finger_2":["j2s7s300_link_finger_tip_2", "j2s7s300_link_finger_1",
172-
"j2s7s300_link_finger_3"],
186+
"j2s7s300_link_finger_3", "j2s7s300_link_finger_tip_3", "j2s7s300_link_finger_tip_1"],
187+
173188
"j2s7s300_link_finger_1":["j2s7s300_link_finger_tip_1", "j2s7s300_link_finger_2",
174-
"j2s7s300_link_finger_3"],
189+
"j2s7s300_link_finger_3", "j2s7s300_link_finger_tip_3", "j2s7s300_link_finger_tip_2"],
190+
191+
"j2s7s300_link_finger_tip_1":["j2s7s300_link_finger_tip_2", "j2s7s300_link_finger_tip_3"],
192+
193+
"j2s7s300_link_finger_tip_2":["j2s7s300_link_finger_tip_3"],
175194

176195
} # Dict[str, List[str]]
177-
self_collision_buffer: {} # Dict[str, float]
178-
179-
mesh_link_names: [
196+
self_collision_buffer: {
197+
#"j2s7s300_link_base": 0.02,
198+
#"j2s7s300_link_1": 0.01,
199+
200+
} # Dict[str, float]
201+
202+
mesh_link_names: [
180203
"j2s7s300_link_base", "j2s7s300_link_1", "j2s7s300_link_2",
181204
"j2s7s300_link_3", "j2s7s300_link_4", "j2s7s300_link_5", "j2s7s300_link_6", "j2s7s300_link_7",
182205
"j2s7s300_link_finger_tip_1", "j2s7s300_link_finger_tip_2",
183-
"j2s7s300_link_finger_tip_3",
184-
"j2s7s300_link_finger_3",
206+
"j2s7s300_link_finger_tip_3",
207+
"j2s7s300_link_finger_3",
185208
"j2s7s300_link_finger_2",
186209
"j2s7s300_link_finger_1",
187210
] # List[str]
@@ -191,18 +214,18 @@ robot_cfg:
191214
"j2s7s300_joint_finger_tip_1": 0,
192215
"j2s7s300_joint_finger_tip_2": 0,
193216
"j2s7s300_joint_finger_tip_3": 0,
194-
217+
195218
}
196219

197220
cspace:
198-
joint_names:
221+
joint_names:
199222
- j2s7s300_joint_1
200223
- j2s7s300_joint_2
201224
- j2s7s300_joint_3
202225
- j2s7s300_joint_4
203226
- j2s7s300_joint_5
204227
- j2s7s300_joint_6
205-
- j2s7s300_joint_7
228+
- j2s7s300_joint_7
206229
- j2s7s300_joint_finger_1
207230
- j2s7s300_joint_finger_2
208231
- j2s7s300_joint_finger_3

src/curobo/content/configs/task/base_cfg.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111

1212

1313
world_collision_checker_cfg:
14-
cache: null
14+
cache: null
1515
checker_type: "PRIMITIVE"
1616
max_distance: 0.1
17-
17+
1818

1919
cost:
2020
pose_cfg:
@@ -27,8 +27,8 @@ cost:
2727
weight: [0.0, 0.0]
2828
vec_convergence: [0.0, 0.00] # orientation, position
2929
terminal: False
30-
31-
30+
31+
3232
bound_cfg:
3333
weight: 000.0
3434
activation_distance: [0.0,0.0,0.0,0.0]
@@ -58,14 +58,14 @@ convergence:
5858
weight: [0.1, 10.0]
5959
vec_convergence: [0.0, 0.0] # orientation, position
6060
terminal: False
61-
6261
cspace_cfg:
6362
weight: 1.0
6463
terminal: True
6564
run_weight: 0.0
65+
use_l2_kernel: True
6666
null_space_cfg:
67-
weight: 1.0
67+
weight: 0.001
6868
terminal: True
6969
run_weight: 1.0
70-
71-
70+
use_l2_kernel: True
71+

src/curobo/content/configs/task/finetune_trajopt.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ cost:
4949

5050

5151
cspace_cfg:
52-
weight: 10000.0
52+
weight: 20000.0
5353
terminal: True
5454
run_weight: 0.00 #1
5555

@@ -59,7 +59,7 @@ cost:
5959
run_weight_velocity: 0.0
6060
run_weight_acceleration: 1.0
6161
run_weight_jerk: 1.0
62-
activation_distance: [0.05,0.05,0.05,0.05] # for position, velocity, acceleration and jerk
62+
activation_distance: [0.05,0.001,0.001,0.001] # for position, velocity, acceleration and jerk
6363
null_space_weight: [0.0]
6464

6565
primitive_collision_cfg:

src/curobo/content/configs/task/gradient_ik.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,22 @@ cost:
4040
terminal: False
4141
use_metric: True
4242
run_weight: 1.0
43+
4344
cspace_cfg:
4445
weight: 0.000
46+
4547
bound_cfg:
4648
weight: 5000.0
4749
activation_distance: [0.001]
48-
null_space_weight: [0.1]
50+
null_space_weight: [0.001]
51+
use_l2_kernel: True
52+
4953
primitive_collision_cfg:
5054
weight: 5000.0
5155
use_sweep: False
5256
classify: False
5357
activation_distance: 0.01
58+
5459
self_collision_cfg:
5560
weight: 5000.0
5661
classify: False

0 commit comments

Comments
 (0)