Skip to content

Commit

Permalink
Add usage notes
Browse files Browse the repository at this point in the history
  • Loading branch information
flferretti committed Jan 15, 2024
1 parent a0161e4 commit daa5a9e
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions examples/Parallel_computing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@
"\n",
"<a target=\"_blank\" href=\"https://colab.research.google.com/github/flferretti/jaxsim/blob/example/parallel/examples/Parallel_computing.ipynb\">\n",
" <img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/>\n",
"</a>\n",
"\n",
"</a>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"First, we install the necessary packages and import them."
]
},
Expand Down Expand Up @@ -55,7 +60,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"We will use a simple sphere model to simulate a free-falling body. The spheres set will be composed of 9 spheres, each with a different position. The spheres will be simulated in parallel, and the simulation will be run for 3000 steps corresponding to 3 seconds of simulation."
"We will use a simple sphere model to simulate a free-falling body. The spheres set will be composed of 9 spheres, each with a different position. The spheres will be simulated in parallel, and the simulation will be run for 3000 steps corresponding to 3 seconds of simulation.\n",
"\n",
"**Note**: Parallel simulations are independent of each other, the different position is imposed only to show the parallelization visually."
]
},
{
Expand Down Expand Up @@ -157,7 +164,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"In order to parallelize the simulation, we first need to define a function `simulate` for a single element of the batch."
"In order to parallelize the simulation, we first need to define a function `simulate` for a single element of the batch.\n",
"\n",
"**Note:** [`step_over_horizon`](https://github.com/ami-iit/jaxsim/blob/427b1e646297495f6b33e4c0bb2273ca89bd5ae2/src/jaxsim/simulation/simulator.py#L432C1-L529C10) is useful only in open-loop simulations and where the horizon is known in advance. Please checkout [`step`](https://github.com/ami-iit/jaxsim/blob/427b1e646297495f6b33e4c0bb2273ca89bd5ae2/src/jaxsim/simulation/simulator.py#L384C10-L425) for closed-loop simulations."
]
},
{
Expand Down

0 comments on commit daa5a9e

Please sign in to comment.