Skip to content

Commit

Permalink
cleanup README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
FabioBergonti committed Jul 12, 2023
1 parent c18efc5 commit 846e5a5
Showing 1 changed file with 27 additions and 25 deletions.
52 changes: 27 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@

**Multi bodY SimulaTor maxImal CoordinAtes**

**mystica** is a matlab library to simulate the kinematics of multibody systems.
**mystica** computes the system evolution modeling the problem using a state definition that we define _maximal_.
The _maximal_ representation consists of a set of _non-minimum_ variables 𝐪 complemented by holonomic constraint g(𝐪) = 0.
**mystica** is a MATLAB library to simulate the kinematics and dynamics of multibody systems.
**mystica** computes the system evolution by modeling the problem using a state definition that we define _maximal_.
The _maximal_ representation consists of a set of _non-minimum_ variables 𝐪 complemented by the holonomic constraint g(𝐪) = 0.

---

<p align="center">
<b>:warning: REPOSITORY UNDER DEVELOPMENT :warning:</b>
<br>The libraries implemented in this repository are still experimental and we cannot guarantee stable API
<br>The libraries implemented in this repository are still experimental, and we cannot guarantee a stable API.
</p>

---

### Table of content
### Table of Contents

- [:hammer: Dependencies](#hammer-dependencies)
- [:floppy\_disk: Installation](#floppy_disk-installation)
Expand All @@ -30,67 +30,69 @@ The _maximal_ representation consists of a set of _non-minimum_ variables 𝐪 c

## :hammer: Dependencies

- [`matlab`](https://mathworks.com/)
- [`matlab Curve Fitting Toolbox`](https://ch.mathworks.com/products/curvefitting.html) for [`smooth`](https://ch.mathworks.com/help/curvefit/smooth.html) function
- a matlab [supported-compilers](https://mathworks.com/support/requirements/supported-compilers.html) for MEX-file compilation
- [`MATLAB`](https://mathworks.com/)
- [`MATLAB Curve Fitting Toolbox`](https://ch.mathworks.com/products/curvefitting.html) for the [`smooth`](https://ch.mathworks.com/help/curvefit/smooth.html) function
- A MATLAB [supported compiler](https://mathworks.com/support/requirements/supported-compilers.html) for MEX-file compilation

Other requisites are:

- [`casadi`](https://web.casadi.org/)
- [`CasADi`](https://web.casadi.org/)
- [`yamlmatlab`](https://github.com/ewiger/yamlmatlab)

Both [`casadi`](https://web.casadi.org/) and [`yamlmatlab`](https://github.com/ewiger/yamlmatlab) are downloaded and configured in section [Installation](#floppy_disk-installation).
Both [`CasADi`](https://web.casadi.org/) and [`yamlmatlab`](https://github.com/ewiger/yamlmatlab) are downloaded and configured in the [Installation](#floppy_disk-installation) section.

## :floppy_disk: Installation

1. Clone the repo:

``` cmd
```cmd
git clone https://github.com/ami-iit/mystica.git
cd mystica
```

2. Run in **matlab** the function [`install()`](install.m).
``` matlab
2. Run the [`install()`](install.m) function in **MATLAB**.

```matlab
install()
```
The function [`install()`](install.m) downloads [`mambaforge`](https://github.com/conda-forge/miniforge#mambaforge). [`mambaforge`](https://github.com/conda-forge/miniforge#mambaforge) is a package manager that downloads and configures our dependencies in conda enviroment called `mystica`.
The [`install()`](install.m) function downloads [`mambaforge`](https://github.com/conda-forge/miniforge#mambaforge). [`mambaforge`](https://github.com/conda-forge/miniforge#mambaforge) is a package manager that downloads and configures our dependencies in a conda environment called `mystica`.
<details>
<summary>If you already have <a href="https://github.com/conda-forge/miniforge#mambaforge"><code>mambaforge</code></a></summary>
If you already have <a href="https://github.com/conda-forge/miniforge#mambaforge"><code>mambaforge</code></a> configured, you can call <a href="install.m"><code>install()</code></a> function defining <code>mambaforge_prefix</code> value:
If you already have <a href="https://github.com/conda-forge/miniforge#mambaforge"><code>mambaforge</code></a> configured, you can call the <a href="install.m"><code>install()</code></a> function by defining the <code>mambaforge_prefix</code> value:
<pre><code>install('mambaforge_prefix',&#60;your mambaforge path prefix&#62;)</code></pre>
</details>


⚠️ **Known issue**
For some versions of Ubuntu and Matlab, Matlab is not able to load the required libraries like CasADi (see [issue](https://github.com/ami-iit/mystica/issues/6)). A possible workaround is to launch `matlab` with LD_PRELOAD
For some versions of Ubuntu and MATLAB, MATLAB is not able to load the required libraries like CasADi (see [issue](https://github.com/ami-iit/mystica/issues/6)). A possible workaround is to launch `matlab` with LD_PRELOAD:
```
LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6 matlab
```

## :rocket: Usage

Before every usage remember to run the autogenerated matlab file called `deps/setup.m` to setup the `MATLABPATH`.
Before every usage, remember to run the autogenerated MATLAB file called `deps/setup.m` to set up the `MATLABPATH`.

Alternatively, you can launch MATLAB from the terminal after activating the conda environment called `mystica`:

Alternatively, you can launch matlab from terminal after having activated the conda enviroment called `mystica`:
``` cmd
```cmd
conda activate mystica
matlab
```

Here a snippet of a code to simulate the kinematics of a 4 bar linkage mechanism:
Here's a snippet of code to simulate the kinematics of a 4-bar linkage mechanism:

``` matlab
```matlab
model = mystica.model.getModel4BarLinkage();
stgs = mystica.stgs.getDefaultSettingsSimKinRel(model);
data = mystica.runSimKinRel('model',model,'stgs',stgs,'mBodyPosQuat_0',model.getMBodyPosQuatRestConfiguration,'nameControllerClass','mystica.controller.ExampleKinRel');
mystica.viz.visualizeKinRel('model',model,'data',data,'stgs',stgs)
data = mystica.runSimKinRel('model', model, 'stgs', stgs, 'mBodyPosQuat_0', model.getMBodyPosQuatRestConfiguration, 'nameControllerClass', 'mystica.controller.ExampleKinRel');
mystica.viz.visualizeKinRel('model', model, 'data', data, 'stgs', stgs)
```

Other examples can be found in the [examples directory](examples).

If you want to go deep into the code, we prepared [this document](docs/nomenclature.md) as an entry point to explain and describe our variables.
If you want to delve deeper into the code, we have prepared [this document](docs/nomenclature.md) as an entry point to explain and describe our variables.

## :gear: Contributing

**mystica** is an open-source project, and is thus built with your contributions. We strongly encourage you to open an issue with your feature request. Once the issue has been opened, you can also proceed with a pull-request :rocket:
**mystica** is an open-source project and is built with your contributions. We strongly encourage you to open an issue with your feature request. Once the issue has been opened, you can also proceed with a pull request. :rocket:

0 comments on commit 846e5a5

Please sign in to comment.