NVlabs / curobo

CUDA Accelerated Robot Library
https://curobo.org
Other
796 stars 125 forks source link

Small bug in examples/isaac_sim/multi_arm_reacher.py (with fix) #372

Open YuhengZhi opened 3 months ago

YuhengZhi commented 3 months ago

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:

  1. cuRobo installation mode (choose from [python, isaac sim, docker python, docker isaac sim]): isaac sim
  2. python version: Native Python 3.10 that came with isaac sim
  3. Isaac Sim version (if using): 4.1.0

Issue Details

The multi_arm_reacher example would crash if:

  1. Press play
  2. Move the red cube so the arms start moving
  3. press either "Pause" or "Stop"

The error message would be:

    if i % 100 == 0:
TypeError: not all arguments converted during string formatting

The issue is due to an out-of-scope iterator variable i in these lines. The fix is simply change the i's to, e.g., k

for k in target_links.keys():
    c_p, c_rot = target_links[k].get_world_pose()
    link_poses[k] = Pose(
        position=tensor_args.to_device(c_p),
        quaternion=tensor_args.to_device(c_rot),
    )