Skip to content

Commit

Permalink
Deploying to gh-pages from @ 7249a78 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
knmcguire committed Nov 16, 2023
1 parent b277118 commit 235800d
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 9 deletions.
39 changes: 36 additions & 3 deletions _sources/howto.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,39 @@ This requires some updated pip packages for testing, see https://docs.ros.org/en

Then execute:

```
colcon test --event-handlers=console_cohesion+ --return-code-on-test-failure --packages-select crazyflie_py
```
.. code-block:: bash
colcon test --event-handlers=console_cohesion+ --return-code-on-test-failure --packages-select crazyflie_py
.. _Collision Avoidance:

Collision Avoidance
-------------------

The official firmware has support for collision avoidance using the Buffered Voronoi Cell algorithm.
It requires the use of a motion capture system (so that the positions of other drones are known) and can be enabled
in the `crazyflies.yaml`:

.. code-block:: yaml
all:
firmware_params:
colAv:
enable: 1
or inside a Python script via:

.. code-block:: python
swarm = Crazyswarm()
allcfs = swarm.allcfs
allcfs.setParam("colAv.enable", 1)
Note that the algorithm might require tuning of its hyperparameters. Documention can be found at https://github.com/bitcraze/crazyflie-firmware/blob/dbb9df1137f11d4e7e3771c56d25a7137b5b69cc/src/modules/src/collision_avoidance.c#L348-L428.

Generate Trajectories
---------------------

Crazyswarm2 supports polynomial trajectories (8th order). These can be generated from waypoints, waypoint/time pairs, or optimization. Useful tools are available at https://github.com/whoenig/uav_trajectories, including scripts to visualize the resulting trajectories.

For the multi-robot case, there is no easy to-use library, yet. One can use collision avoidance (see :ref:`Collision Avoidance`) or preplan trajectories using https://github.com/IMRCLab/db-CBS or https://github.com/mjdebord/smoothener/tree/cylinders.
16 changes: 15 additions & 1 deletion _sources/installation.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,21 @@ First Installation
.. note::
symlink-install allows you to edit Python and config files without running `colcon build` every time.

5. Set up software-in-the-loop simulation (optional)
5. Set up Crazyradio

For the crazyradio, you need to setup usb rules in order to communicate with the Crazyflie. Find the instructions for that here `in Bitcraze's USB permission guide for Linux <https://www.bitcraze.io/documentation/repository/crazyflie-lib-python/master/installation/usb_permissions/>`_.

You will also need to update the crazyradio firmware to the latest development branch to be able to use all features. For Crazyradio PA (1), `follow these instructions <https://www.bitcraze.io/documentation/repository/crazyradio-firmware/master/building/building_flashing/>`_. For Crazyradio 2, follow `these instuctions to build the firmware <https://www.bitcraze.io/documentation/repository/crazyradio-firmware/master/building/building_flashing/>`_ and `these instuctions to flash it <https://www.bitcraze.io/documentation/repository/crazyradio2-firmware/main/building-and-flashing/flash//>`_.

6. Update the crazyflies

If this is the first time handling crazyflies it is always good to start with `Bitcraze's getting started guide <https://www.bitcraze.io/documentation/tutorials/getting-started-with-crazyflie-2-x/>`_.

You can update each crazyflie firmware to the latest release via `these instructions of the Bitcraze Crazyflie client <https://www.bitcraze.io/documentation/repository/crazyflie-clients-python/master/userguides/userguide_client/#firmware-upgrade>`_ .

While you are at it, make sure that each crazyflie have an unique radio address which you can change in `the client via these instructions <https://www.bitcraze.io/documentation/repository/crazyflie-clients-python/master/userguides/userguide_client/#firmware-configuration>`_ .

7. Set up software-in-the-loop simulation (optional)

This currently requires cloning the Crazyflie firmware and building the Python bindings manually. In a separate folder (not part of your ROS 2 workspace!),

