Closed weiheng-liu closed 6 months ago
If you are stuck for more than 1 day with something in cuRobo, please ask in our discussions (https://github.com/NVlabs/curobo/discussions) as we might have faced a similar issue and someone will provide a fix.
As for your issue, yes! we know why this happens. cuRobo uses torch's autograd internally to collect gradients during numerical optimization. So if you call cuRobo's IK or planning calls within a torch.no_grad
or torch.inference_mode
context, you might get this error.
For e.g.,
with torch.no_grad():
motion_gen.plan_single()
or
with torch.inference_mode():
motion_gen.plan_single()
If you have a no_grad
context globally, you can disable it temporarily with torch.enable_grad
context:
with torch.no_grad():
with torch.enable_grad():
motion_gen.plan_single()
Let us know if this does not fix your issue.
Thank u very much. I also have another problem: In motion planning, I want to attach a new object to the robot, But I find there is only a API for single environment: self.motion_generator = MotionGen(self.motion_gen_config) self.motion_generator.attach_new_object_to_robot(curr_js, cuboid, surface_sphere_radius=0.002, link_name=link_name) I want to ask is there no API for batch attach_new_object_to_robot ?
It's not supported for batched environments as we have only one representation robot across the batch. You could implement it as an additional collision checking cost across batch. More details are here: https://github.com/NVlabs/curobo/discussions/91#discussioncomment-7930459
If it’s not a bug, please use discussions: https://github.com/NVlabs/curobo/discussions
Please provide the below information in addition to your issue:
Issue Details