Robotran C Documentation
Functions
mbs_sensor_utilities.c File Reference
#include <stdlib.h>
#include "mbs_sensor.h"
#include "mbs_data.h"
#include "mbs_project_interface.h"

Functions

void allocate_sensor (MbsSensor *psens, int njoint)
 Allocate the Jacobian matrix of the MbsSensor according to the number of joints in the multibody system. More...
 
void init_sensor (MbsSensor *psens, int njoint)
 Initialize all fields of MbsSensor structure to 0. More...
 
void free_sensor (MbsSensor *psens)
 Deprecated: Free the memory inside MbsSensor structure. i.e. free the space allocated for the jacobian matrix and the rotation matrix of the sensor. More...
 
MbsSensormbs_new_sensor (MbsData *mbs_data)
 Create a new MbsSensor structure, allocate and initialize the memory for all fields. More...
 
void mbs_delete_sensor (MbsSensor *psens)
 Free the memory of MbsSensor structure. and its contents. More...
 
void mbs_comp_S_sensor (MbsSensor *psens, MbsData *mbs_data, int isens)
 Compute all fields of the specified sensor. More...
 
void mbs_comp_F_sensor (MbsSensor *psens, MbsData *mbs_data, int isens)
 Compute all fields of the specified force sensor. More...
 
void mbs_comp_gen_sensor (MbsSensor *psens, MbsData *mbs_data, int joint_id)
 Compute all fields of a sensor located on the specified joint. More...
 

Function Documentation

◆ allocate_sensor()

void allocate_sensor ( MbsSensor psens,
int  njoint 
)

Allocate the Jacobian matrix of the MbsSensor according to the number of joints in the multibody system.

Parameters
[in,out]psensPointer to the MbsSensor structure to modify.
[in]njointNumber of joint in the MBS, see MbsData::njoint.

◆ free_sensor()

void free_sensor ( MbsSensor psens)

Deprecated: Free the memory inside MbsSensor structure. i.e. free the space allocated for the jacobian matrix and the rotation matrix of the sensor.

Parameters
[in,out]psensPointer to the MbsSensor structure to be freed.

◆ init_sensor()

void init_sensor ( MbsSensor psens,
int  njoint 
)

Initialize all fields of MbsSensor structure to 0.

Parameters
[in,out]psensPointer to the MbsSensor structure to initialize.
[in]njointNumber of joint in the MBS, see MbsData::njoint.

◆ mbs_comp_F_sensor()

void mbs_comp_F_sensor ( MbsSensor psens,
struct MbsData mbs_data,
int  isens 
)

Compute all fields of the specified force sensor.

Parameters
[in,out]psensPointer to the MbsSensor structure to compute.
[in]mbs_datapointer to the MbsData structure of the model related to the sensor.
[in]isensthe ID of the force sensor.

◆ mbs_comp_gen_sensor()

void mbs_comp_gen_sensor ( MbsSensor psens,
struct MbsData mbs_data,
int  joint_id 
)

Compute all fields of a sensor located on the specified joint.

Parameters
[in,out]psensPointer to the MbsSensor structure to compute.
[in]mbs_datapointer to the MbsData structure of the model related to the sensor.
[in]joint_idthe ID of the joint.

◆ mbs_comp_S_sensor()

void mbs_comp_S_sensor ( MbsSensor psens,
struct MbsData mbs_data,
int  isens 
)

Compute all fields of the specified sensor.

Parameters
[in,out]psensPointer to the MbsSensor structure to compute.
[in]mbs_datapointer to the MbsData structure of the model related to the sensor.
[in]isensthe ID of the sensor.

◆ mbs_delete_sensor()

void mbs_delete_sensor ( MbsSensor psens)

Free the memory of MbsSensor structure. and its contents.

It frees the MbsSensor structure itself and all its fields.

Parameters
[in,out]psensPointer to the MbsSensor structure to be freed.

◆ mbs_new_sensor()

MbsSensor* mbs_new_sensor ( struct MbsData mbs_data)

Create a new MbsSensor structure, allocate and initialize the memory for all fields.

This function calls allocate_sensor and init_sensor.