Authentication method changed. UCLouvain users, please use the "UCLouvain SSO" button to connect on the website and use ssh + ssh key (https://git.immc.ucl.ac.be/-/profile/keys) or https + personnal access token (https://git.immc.ucl.ac.be/-/profile/personal_access_tokens) in your git clients.

Commit c3edd27e authored by Nicolas Docquier's avatar Nicolas Docquier
Browse files

Merge branch 'release_1.12.0' into 'master'

Release 1.12.0

See merge request robotran/mbsysc!287
parents 46e0b945 50456d25
......@@ -7,6 +7,7 @@ stages:
- test_Tutorial_Modelling_Separate
- test_Tutorial_Analysis_Separate
- test_Various
- test_Issues
- deploy
# --------------------------------------------------------------------------
......@@ -73,7 +74,9 @@ tutorial_8:
coman_mbsysC:
image: robotran/ubuntu18-robotran-opengl:v1
stage: test_Dev
allow_failure: true
before_script:
- apt update
- apt install -y git
- git submodule sync --recursive
- git submodule update --init --recursive
......@@ -91,13 +94,13 @@ coman_mbsysC:
# Testing PendulumSpringC Example project
# --------------------------------------------------------------------------
compilation_monolithic_realtimeON_OpenGL:
compilation_monolithic_realtimeOFF:
image: robotran/ubuntu18-robotran-opengl:v1
stage: test_Pendulum_Spring
script:
- mkdir ExampleProjects/PendulumSpringC/workR/build
- cd ExampleProjects/PendulumSpringC/workR/build
- cmake -DFLAG_REAL_TIME=ON -DFLAG_OPEN_GL=ON -DFLAG_JAVA=OFF ..
- cmake -DFLAG_REAL_TIME=OFF ..
- make
- ./exe_PendulumSpringC
- ./exe_PendulumSpringC_several_run
......@@ -525,6 +528,19 @@ Python_interface_realtimeON:
- cd ..
- python main.py
# ---- CartPendulum: LQR (Linear quadratic regulator) ----
CartPendulum:
image: robotran/ubuntu18-robotran-opengl:v1
stage: test_Various
dependencies:
- MBsysC_realtimeON
script:
- mkdir ExampleProjects/CartPendulum/workR/build
- cd ExampleProjects/CartPendulum/workR/build
- cmake -DFLAG_SEPARATE_BUILD=ON ..
- make
- ./exe_CartPendulum
# ---- PendulumSpring123: example project for customzied loading with specified symb and user libs ----
PendulumSpring123:
image: robotran/ubuntu18-robotran-opengl:v1
......@@ -539,6 +555,59 @@ PendulumSpring123:
- make
- ./exe_PendulumSpring123
# ---- Delta pick and place Robot, Separate ----
Delta_Robot_Invdyn_Monolithic_and_separate:
image: robotran/ubuntu18-robotran-opengl:v1
stage: test_Various
dependencies:
- MBsysC_realtimeON
script:
- mkdir ExampleProjects/miscellaneous/Invdyna_Delta/workR/build
- cd ExampleProjects/miscellaneous/Invdyna_Delta/workR/build
- cmake -DFLAG_SEPARATE_BUILD=ON ..
- make
- ./exe_delta
- cmake -DFLAG_SEPARATE_BUILD=OFF .
- make
- ./exe_delta
# --------------------------------------------------------------------------
# Issues, solved must not fail, currently under study may fail
# Prefer separate build for speed.
# --------------------------------------------------------------------------
issue_163:
image: robotran/ubuntu18-robotran-opengl:v1
stage: test_Issues
allow_failure: false
dependencies:
- MBsysC_realtimeON
script:
- mkdir TestProjects/Issue_163/workR/build
- cd TestProjects/Issue_163/workR/build
- cmake -DFLAG_SEPARATE_BUILD=ON ..
- make
- ./exe_Bodies_and_Joints
only:
- release_1.12.0
issue_170_User_Model:
image: robotran/ubuntu18-robotran-opengl:v1
stage: test_Issues
allow_failure: false
dependencies:
- MBsysC_realtimeON
script:
- mkdir TestProjects/Issue_170/workR/build
- cd TestProjects/Issue_170/workR/build
- cmake -DFLAG_SEPARATE_BUILD=OFF ..
- make
- ./exe_Issue_170
- cmake -DFLAG_SEPARATE_BUILD=ON .
- make
- ./exe_Issue_170
only:
- release_1.12.0
# --------------------------------------------------------------------------
......
## Changes for next release
* ? Coupling VPM branch merge : to check with DG
* ....
## Robotran v1.12.0
* [New] Inverse Dynamic module (Invdyn)
* See examples `PendulumSpringC` and `miscellaneous/Invdyna_Delta`
* XML loading:
* New structure names and new functions (adding a mission flag in binding functions)
* **Requires to generate again user files (and user file generation application)**
* Check `user IO` and `user model` size coherence between loaded `.mbs` file and compiled project (Error -900). Do not check type coherence.
* [User derivative] [Dirdyn] The option "compute_all_uxd" is added during direct dynamic module.
The user can choose between the time-integration of all user_derivative or none. Per default, the flag is ON (= 1 = all are computed).
* [Integrators] Euler Implicit and W-Methods are now functional but have not been extensively tested.
## Robotran v1.11.2
* [New] error management in all module
......
# https://EditorConfig.org
# For all C source and header
[*.{c,h}]
charset = utf-8
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4
[CMakeLists.txt]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 4
# MBsysC: Contribution files, all you need to know before developing MBsysC
This folder contains all the information about MBsysC organisation, coding convention, templates, ...
MbsysC is the C implementation for [Robotran](http://www.robotran.be/)
# Coding convention
## Naming convention
Two naming rules are used in MBsysC, the _CamelCase_ rule and the _lower_case_with_underscores_:
* __Structures__ follow the _CamelCase_ rule: `struct MbsData`
* __Variables__ (including arguments) follow the _lower_case_with_underscores_ rule: `MbsData *mbs_data;` or `mbs_data->mbs_filename; `
* __Functions__ follow the _lower_case_with_underscores_ rule: `MbsDirdyn* mbs_new_dirdyn(MbsData* mbs_data);`
## Statements
* Avoid single-line statement;
* Always use braces;
* Opening braces have to be on the statement line;
* Closing brace should be alone, aligned with the statement;
* An identation (4 spaces, see later) is mandatory.
__A good example:__
```c
if(i<1){
/* do stuffs */
}
```
This is tolerated, but not recommended:
```c
if(i<1) {/* do one-line instruction */}
```
All the following should be banned:
```c
if(i<1)
/* do one-line instruction */
```
```c
if(i<1) /* do one-line instruction */
```
```c
if(i<1){
/* do stuffs */
/* do other stuffs */}
```
## IDEs and editors configuration
* __Identation__ are __4 spaces__ characters not tabular (`\t`);
* __Remove white spaces__ from end of line;
* __File encoding__ is __UTF8__;
* __End of line__ (EOL) is __LF__ (`\n`);
* __Files end__ by one newline.
## Documentation
The documentation is provided online and synchronized with the _dev_ branch: [MbsysC Doc](http://robotran.git-page.immc.ucl.ac.be/mbsysc/).
General rules:
* All function should be documented (purpose, arguments, return values)
* The documentation is written in the header files.
Here is an example __for a function__:
```C
/*! \brief 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.
*
* \param[in,out] q_vec original q vector, have to be initialized at size njoint
* \param[in] nq number of elements in the original vector
* \param[in] old_q old index to remove
*
* \return the number of elements in the updated vector
*/
int remove_mbs_q_elem(int *q_vec, int nq, int old_q);
```
* `\brief` is followed by one-line, short description. After a blank line full description can be given.
* `\param` (or `\p`) is followed by:
* `[in]` if the argument is only read by the function;
* `[out]` if the argument is only modified by the function;
* `[in,out]` if the argument is read and modified by the function;
* The argument name and then the description its description.
* `\return` is followed by the description of the returned values.
Another example, for a structure:
```
/*!
* Structure containing the definition of the Multibody System.
*/
struct MbsData
{
int npt; //! Number of anchor points.
double *dpt[3+1]; //! Array containing the coordinate of all anchor points.
int *qlocked; //! Array with the indices of locked articulations.
//! Those articulations have a constant position defined by the user \f$ q(nqc)=cte \f$.
double **SWr;//! Array of Swr vector for each external forces.
//! Swr(9,1) = [Fx; Fy; Fz; Mx; My; Mz; dxF]:
//! - Force components (expressed in the inertial frame) : Fx, Fy, Fz
//! - Pure torque components (expressed in the inertial frame) : Mx, My, Mz
//! - Application point local coordinates vector (expressed in the body-fixed frame): dxF(1:3,1)
//!
//! WARNING: Indexes convention is the opposite of what is usually done in MBsysC.
};
```
Nothing special, but note:
* LaTeX equations are supported: `\f$ q(nqc)=cte \f$` ;
* First line appear on the summary of the member, other line in the detailed part of the documentation;
* Lists are supported.
# Error handling
All you need to know about error management in MBsysC is in the wiki [error code](https://git.immc.ucl.ac.be/robotran/mbsysc/wikis/error-code)
# MBsysC filetree structure
```bash
.
├──Contribute
├──ExampleProjects
├──MBsysC
│  ├── cmake_aux : Various CMake stuffs
│  ├── conf : CMake specific file to find libraries
│  ├── mbs_app : Source file for stand alone application related to MBsysC
│  ├── mbs_common : Source files
│  │   ├── mbs_add_on
│  │   ├── mbs_load_xml
│  │   ├── mbs_module
│  │   ├── mbs_numerics
│  │   │   └── mbs_integrators
│  │   ├── mbs_realtime
│  │   ├── mbs_struct
│  │   ├── mbs_utilities
│  │   └── mbs_void_symbolicR
│  ├── mbs_documentation
│  ├── mbs_interface : Source code for interfacing with other languages
│  ├── mbs_workspace_template : Templates for Robotran project with MBsysC
│  ├── mbsyspad
│  ├── mbsyspad_mac_os
│  ├── opengl_mbs
│  ├── readme_aux
│  ├── tests : Instruction for CI test
│  └── win64_include_lib: External compiled libraries
```
# Gitlab
* Automatic tests (Tutorials and specifics projetcs) runs online when pushing to gitlab:
* Some tests are only done in the _dev_ branch;
* The documentation is build when committing on the _dev_ branch;
* Avoid test running by putting `[Ci-skip]` anywhere in the commit message (with brackets);
* Never merge your own merge request, ask a colleague.
* Never commit in the _dev_ and _master_ branches.
/**
* @file template_c_file.c
*
* This c file defines an example of the c files to be used in MBsysC
*
*
* Creation date: 19-06-2019
* @author Robotran team
*
* (c) Universite catholique de Louvain
*/
#include "mbs_dirdyn.h"
#include "mbs_message.h"
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
MbsDirdyn* mbs_new_dirdyn(MbsData* mbs_data)
{
MbsAux* mbs_aux;
// some local comment
mbs_aux = initMbsAux(mbs_data);
/*------------------------------------------*/
/* TO DELIMIT A BIGGER PART OF THE CODE */
/*------------------------------------------*/
return mbs_new_dirdyn_aux(mbs_data, mbs_aux);
}
/**
* @file template_c_file.h
*
* This header defines an example of the header files to be used in MBsysC
*
*
* Creation date: 19-06-2019
* @author Robotran team
*
* (c) Universite catholique de Louvain
*/
#ifndef MBS_DIRDYN_h
#define MBS_DIRDYN_h
#include "mbs_data.h"
#ifdef __cplusplus
extern "C" {
#endif
/** @brief Enumeration of the possible computation of Qc in dirdyn
*
*
*/
enum { COMPUTE_ALL_QC};
/**
* FUNCTION DESCRIPTION
*
* \param mbs_data the data structure of the model for which
* the time integration will be computed
* \output ??
*/
MbsDirdyn* mbs_new_dirdyn(MbsData* mbs_data);
#endif
<?xml version="1.0" encoding="UTF-8"?>
<mbsDescR7>
<mbsname>CartPendulum</mbsname>
<mbsyspad_version>1.11.0</mbsyspad_version>
<base>
<!--this is the base body-->
<gravity>
<coordinates>
<x>0.0</x>
<y>0.0</y>
<z>-9.81</z>
</coordinates>
</gravity>
<baseBodyName>Body_0</baseBodyName>
<graphics>
<x2D>
<position>
<x>482.0</x>
<y>394.0</y>
</position>
<base_body>
<position>
<x>-157.0</x>
<y>-18.0</y>
</position>
<name_pos>
<x>0.0</x>
<y>0.0</y>
</name_pos>
<shape>rectangle</shape>
<size>
<x>418.0</x>
<y>40.0</y>
</size>
<control_points>
<control_point>
<x>261.0</x>
<y>-18.0</y>
</control_point>
<control_point>
<x>261.0</x>
<y>22.0</y>
</control_point>
<control_point>
<x>-157.0</x>
<y>22.0</y>
</control_point>
<control_point>
<x>-157.0</x>
<y>-18.0</y>
</control_point>
</control_points>
<angle>0.0</angle>
</base_body>
</x2D>
<x3D>
<x3D_points />
<x3D_lines />
<x3D_shapes>
<box>
<name>ground</name>
<position>
<x>0.0</x>
<y>0.0</y>
<z>0.0</z>
</position>
<scale>
<x>1.0</x>
<y>1.0</y>
<z>1.0</z>
</scale>
<rotation>
<x>0.0</x>
<y>0.0</y>
<z>0.0</z>
</rotation>
<color R="153" G="153" B="153" />
<specularColor R="255" G="255" B="255" />
<shininess>250.0</shininess>
<transparency>0.0</transparency>
<size>
<x>50.0</x>
<y>0.1</y>
<z>0.001</z>
</size>
</box>
<box>
<name>setpoint_1m</name>
<position>
<x>1.0</x>
<y>-0.1</y>
<z>0.0</z>
</position>
<scale>
<x>1.0</x>
<y>1.0</y>
<z>1.0</z>
</scale>
<rotation>
<x>0.0</x>
<y>0.0</y>
<z>0.0</z>
</rotation>
<color R="255" G="0" B="255" />
<specularColor R="255" G="255" B="255" />
<shininess>250.0</shininess>
<transparency>0.0</transparency>
<size>
<x>0.05</x>
<y>0.1</y>
<z>0.1</z>
</size>
</box>
</x3D_shapes>
</x3D>
</graphics>
</base>
<bodytree>
<!--this is the body tree-->
<body>
<bodyname>Cart</bodyname>
<parent>
<bodyname>base</bodyname>
<pointname>origin</pointname>
</parent>
<joint>
<jointname>T1_Cart</jointname>
<type>T1</type>
<nature>independent</nature>
<actuated />
<graphics>
<x2D>
<position>
<x>555.0</x>
<y>306.0</y>
</position>
</x2D>
<x3D>
<x3D_joint />
<x3D_frame />
</x3D>
</graphics>
</joint>
<mass>1.0</mass>
<graphics>
<x2D>
<position>
<x>-124.0</x>
<y>-37.0</y>
</position>
<name_pos>
<x>0.0</x>
<y>0.0</y>
</name_pos>
<shape>rectangle</shape>
<size>
<x>222.0</x>
<y>61.0</y>
</size>
<control_points>
<control_point>
<x>98.0</x>
<y>-37.0</y>
</control_point>
<control_point>
<x>98.0</x>
<y>24.0</y>
</control_point>
<control_point>
<x>-124.0</x>
<y>24.0</y>
</control_point>
<control_point>
<x>-124.0</x>
<y>-37.0</y>
</control_point>
</control_points>
<angle>0.0</angle>
</x2D>
<x3D>
<x3D_com />
<x3D_points />
<x3D_lines />
<x3D_shapes>
<box>
<name>New_Shape</name>
<position>
<x>0.0</x>
<y>0.0</y>
<z>0.0</z>
</position>
<scale>
<x>1.0</x>
<y>1.0</y>
<z>1.0</z>
</scale>
<rotation>
<x>0.0</x>
<y>0.0</y>
<z>0.0</z>
</rotation>
<color R="0" G="0" B="0" />
<specularColor R="255" G="255" B="255" />
<shininess>250.0</shininess>
<transparency>0.30000001192092896</transparency>
<size>
<x>0.5</x>
<y>0.1</y>
<z>0.1</z>
</size>
</box>
</x3D_shapes>
</x3D>
</graphics>
</body>
<body>
<bodyname>Pendulum</bodyname>
<parent>
<bodyname>Cart</bodyname>
<pointname>origin</pointname>
</parent>
<joint>
<jointname>R3_Pendulum</jointname>
<type>R3</type>
<nature>driven</nature>
<initialvalue>
<q>3.1416</q>
</initialvalue>
<symbols>
<q />
<qd />
<qdd />
</symbols>
<graphics>
<x2D>
<position>
<x>486.0</x>
<y>222.0</y>
</position>
</x2D>
<x3D>
<x3D_joint />
<x3D_frame />
</x3D>
</graphics>
</joint>
<joint>
<jointname>R2_Pendulum</jointname>
<type>R2</type>
<nature>independent</nature>
<graphics>
<x2D>
<position>
<x>597.0</x>
<y>231.0</y>