Robotran C Documentation

Direct dynamics

Time integration of the system direct dynamics.
For more information, see Robotran theoritical framework.

Code sample

For running the direct dynamics, insert the following code in your main script and adapt it to your need :

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
/* DIRECT DYNANMICS *
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
MbsDirdyn *mbs_dirdyn;
mbs_dirdyn = mbs_new_dirdyn(mbs_data);
// dirdyn options (see documentations for additional options)
mbs_dirdyn->options->dt0 = 1e-3;
mbs_dirdyn->options->tf = 10.0;
mbs_dirdyn->options->save2file = 1;
mbs_dirdyn->options->respath = PROJECT_SOURCE_DIR"/../resultsR";
mbs_dirdyn->options->animpath = PROJECT_SOURCE_DIR"/../animationR";
//mbs_dirdyn->options->realtime = 1;
mbs_run_dirdyn(mbs_dirdyn, mbs_data);
mbs_delete_dirdyn(mbs_dirdyn, mbs_data);

Use

The direct dynamics is performed by the function mbs_run_dirdyn().

The user specifies the desired options of the direct dynamics in MbsDirdynOptions structure. The results are provided in the MbsBuffer structure (par of the MBS_part structure) and written to files at the end of computation.

You should call successively :