compas-dev / compas_fab

Robotic fabrication package for the COMPAS Framework.
https://compas.dev/compas_fab/
MIT License
108 stars 32 forks source link

Inverse kinematics not giving an accurate result at first after a tool is changed #385

Open EmaKrakovska opened 1 year ago

EmaKrakovska commented 1 year ago

Describe the bug When a tool is removed and a new tool is added, the inverse kinematics component for the same given plane does not give an accurate result at first computing, but only after the inverse kinematics is computed for another plane at least once.

To Reproduce Steps to reproduce the behavior:

  1. Context: compas_fab version 0.28.0 on Rhino 7, Grasshopper
  2. Sample script:

    tool_frame = Frame(plane.Origin, plane.XAxis, plane.YAxis)
    ik_configuration = robot.inverse_kinematics(tool_frame,
                                                  start_configuration,
                                                  group=group,
                                                  options={
                                                    'avoid_collisions':avoid_collisions,
                                                    'return_full_configuration':True,
                                                  })           

Expected behavior After removing and adding a new tool, the inverse kinematics computation should give a new and accurate result for the same plane.

Screenshots First computation of inverse kinematics after the tool was changed (probably using a transformation from the previous tool). inverse_kinematics_1 Second computation of inverse kinematics after the plane was shifted to a new position. inverse_kinematics_2

Desktop (please complete the following information):