Skip to content

Commit

Permalink
Add support for older warp versions (<1.0.0)
Browse files Browse the repository at this point in the history
  • Loading branch information
balakumar-s committed Jun 24, 2024
1 parent 0c51dd2 commit ec527d7
Show file tree
Hide file tree
Showing 14 changed files with 1,102 additions and 513 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ its affiliates is strictly prohibited.
-->
# Changelog

## Latest Commit

### BugFixes & Misc.
- Add support for older warp versions (<1.0.0) as it's not possible to run older isaac sim with
newer warp versions.
- Add override option to mpc dataclass.
- Fix bug in ``PoseCost.forward_pose()`` which caused ``torch_layers_example.py`` to fail.

## Version 0.7.3

### New Features
Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ Use [Discussions](https://github.com/NVlabs/curobo/discussions) for questions on
Use [Issues](https://github.com/NVlabs/curobo/issues) if you find a bug.


For business inquiries, please visit our website and submit the form: [NVIDIA Research Licensing](https://www.nvidia.com/en-us/research/inquiries/)
cuRobo's collision-free motion planner is available for commercial applications as a
MoveIt plugin: [Isaac ROS cuMotion](https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_cumotion)

For business inquiries of this python library, please visit our website and submit the form: [NVIDIA Research Licensing](https://www.nvidia.com/en-us/research/inquiries/)


## Overview

Expand All @@ -44,9 +48,9 @@ If you found this work useful, please cite the below report,

```
@misc{curobo_report23,
title={cuRobo: Parallelized Collision-Free Minimum-Jerk Robot Motion Generation},
author={Balakumar Sundaralingam and Siva Kumar Sastry Hari and Adam Fishman and Caelan Garrett
and Karl Van Wyk and Valts Blukis and Alexander Millane and Helen Oleynikova and Ankur Handa
title={cuRobo: Parallelized Collision-Free Minimum-Jerk Robot Motion Generation},
author={Balakumar Sundaralingam and Siva Kumar Sastry Hari and Adam Fishman and Caelan Garrett
and Karl Van Wyk and Valts Blukis and Alexander Millane and Helen Oleynikova and Ankur Handa
and Fabio Ramos and Nathan Ratliff and Dieter Fox},
year={2023},
eprint={2310.17274},
Expand Down
25 changes: 18 additions & 7 deletions examples/torch_layers_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,13 @@ def get_features(self, q: torch.Tensor, x_des: Optional[Pose] = None):
kin_state.ee_quaternion,
]
if x_des is not None:
pose_distance = self._robot_world.pose_distance(x_des, kin_state.ee_pose)
pose_distance = self._robot_world.pose_distance(
x_des, kin_state.ee_pose, resize=True
).view(-1, 1)
features.append(pose_distance)
features.append(x_des.position)
features.append(x_des.quaternion)

features = torch.cat(features, dim=-1)

return features
Expand All @@ -114,17 +117,25 @@ def forward(self, q: torch.Tensor, x_des: Pose):

def loss(self, x_des: Pose, q: torch.Tensor, q_in: torch.Tensor):
kin_state = self._robot_world.get_kinematics(q)
distance = self._robot_world.pose_distance(x_des, kin_state.ee_pose)
d_sdf = self._robot_world.collision_constraint(kin_state.link_spheres_tensor.unsqueeze(1))
d_self = self._robot_world.self_collision_cost(kin_state.link_spheres_tensor.unsqueeze(1))
distance = self._robot_world.pose_distance(x_des, kin_state.ee_pose, resize=True)
d_sdf = self._robot_world.collision_constraint(
kin_state.link_spheres_tensor.unsqueeze(1)
).view(-1)
d_self = self._robot_world.self_collision_cost(
kin_state.link_spheres_tensor.unsqueeze(1)
).view(-1)
loss = 0.1 * torch.linalg.norm(q_in - q, dim=-1) + distance + 100.0 * (d_self + d_sdf)
return loss

def val_loss(self, x_des: Pose, q: torch.Tensor, q_in: torch.Tensor):
kin_state = self._robot_world.get_kinematics(q)
distance = self._robot_world.pose_distance(x_des, kin_state.ee_pose)
d_sdf = self._robot_world.collision_constraint(kin_state.link_spheres_tensor.unsqueeze(1))
d_self = self._robot_world.self_collision_cost(kin_state.link_spheres_tensor.unsqueeze(1))
distance = self._robot_world.pose_distance(x_des, kin_state.ee_pose, resize=True)
d_sdf = self._robot_world.collision_constraint(
kin_state.link_spheres_tensor.unsqueeze(1)
).view(-1)
d_self = self._robot_world.self_collision_cost(
kin_state.link_spheres_tensor.unsqueeze(1)
).view(-1)
loss = 10.0 * (d_self + d_sdf) + distance
return loss

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ install_requires =
torch>=1.10
trimesh
yourdfpy>=0.0.53
warp-lang>=0.11.0
warp-lang>=0.9.0
scipy>=1.7.0
tqdm
wheel
Expand Down
Loading

0 comments on commit ec527d7

Please sign in to comment.