Expand Down
32 changes: 29 additions & 3 deletions howto.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
<li class="toctree-l2"><a class="reference internal" href="#usage-from-the-command-line">Usage from the command line</a></li>
<li class="toctree-l2"><a class="reference internal" href="#enabling-logblocks-at-runtime">Enabling Logblocks at runtime</a></li>
<li class="toctree-l2"><a class="reference internal" href="#run-tests-locally">Run Tests Locally</a></li>
<li class="toctree-l2"><a class="reference internal" href="#collision-avoidance">Collision Avoidance</a></li>
<li class="toctree-l2"><a class="reference internal" href="#generate-trajectories">Generate Trajectories</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="faq.html">Frequently Asked Questions</a></li>
Expand Down Expand Up @@ -164,9 +166,33 @@ <h2>Enabling Logblocks at runtime<a class="headerlink" href="#enabling-logblocks
<h2>Run Tests Locally<a class="headerlink" href="#run-tests-locally" title="Link to this heading"></a></h2>
<p>This requires some updated pip packages for testing, see <a class="reference external" href="https://docs.ros.org/en/humble/Installation/Alternatives/Ubuntu-Development-Setup.html">https://docs.ros.org/en/humble/Installation/Alternatives/Ubuntu-Development-Setup.html</a>, otherwise the reported failures will be inconsistent with CI.</p>
<p>Then execute:</p>
<p><code class="docutils literal notranslate"><span class="pre">`</span>
<span class="pre">colcon</span> <span class="pre">test</span> <span class="pre">--event-handlers=console_cohesion+</span> <span class="pre">--return-code-on-test-failure</span> <span class="pre">--packages-select</span> <span class="pre">crazyflie_py</span>
<span class="pre">`</span></code></p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>colcon<span class="w"> </span><span class="nb">test</span><span class="w"> </span>--event-handlers<span class="o">=</span>console_cohesion+<span class="w"> </span>--return-code-on-test-failure<span class="w"> </span>--packages-select<span class="w"> </span>crazyflie_py
</pre></div>
</div>
</section>
<section id="collision-avoidance">
<span id="id1"></span><h2>Collision Avoidance<a class="headerlink" href="#collision-avoidance" title="Link to this heading"></a></h2>
<p>The official firmware has support for collision avoidance using the Buffered Voronoi Cell algorithm.
It requires the use of a motion capture system (so that the positions of other drones are known) and can be enabled
in the <cite>crazyflies.yaml</cite>:</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="nt">all</span><span class="p">:</span>
<span class="w"> </span><span class="nt">firmware_params</span><span class="p">:</span>
<span class="w"> </span><span class="nt">colAv</span><span class="p">:</span>
<span class="w"> </span><span class="nt">enable</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">1</span>
</pre></div>
</div>
<p>or inside a Python script via:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">swarm</span> <span class="o">=</span> <span class="n">Crazyswarm</span><span class="p">()</span>
<span class="n">allcfs</span> <span class="o">=</span> <span class="n">swarm</span><span class="o">.</span><span class="n">allcfs</span>
<span class="n">allcfs</span><span class="o">.</span><span class="n">setParam</span><span class="p">(</span><span class="s2">&quot;colAv.enable&quot;</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
</pre></div>
</div>
<p>Note that the algorithm might require tuning of its hyperparameters. Documention can be found at <a class="reference external" href="https://github.com/bitcraze/crazyflie-firmware/blob/dbb9df1137f11d4e7e3771c56d25a7137b5b69cc/src/modules/src/collision_avoidance.c#L348-L428">https://github.com/bitcraze/crazyflie-firmware/blob/dbb9df1137f11d4e7e3771c56d25a7137b5b69cc/src/modules/src/collision_avoidance.c#L348-L428</a>.</p>
</section>
<section id="generate-trajectories">
<h2>Generate Trajectories<a class="headerlink" href="#generate-trajectories" title="Link to this heading"></a></h2>
<p>Crazyswarm2 supports polynomial trajectories (8th order). These can be generated from waypoints, waypoint/time pairs, or optimization. Useful tools are available at <a class="reference external" href="https://github.com/whoenig/uav_trajectories">https://github.com/whoenig/uav_trajectories</a>, including scripts to visualize the resulting trajectories.</p>
<p>For the multi-robot case, there is no easy to-use library, yet. One can use collision avoidance (see <a class="reference internal" href="#collision-avoidance"><span class="std std-ref">Collision Avoidance</span></a>) or preplan trajectories using <a class="reference external" href="https://github.com/IMRCLab/db-CBS">https://github.com/IMRCLab/db-CBS</a> or <a class="reference external" href="https://github.com/mjdebord/smoothener/tree/cylinders">https://github.com/mjdebord/smoothener/tree/cylinders</a>.</p>
</section>
</section>

Expand Down
9 changes: 9 additions & 0 deletions installation.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,15 @@ <h2>First Installation<a class="headerlink" href="#first-installation" title="Li
</div>
</div></blockquote>
</li>
<li><p>Set up Crazyradio</p>
<p>For the crazyradio, you need to setup usb rules in order to communicate with the Crazyflie. Find the instructions for that here <a class="reference external" href="https://www.bitcraze.io/documentation/repository/crazyflie-lib-python/master/installation/usb_permissions/">in Bitcraze’s USB permission guide for Linux</a>.</p>
<p>You will also need to update the crazyradio firmware to the latest development branch to be able to use all features. For Crazyradio PA (1), <a class="reference external" href="https://www.bitcraze.io/documentation/repository/crazyradio-firmware/master/building/building_flashing/">follow these instructions</a>. For Crazyradio 2, follow <a class="reference external" href="https://www.bitcraze.io/documentation/repository/crazyradio-firmware/master/building/building_flashing/">these instuctions to build the firmware</a> and <a class="reference external" href="https://www.bitcraze.io/documentation/repository/crazyradio2-firmware/main/building-and-flashing/flash//">these instuctions to flash it</a>.</p>
</li>
<li><p>Update the crazyflies</p>
<p>If this is the first time handling crazyflies it is always good to start with <a class="reference external" href="https://www.bitcraze.io/documentation/tutorials/getting-started-with-crazyflie-2-x/">Bitcraze’s getting started guide</a>.</p>
<p>You can update each crazyflie firmware to the latest release via <a class="reference external" href="https://www.bitcraze.io/documentation/repository/crazyflie-clients-python/master/userguides/userguide_client/#firmware-upgrade">these instructions of the Bitcraze Crazyflie client</a> .</p>
<p>While you are at it, make sure that each crazyflie have an unique radio address which you can change in <a class="reference external" href="https://www.bitcraze.io/documentation/repository/crazyflie-clients-python/master/userguides/userguide_client/#firmware-configuration">the client via these instructions</a> .</p>
</li>
<li><p>Set up software-in-the-loop simulation (optional)</p>
<blockquote>
<div><p>This currently requires cloning the Crazyflie firmware and building the Python bindings manually. In a separate folder (not part of your ROS 2 workspace!),</p>
Expand Down
4 changes: 3 additions & 1 deletion objects.inv
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
# Project: Crazyswarm2
# Version: 1.0
# The remainder of this file is compressed using zlib.
xڝQ�N�0��)N��3q��#&F/��P�0��#m��[VZZ�h�����-kA�|�S�G(X�P��ó���F�b��9�w(UE���I�Y�����%;bS59~�Z�������+�[��x�2Z�,]d�͉���$�� {&��b�o��릺wAb㰧�$�j���b��qRh;�vʌ\�\� �*Ay�]��)Zs˘��+�kX� ��M�s���P�*���3���R�}@�������nP�~���D&�2�h�~ǎ�N����@�7�Xp�q�J�Y�:���3`2>ƣ�p�3G;�/xI�
xڝ��n�0D�|�JpM�r�!U���B�&^HT'[l�4��:1vl�E�͙��ٱs�T%��NTrV�J�`;�<BA���BWb�;o2z��O�6ٳ�0�S�O0�O��Zt����֠҆U�����X�5ǯ�u�M}鏓�F��� �����E��~�|c�yT���S-��|)lV[��6����{���,���HC��Rf��L�W�ǎ��2*ט_�
4�_�Zo�[��b������x��.q?l�W/��6tBy*��;��W����Gf����wZw�0����ɼ�A�Yfk���'���_�
Kx���fN�`|DL�:�\�Lb�36�??u������9h�
Expand Down
Loading

0 comments on commit 235800d

Please sign in to comment.