Commit 440d58ed authored by Simon Hinnekens's avatar Simon Hinnekens
Browse files

Merge branch 'Doc_Py_Mooc' into 'dev'

Doc py mooc

See merge request robotran/mbsysc!397
parents c12d7589 aef7a9a1
......@@ -8,8 +8,8 @@ see `Robotran theoretical framework <http://robotran-doc.git-page.immc.ucl.ac.be
Code sample
-----------
For running the inverse dynamics, insert the following code in your main script
and adapt it to your need:
For running the inverse dynamics, in the current configuration, insert the following
code in your main script and adapt it to your need:
.. code-block:: python
......@@ -18,6 +18,34 @@ and adapt it to your need:
mbs_invdyn.set_options(motion = "oneshot")
mbs_invdyn.run()
You can compute the inverse dynamics for a time-define trajectory by providing the
trajectory files as follow:
.. code-block:: python
# Set all driven joint as independent
mbs_data.set_qu(mbs_data.qc[1:].tolist())
mbs_data.process = 6
mbs_invdyn = MBsysPy.MbsInvdyn(mbs_data)
# Set the motion to be solved as a trajectory
mbs_invdyn.set_options(motion = "trajectory")
# Provide the trajectory files to use
mbs_invdyn.set_options(trajectoryqname = "../resultsR/inverse_kinematics_q.res",
trajectoryqdname = "../resultsR/inverse_kinematics_qd.res",
trajectoryqddname = "../resultsR/inverse_kinematics_qdd.res")
# Provide the time interval and time step to solve the inverse dynamics.
mbs_invdyn.set_options(t0 = 0.0, tf = 6.0, dt = 1e-3)
# The final time "tf' must be less than the last time of the trajectory files.
mbs_invdyn.run()
In all cases the analysis requires actuated joint, see next section to set them.
Use
---
......
......@@ -8,8 +8,8 @@ framework <http://robotran-doc.git-page.immc.ucl.ac.be/RobotranBasic/Robotran_ba
Code sample
-----------
For running the kinematics analysis, insert the following code in your main
script and adapt it to your need:
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
......@@ -23,6 +23,27 @@ script and adapt it to your need:
)
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
---
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment