Robotran C Documentation
Functions
mbs_set.c File Reference
#include "mbs_set.h"
#include <stdio.h>
#include <stdlib.h>
#include "useful_functions.h"
#include "mbs_message.h"
#include "mbs_errors_names.h"

Functions

void mbs_set_nb_userc (MbsData *mbs_data, int Nuserc)
 Set the number of user constraints and update the related structures. More...
 
void mbs_set_qu (MbsData *mbs_data, int qu)
 set a variable to independent partition More...
 
void mbs_set_qv (MbsData *mbs_data, int qv)
 set a variable to dependent partition More...
 
void mbs_set_qdriven (MbsData *mbs_data, int qdriven)
 set a variable to driven partition More...
 
void mbs_set_qlocked (MbsData *mbs_data, int qlocked)
 set a variable to locked partition More...
 
void mbs_set_qa (MbsData *mbs_data, int qa)
 set a variable to actuated partition More...
 
void mbs_unset_qa (MbsData *mbs_data, int qa)
 unset a variable from the actuated partition More...
 
void mbs_empty_qa (MbsData *mbs_data)
 Remove all joints from the actuated partition. More...
 
void udpate_nq (MbsData *mbs_data, int new_nqu, int new_nqv, int new_nqc, int new_nqdriven, int new_nqlocked)
 DEPRECATED; do not use: update the nq variables, SHOULD not be used The function still works, however the number of joint of a specific nature should have been updated at the same time as the nature of the joint was changed. More...
 
int add_mbs_q_elem (int *q_vec, int nq, int new_q)
 add a new index in a q vector It does not modify the vector and vector size if the index is already in the q vector. More...
 
int remove_mbs_q_elem (int *q_vec, int nq, int old_q)
 remove an old index in a q vector It does not modify the vector and vector size if the index is not in the q vector. More...
 
void print_mbs_q_all (MbsData *mbs_data)
 print the vectors qu, qv, qc, qdriven and qlocked More...
 
void print_mbs_q_vec (int *q_vec, int nq)
 print a vector of indexes with first elem in brackets More...
 

Detailed Description

Creation date: 11/06/2015

Author
Olivier Lantsoght (based on the work of other from CEREM)

(c) Universite catholique de Louvain

Function Documentation

◆ add_mbs_q_elem()

int add_mbs_q_elem ( int *  q_vec,
int  nq,
int  new_q 
)

add a new index in a q vector It does not modify the vector and vector size if the index is already in the q vector.

Parameters
[in,out]q_vecoriginal q vector, have to be initialized at size njoint
[in]nqnumber of elements in the original vector
[in]new_qnew index to add
Returns
the number of elements in the updated vector, negative in case of failure (error)

◆ mbs_empty_qa()

void mbs_empty_qa ( MbsData mbs_data)

Remove all joints from the actuated partition.

Parameters
[in,out]mbs_dataMbsData structure to modify

This function must be called after mbs_load()

◆ mbs_set_nb_userc()

void mbs_set_nb_userc ( MbsData mbs_data,
int  Nuserc 
)

Set the number of user constraints and update the related structures.

Parameters
[in,out]mbs_dataMbsData structure to modify
[in]Nusercnumber of user constraints

This function must be called between mbs_load() and mbs_new_part() in 'main.c'

◆ mbs_set_qa()

void mbs_set_qa ( MbsData mbs_data,
int  qa 
)

set a variable to actuated partition

Parameters
[in,out]mbs_dataMbsData structure to modify
[in]qavariable to set to actuated

This function must be called after mbs_load()

◆ mbs_set_qdriven()

void mbs_set_qdriven ( MbsData mbs_data,
int  qdriven 
)

set a variable to driven partition

Parameters
[in,out]mbs_dataMbsData structure to modify
[in]qdrivenvariable to set to driven

This function must be called between mbs_load() and mbs_new_part() in 'main.c'

◆ mbs_set_qlocked()

void mbs_set_qlocked ( MbsData mbs_data,
int  qlocked 
)

set a variable to locked partition

Parameters
[in,out]mbs_dataMbsData structure to modify
[in]qlockedvariable to set to locked

This function must be called between mbs_load() and mbs_new_part() in 'main.c'

◆ mbs_set_qu()

void mbs_set_qu ( MbsData mbs_data,
int  qu 
)

set a variable to independent partition

Parameters
[in,out]mbs_dataMbsData structure to modify
[in]quvariable to set to independent

This function must be called between mbs_load() and mbs_new_part() in 'main.c'

◆ mbs_set_qv()

void mbs_set_qv ( MbsData mbs_data,
int  qv 
)

set a variable to dependent partition

Parameters
[in,out]mbs_dataMbsData structure to modify
[in]qvvariable to set to dependent

This function must be called between mbs_load() and mbs_new_part() in 'main.c'

◆ mbs_unset_qa()

void mbs_unset_qa ( MbsData mbs_data,
int  qa 
)

unset a variable from the actuated partition

Parameters
[in,out]mbs_dataMbsData structure to modify
[in]qavariable to unset form the actuated partition

This function must be called after mbs_load()

◆ print_mbs_q_all()

void print_mbs_q_all ( MbsData mbs_data)

print the vectors qu, qv, qc, qdriven and qlocked

Parameters
[in]mbs_dataMbsData structure to modify

◆ print_mbs_q_vec()

void print_mbs_q_vec ( int *  q_vec,
int  nq 
)

print a vector of indexes with first elem in brackets

Parameters
[in]q_vecvector to print
[in]nqsize of the vector - 1

◆ remove_mbs_q_elem()

int remove_mbs_q_elem ( int *  q_vec,
int  nq,
int  old_q 
)

remove an old index in a q vector It does not modify the vector and vector size if the index is not in the q vector.

Parameters
[in,out]q_vecoriginal q vector, have to be initialized at size njoint
[in]nqnumber of elements in the original vector
[in]old_qold index to remove
Returns
the number of elements in the updated vector, negative in case of failure (error)

◆ udpate_nq()

void udpate_nq ( MbsData mbs_data,
int  new_nqu,
int  new_nqv,
int  new_nqc,
int  new_nqdriven,
int  new_nqlocked 
)

DEPRECATED; do not use: update the nq variables, SHOULD not be used The function still works, however the number of joint of a specific nature should have been updated at the same time as the nature of the joint was changed.

Parameters
[in,out]mbs_dataMbsData structure to modify
[in]new_nquthe new number of independent joints
[in]new_nqvthe new number of dependent joints
[in]new_nqcthe new number of driven and locked joints
[in]new_nqdriventhe new number of driven joint
[in]new_nqlockedthe new number of locked joint