Robotran C Documentation
Functions
mbs_trigo.c File Reference

This file declares the functions for trigonometric handling in MBsysC integrator in C. More...

#include "math.h"
#include "mbs_data.h"
#include "mbs_1D_array.h"
#include "mbs_message.h"

Functions

int mbs_init_sin_cos_q_vecs (MbsData *s, int *qrot_qu_indvec, int *qrot_qc_indvec, int *qrot_qv_indvec)
 Initialize the three vectors of indices (they are usually contained in the mbs_aux structure) More...
 
void mbs_compute_sin_cos_quc (MbsData *s, int *qrot_qu_indvec, int *qrot_qc_indvec)
 Compute the sine and cosine of non-dependant rotational joints. More...
 
void mbs_compute_sin_cos_qv (MbsData *s, int *qrot_qv_indvec)
 Compute the sine and cosine of dependant rotational joints. More...
 
void mbs_compute_sin_cos_q_all (MbsData *s)
 Compute the sine and cosine of the q_sin and q_cos, for all the rotational joints. More...
 

Detailed Description

This file declares the functions for trigonometric handling in MBsysC integrator in C.

Creation date: April 2022

Author
Sebastien Timmermans, Robotran Team

(c) Universite catholique de Louvain

Function Documentation

◆ mbs_compute_sin_cos_q_all()

void mbs_compute_sin_cos_q_all ( MbsData mbs_data)

Compute the sine and cosine of the q_sin and q_cos, for all the rotational joints.

Parameters
[in,out]MbsDataThe MBS structure in which the vector MbsData::q_sin and MbsData::q_cos are updated after calling this function.

◆ mbs_compute_sin_cos_quc()

void mbs_compute_sin_cos_quc ( MbsData mbs_data,
int *  qrot_qu_indvec,
int *  qrot_qc_indvec 
)

Compute the sine and cosine of non-dependant rotational joints.

Used as designed, it only set the values in MbsData::q_sin and MbsData::q_cos for the rotational joints that are either:

  • independent (qu), in qrot_qu_indvec;
  • driven (qc), in qrot_qc_indvec;

The function mbs_init_sin_cos_q_vecs() must having been called during the module initialization in order to fill qrot_qu_indvec and qrot_qc_indvec with the correct values.

Parameters
[in,out]MbsDataThe computed MBS structure, MbsData::q_sin and q_cos will be updated.
[in]qrot_qu_indvecThe vector (ivec_1, size 1xnjoint) containing 1 if the joint is both rotationnal and qu, otherwhise 0.
[in]qrot_qc_indvecThe vector (ivec_1, size 1xnjoint) containing 1 if the joint is both rotationnal and qc, otherwhise 0.

◆ mbs_compute_sin_cos_qv()

void mbs_compute_sin_cos_qv ( MbsData mbs_data,
int *  qrot_qv_indvec 
)

Compute the sine and cosine of dependant rotational joints.

Used as designed, it only set the values in MbsData::q_sin and MbsData::q_cos for the rotational joints that are dependent (qv), in qrot_qv_indvec;

The function mbs_init_sin_cos_q_vecs() must having been called during the module initialization in order to fill qrot_qv_indvec with the correct values.

Parameters
[in,out]MbsDataThe computed MBS structure, MbsData::q_sin and q_cos will be updated.
[in]qrot_qv_indvec
[in]qrot_qc_indvecThe vector (ivec_1, size 1xnjoint) containing 1 if the joint is both rotationnal and qv, otherwhise 0.

◆ mbs_init_sin_cos_q_vecs()

int mbs_init_sin_cos_q_vecs ( MbsData s,
int *  qrot_qu_indvec,
int *  qrot_qc_indvec,
int *  qrot_qv_indvec 
)

Initialize the three vectors of indices (they are usually contained in the mbs_aux structure)

Parameters
[in]MbsDataThe MBS structure giving the nature of joint (rot, qu, qv, qc)
[out]qrot_qu_indvec(ivec_1, size 1xnjoint) the vector containing 0 or 1,depending if the joint is rotationnal and qu
[out]qrot_qc_indvec(ivec_1, size 1xnjoint) the vector containing 0 or 1,depending if the joint is rotationnal and qc
[out]qrot_qv_indvec(ivec_1, size 1xnjoint) the vector containing 0 or 1,depending if the joint is rotationnal and qv
Returns
error, negative in case of failure, 0 in case all went well