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:

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 user_DrivenJoints.user_DrivenJoints(). The code to be inserted looks like:

# 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

The inverse kinematics computation requires an instance of MbsSolvekin. Then the analysis is performed by calling the function MbsSolvekin.run().

The options of the module are set with the function MbsSolvekin.set_options().