Loop and Inverse Kinematics =========================== Computation of the inverse kinematics of system containing constraints (kinematics constraints or user-specified). For more information, see `Robotran theoretical framework `_. Code sample ----------- For running the kinematics analysis while providing trajectory files, insert the following code in your main script and adapt it to your need: .. code-block:: python mbs_data.process = 5 mbs_solvekin = MBsysPy.MbsSolvekin(mbs_data) mbs_solvekin.set_options(motion = "trajectory", trajectoryqname = "../resultsR/dirdyn_q.res", trajectoryqdname = "../resultsR/dirdyn_qd.res", trajectoryqddname = "../resultsR/dirdyn_qdd.res", t0 = 1.3333, tf = 1.4, dt = 1e-4, framerate = 1e4 ) mbs_solvekin.run() You can compute the inverse kinematics by setting all independant joints as driven joints and defining the trajectory in :py:func:`user_DrivenJoints.user_DrivenJoints()`. The code to be inserted looks like: .. code-block:: python # Set all independant joint as driven joint mbs_data.set_qdriven(mbs_data.qu[1:].tolist()) mbs_data.process = 5 mbs_solvekin = MBsysPy.MbsSolvekin(mbs_data) # Set the motion to be solved as a trajectory mbs_solvekin.set_options(motion = "trajectory") # Provide the time interval and time step to solve the inverse kinematics. mbs_solvekin.set_options(t0 = 0.0, tf = 6.0, dt = 1e-3) mbs_solvekin.run() Use --- .. py:currentmodule:: MBsysPy.mbsyspy.mbs_solvekin The inverse kinematics computation requires an instance of :py:class:`MbsSolvekin`. Then the analysis is performed by calling the function :py:func:`MbsSolvekin.run`. The options of the module are set with the function :py:func:`MbsSolvekin.set_options`.