Skip to content

Commit

Permalink
Update paper
Browse files Browse the repository at this point in the history
  • Loading branch information
mrsonandrade committed Jul 28, 2023
1 parent b01e70a commit 6bc4303
Show file tree
Hide file tree
Showing 7 changed files with 83 additions and 82 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![Documentation Status](https://readthedocs.org/projects/pyswarming/badge/?version=latest)](https://pyswarming.readthedocs.io/en/latest/?badge=latest)
![version](https://img.shields.io/badge/version-1.1.2-blue)
[![Downloads](https://static.pepy.tech/badge/pyswarming)](https://pepy.tech/project/pyswarming)
[![Downloads](https://static.pepy.tech/personalized-badge/pyswarming?period=total&units=none&left_color=black&right_color=blue&left_text=Downloads)](https://pepy.tech/project/pyswarming)

<img align="left" src="docs/readme_pics/logo.png">

Expand Down Expand Up @@ -132,7 +132,7 @@ my_swarm.simulate()
Considering a swarm of robots, they can show different behaviors by using ``pyswarming``. The following codes are simplified implementations, for detailed ones, see the [examples](https://github.com/mrsonandrade/pyswarming/tree/main/examples) folder.
```python
# importing the swarming behaviors
import pyswarming.behaviors as ps
import pyswarming.behaviors as pb

# importing numpy to work with arrays
import numpy as np
Expand All @@ -157,7 +157,7 @@ for t in range(15):
print(robot_position_i)

# update the robot (x, y, z) position
robot_position_i += robot_speed_i*ps.target(robot_position_i, target_position)
robot_position_i += robot_speed_i*pb.target(robot_position_i, target_position)
```
![Target](notebooks/pics/Target.gif)

Expand All @@ -183,7 +183,7 @@ for time_i in range(15):
for r_ind in range(len(robot_speed)):
r_i = robot_speed[r_ind]
r_j = np.delete(robot_speed, np.array([r_ind]), axis=0)
robot_speed[r_ind] += robot_speed*ps.aggregation(r_i, r_j)
robot_speed[r_ind] += robot_speed*pb.aggregation(r_i, r_j)
```
![Aggregation](notebooks/pics/Aggregation.gif)

Expand All @@ -209,7 +209,7 @@ for time_i in range(15):
for r_ind in range(len(robot_position)):
r_i = robot_position[r_ind]
r_j = np.delete(robot_position, np.array([r_ind]), axis=0)
robot_position[r_ind] += robot_speed*ps.repulsion(r_i, r_j, 3.0)
robot_position[r_ind] += robot_speed*pb.repulsion(r_i, r_j, 3.0)
```
![Repulsion](notebooks/pics/Repulsion.gif)

Expand All @@ -234,7 +234,7 @@ for time_i in range(15):
for r_ind in range(len(robot_position)):
r_i = robot_position[r_ind]
r_j = np.delete(robot_position, np.array([r_ind]), axis=0)
robot_position[r_ind] += s_i*(ps.aggregation(r_i, r_j) + ps.repulsion(r_i, r_j, 5.0))
robot_position[r_ind] += s_i*(pb.aggregation(r_i, r_j) + pb.repulsion(r_i, r_j, 5.0))
```
![AggregationRepulsion](notebooks/pics/AggregationRepulsion.gif)

Expand Down
48 changes: 0 additions & 48 deletions docs/source/example_notebooks/03_Custom_Animations.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,6 @@
"HTML(anim.to_jshtml())"
]
},
{
"cell_type": "markdown",
"id": "8a9d181e",
"metadata": {},
"source": [
"[Click here to see the Target output](https://github.com/mrsonandrade/pyswarming/tree/main/Examples/pics/Target.gif)"
]
},
{
"cell_type": "markdown",
"id": "35bcb062",
Expand Down Expand Up @@ -176,14 +168,6 @@
"HTML(anim.to_jshtml())"
]
},
{
"cell_type": "markdown",
"id": "05d60513",
"metadata": {},
"source": [
"[Click here to see the Aggregation output](https://github.com/mrsonandrade/pyswarming/tree/main/Examples/pics/Aggregation.gif)"
]
},
{
"cell_type": "markdown",
"id": "0d6c573c",
Expand Down Expand Up @@ -268,14 +252,6 @@
"HTML(anim.to_jshtml())"
]
},
{
"cell_type": "markdown",
"id": "6dc78225",
"metadata": {},
"source": [
"[Click here to see the Repulsion output](https://github.com/mrsonandrade/pyswarming/tree/main/Examples/pics/Repulsion.gif)"
]
},
{
"cell_type": "markdown",
"id": "50eca133",
Expand Down Expand Up @@ -360,14 +336,6 @@
"HTML(anim.to_jshtml())"
]
},
{
"cell_type": "markdown",
"id": "c3c93292",
"metadata": {},
"source": [
"[Click here to see the Aggregation + Repulsion output](https://github.com/mrsonandrade/pyswarming/tree/main/Examples/pics/AggregationRepulsion.gif)"
]
},
{
"cell_type": "markdown",
"id": "8b3ce0a4",
Expand Down Expand Up @@ -456,14 +424,6 @@
"HTML(anim.to_jshtml())"
]
},
{
"cell_type": "markdown",
"id": "3043d92c",
"metadata": {},
"source": [
"[Click here to see the Area Coverage output](https://github.com/mrsonandrade/pyswarming/tree/main/Examples/pics/AreaCoverage.gif)"
]
},
{
"cell_type": "markdown",
"id": "7932e07f",
Expand Down Expand Up @@ -552,14 +512,6 @@
"from IPython.display import HTML\n",
"HTML(anim.to_jshtml())"
]
},
{
"cell_type": "markdown",
"id": "e0e03657",
"metadata": {},
"source": [
"[Click here to see the Collective Navigation output](https://github.com/mrsonandrade/pyswarming/tree/main/Examples/pics/CollectiveNavigation.gif)"
]
}
],
"metadata": {
Expand Down
6 changes: 3 additions & 3 deletions examples/example_joss_paper.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def _animate(self, i):
self.ax.set_ylabel('Y(m)')
self.ax.grid()
self.ax.set_aspect('equal')
self.ax.set_title('Aggregation + Heading Consensus behaviors')
self.ax.set_title('Aggregation + Heading Consensus + Repulsion behaviors', fontsize=9)

# path history
self.ax.plot(self.position_history[0][0], self.position_history[0][1], marker='.', lw=0, c='lightgray')
Expand All @@ -86,15 +86,15 @@ def _animate(self, i):
self.ax.arrow(self.robot_positions[2][0], self.robot_positions[2][1], arrow_len*np.cos(self.robot_orientations[2][2]), arrow_len*np.sin(self.robot_orientations[2][2]), head_width=0.45, head_length=0.55, fc='k')
self.ax.arrow(self.robot_positions[3][0], self.robot_positions[3][1], arrow_len*np.cos(self.robot_orientations[3][2]), arrow_len*np.sin(self.robot_orientations[3][2]), head_width=0.45, head_length=0.55, fc='k')

self.ax.text(0.7, -12.95, 'iter. %d' % (i), color='red')
self.ax.text(0.7, -12.95, 'iteration: %d' % (i), color='red')

self.robot_positions_copy = self.robot_positions.copy()
self.robot_orientations_copy = self.robot_orientations.copy()

for r_ind in range(len(self.robot_positions)):
r_i = self.robot_positions[r_ind]
r_j = np.delete(self.robot_positions, np.array([r_ind]), axis=0)
self.robot_positions_copy[r_ind] += self.robot_linear_speed*(pb.aggregation(r_i, r_j))
self.robot_positions_copy[r_ind] += self.robot_linear_speed*((pb.aggregation(r_i, r_j)) + pb.repulsion(r_i, r_j, 3.0))

theta_i = self.robot_orientations[r_ind]
theta_j = np.delete(self.robot_orientations, np.array([r_ind]), axis=0)
Expand Down
Binary file modified paper/fig1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified paper/fig2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions paper/paper.bib
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,16 @@ @article{chamanbaz:2017
doi={10.3389/frobt.2017.00012}
}

@inproceedings{erez:2015,
title={Simulation tools for model-based robotics: Comparison of bullet, havok, mujoco, ode and physx},
author={Erez, Tom and Tassa, Yuval and Todorov, Emanuel},
booktitle={2015 IEEE international conference on robotics and automation (ICRA)},
pages={4397--4404},
year={2015},
organization={IEEE},
doi={10.1109/ICRA.2015.7139807}
}

@article{zoss:2018,
title={Distributed system of autonomous buoys for scalable deployment and monitoring of large waterbodies},
author={Zoss, BM and Mateo, D and Kuan, YK and Tokić, G and Chamanbaz, M and Goh, L and et al.},
Expand Down

0 comments on commit 6bc4303

Please sign in to comment.