Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add use_link_poses to motion_gen warmup #266

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions src/curobo/wrap/reacher/motion_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -1757,6 +1757,7 @@ def warmup(
n_goalset: int = -1,
warmup_joint_index: int = 0,
warmup_joint_delta: float = 0.1,
use_link_poses: bool = False,
):
"""Warmup planning methods for motion generation.

Expand All @@ -1774,6 +1775,8 @@ def warmup(
and the method will internally pad the extra goals with the first goal.
warmup_joint_index: Index of the joint to perturb for warmup.
warmup_joint_delta: Delta to perturb the joint for warmup.
use_link_poses: Use poses of other links for warmup. This is needed when you will be
using link_poses to plan for multiple links in the robot.
"""
log_info("Warmup")
if warmup_js_trajopt:
Expand Down Expand Up @@ -1817,7 +1820,7 @@ def warmup(
enable_finetune_trajopt=True,
parallel_finetune=parallel_finetune,
),
link_poses=link_poses,
link_poses=link_poses if use_link_poses else None,
)

self.plan_single(
Expand All @@ -1829,7 +1832,7 @@ def warmup(
enable_graph=enable_graph,
parallel_finetune=parallel_finetune,
),
link_poses=link_poses,
link_poses=link_poses if use_link_poses else None,
)
else:
retract_pose = Pose(
Expand All @@ -1846,7 +1849,7 @@ def warmup(
enable_finetune_trajopt=True,
parallel_finetune=parallel_finetune,
),
link_poses=link_poses,
link_poses=link_poses if use_link_poses else None,
)

self.plan_goalset(
Expand All @@ -1858,7 +1861,7 @@ def warmup(
enable_graph=enable_graph,
parallel_finetune=parallel_finetune,
),
link_poses=link_poses,
link_poses=link_poses if use_link_poses else None,
)

else:
Expand All @@ -1884,6 +1887,7 @@ def warmup(
enable_graph=False,
enable_graph_attempt=None,
),
link_poses=link_poses if use_link_poses else None,
)
else:
self.plan_batch(
Expand All @@ -1895,6 +1899,7 @@ def warmup(
enable_graph=enable_graph,
enable_graph_attempt=None if not enable_graph else 20,
),
link_poses=link_poses if use_link_poses else None,
)
else:
retract_pose = Pose(
Expand All @@ -1914,6 +1919,7 @@ def warmup(
enable_finetune_trajopt=True,
enable_graph=False,
),
link_poses=link_poses if use_link_poses else None,
)
else:
self.plan_batch_goalset(
Expand All @@ -1925,6 +1931,7 @@ def warmup(
enable_graph=enable_graph,
enable_graph_attempt=None if not enable_graph else 20,
),
link_poses=link_poses if use_link_poses else None,
)

log_info("Warmup complete")
Expand Down