Robotran C Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Classes | Macros | Typedefs | Functions
mbs_dirdyn_struct.h File Reference
#include "mbs_aux.h"
#include "mbs_buffer.h"

Go to the source code of this file.

Classes

struct  MbsDirdynOptions
 Structure defining the option of a direct dynamic. More...
 
struct  MbsDirdyn
 General structure of the direct dynamic module. More...
 

Macros

#define DOPRI5_NB_ALLOC_VEC   8
 number of vectors to allocate for dopri5 More...
 
#define DIRDYN_INTEGRATOR_OPTION_DEFAULT_nmax   (int) 1e9
 Define of default options for integrator in DirdynStruc. More...
 
#define DIRDYN_INTEGRATOR_OPTION_DEFAULT_toler   1.0e-3
 
#define DIRDYN_INTEGRATOR_OPTION_DEFAULT_rtoler   1.0e-3
 
#define DIRDYN_INTEGRATOR_OPTION_DEFAULT_atoler   1.0e-6
 
#define DIRDYN_INTEGRATOR_OPTION_DEFAULT_dt_max   1.0e-3
 
#define DIRDYN_INTEGRATOR_WAYPOINT_TIME_ERROR_max   1.0e-10
 

Typedefs

typedef void(* initialize_integrator_ptr) (MbsData *mbs_data, MbsDirdyn *mbs_dd, int(*derivs) (double, double[], double[], MbsData *, MbsDirdyn *), void(*loop_fct) (MbsData *, MbsDirdyn *), int(*save_realtime_update) (MbsDirdyn *dd, MbsData *mbs_data))
 These three pointers of functions should be defined for each integrator separately, in the corresponding files They are called in dirdyn, according to the integrator chosen. More...
 
typedef int(* loop_integrator_ptr) (double t0, double tf, MbsData *mbs_data, MbsDirdyn *mbs_dd)
 main loop of integration, in which the integrator is called More...
 
typedef void(* finish_integrator_ptr) (MbsData *mbs_data, MbsDirdyn *mbs_dd)
 end of the integration, free the memory More...
 

Functions

int mbs_fct_dirdyn (double t, double y[], double dydt[], MbsData *s, MbsDirdyn *dd)
 direct dynamics derivative computation More...
 
int save_realtime_update (MbsDirdyn *dd, MbsData *mbs_data)
 update the real-time and saving modules if requested More...
 

Detailed Description

This header defines structure of the dirdyn module in C.

Creation date: 10/09/2015

Author
Nicolas Docquier, Timothée Habra

(c) Universite catholique de Louvain

Macro Definition Documentation

◆ DIRDYN_INTEGRATOR_OPTION_DEFAULT_atoler

#define DIRDYN_INTEGRATOR_OPTION_DEFAULT_atoler   1.0e-6

◆ DIRDYN_INTEGRATOR_OPTION_DEFAULT_dt_max

#define DIRDYN_INTEGRATOR_OPTION_DEFAULT_dt_max   1.0e-3

◆ DIRDYN_INTEGRATOR_OPTION_DEFAULT_nmax

#define DIRDYN_INTEGRATOR_OPTION_DEFAULT_nmax   (int) 1e9

Define of default options for integrator in DirdynStruc.

◆ DIRDYN_INTEGRATOR_OPTION_DEFAULT_rtoler

#define DIRDYN_INTEGRATOR_OPTION_DEFAULT_rtoler   1.0e-3

◆ DIRDYN_INTEGRATOR_OPTION_DEFAULT_toler

#define DIRDYN_INTEGRATOR_OPTION_DEFAULT_toler   1.0e-3

◆ DIRDYN_INTEGRATOR_WAYPOINT_TIME_ERROR_max

#define DIRDYN_INTEGRATOR_WAYPOINT_TIME_ERROR_max   1.0e-10

◆ DOPRI5_NB_ALLOC_VEC

#define DOPRI5_NB_ALLOC_VEC   8

number of vectors to allocate for dopri5

Typedef Documentation

◆ finish_integrator_ptr

typedef void(* finish_integrator_ptr) (MbsData *mbs_data, MbsDirdyn *mbs_dd)

end of the integration, free the memory

◆ initialize_integrator_ptr

typedef void(* initialize_integrator_ptr) (MbsData *mbs_data, MbsDirdyn *mbs_dd, int(*derivs)(double, double[], double[], MbsData *, MbsDirdyn *), void(*loop_fct)(MbsData *, MbsDirdyn *), int(*save_realtime_update)(MbsDirdyn *dd, MbsData *mbs_data))

These three pointers of functions should be defined for each integrator separately, in the corresponding files They are called in dirdyn, according to the integrator chosen.

initialization of the integrator structure(s)

◆ loop_integrator_ptr

typedef int(* loop_integrator_ptr) (double t0, double tf, MbsData *mbs_data, MbsDirdyn *mbs_dd)

main loop of integration, in which the integrator is called

Function Documentation

◆ mbs_fct_dirdyn()

int mbs_fct_dirdyn ( double  t,
double  y[],
double  dydt[],
MbsData s,
MbsDirdyn dd 
)

direct dynamics derivative computation

Parameters
[in]tcurrent simulation time [s]
[in]ystate vector of size n
[out]dydtderivative
[in,out]sRobotran main structure
[in,out]dddirect dynamic main module structure
Returns
MBS_INFO_SUCCESS in case of success, any other value in case of failure.

◆ save_realtime_update()

int save_realtime_update ( MbsDirdyn dd,
MbsData mbs_data 
)

update the real-time and saving modules if requested

Parameters
[in]dddirect dynamics module
[in]mbs_dataRobotran main structure
Returns
Error status, <0 in case of failure.