<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: kazogihara</title>
    <description>The latest articles on DEV Community by kazogihara (@kazogihara).</description>
    <link>https://dev.to/kazogihara</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1187801%2F6749004d-f738-4693-a3ae-b84ee995d7ea.png</url>
      <title>DEV Community: kazogihara</title>
      <link>https://dev.to/kazogihara</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kazogihara"/>
    <language>en</language>
    <item>
      <title>How to run Skybrush with SITL on Windows</title>
      <dc:creator>kazogihara</dc:creator>
      <pubDate>Wed, 18 Oct 2023 05:08:46 +0000</pubDate>
      <link>https://dev.to/kazogihara/how-to-build-skybrush-using-sitl-on-windows-3g5k</link>
      <guid>https://dev.to/kazogihara/how-to-build-skybrush-using-sitl-on-windows-3g5k</guid>
      <description>&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Windows11(Windows10 should be work)&lt;/li&gt;
&lt;li&gt;WSL2

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/windows/wsl/install#install-wsl-command"&gt;Installation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;VSCode

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://code.visualstudio.com/download"&gt;Installation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conceptual scheme
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GCCjoOH---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a4cngvwirhj5zlv32ees.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GCCjoOH---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a4cngvwirhj5zlv32ees.png" alt="Image description" width="481" height="411"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup Linux Distro
&lt;/h2&gt;

&lt;p&gt;1.Install VSCode Extension&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open VSCode, search WSL extension from marketplace and install&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QPS85szz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x7n6w7lfjablnlhlcufv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QPS85szz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x7n6w7lfjablnlhlcufv.png" alt="Image description" width="535" height="940"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2.Setup Ubuntu22.04&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create Distor from VSCode&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uVPuuLT_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yf1lninwg53ly28tfcxk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uVPuuLT_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yf1lninwg53ly28tfcxk.png" alt="Image description" width="538" height="1032"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--U3qs6q9N--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/450wr1kg9ixvqpw5p0a4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--U3qs6q9N--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/450wr1kg9ixvqpw5p0a4.png" alt="Image description" width="800" height="369"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oo6p6L3e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vtwfg26b2mr1ns99kuf3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oo6p6L3e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vtwfg26b2mr1ns99kuf3.png" alt="Image description" width="800" height="155"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Z0F1KWK7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/go2nsu8htii4scv5r8n2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Z0F1KWK7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/go2nsu8htii4scv5r8n2.png" alt="Image description" width="800" height="333"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Type Username and Password&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--se_j2wdq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j4e58t4jroyjl3cb4gib.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--se_j2wdq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j4e58t4jroyjl3cb4gib.png" alt="Image description" width="800" height="448"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;3.Back to VSCode and connect to Ubuntu&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Select Ubuntu22.04 from &lt;code&gt;Connect to WSL using Distro...&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--klEi1dH2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/atv6rbzhung6ha1bszvy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--klEi1dH2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/atv6rbzhung6ha1bszvy.png" alt="Image description" width="800" height="217"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If you see &lt;code&gt;WSL:Ubuntu-22.04&lt;/code&gt; at left-bottom corner, you successfully connect to it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LgBWKkMc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p382u9rzqb31vmmrfp3o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LgBWKkMc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p382u9rzqb31vmmrfp3o.png" alt="Image description" width="398" height="248"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;4.Update and Upgrade Registry&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Popup console using &lt;code&gt;ctrl + j&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_R5YGnso--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ilvjbwrkd6dcydv6xtc4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_R5YGnso--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ilvjbwrkd6dcydv6xtc4.png" alt="Image description" width="800" height="144"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Update and Upgrade Registry
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt update &amp;amp;&amp;amp; sudo apt upgrade
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Build Python3.11
&lt;/h2&gt;

&lt;p&gt;1.Follow below commands and build python.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev wget libbz2-dev
wget https://www.python.org/ftp/python/3.11.3/Python-3.11.3.tgz
tar -xzvf Python-3.11.3.tgz
cd Python-3.11.3
./configure --enable-optimizations
make -j 12
sudo make altinstall
sudo update-alternatives --install /usr/bin/python python /usr/local/bin/python3.11 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2.Check if you can see the version of python is 3.11.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;skybrush@MyComputer:~/Python-3.11.3$ python --version
Python 3.11.3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Install Poetry
&lt;/h2&gt;

&lt;p&gt;1.install poetry using pip3.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install python3-pip
pip3 install poetry

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Build skybrush server
&lt;/h2&gt;

&lt;p&gt;1.Clone source code and install using poetry.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone https://github.com/skybrush-io/skybrush-server.git
cd ~/skybrush-server/
python3 -m poetry install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2.Launch skybrush server&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python3 -m poetry run skybrushd -c etc/conf/skybrush-outdoor.jsonc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;If you correctly launch it, the result will be like below.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;skybrush@MyComputer:~/skybrush-server$ python3 -m poetry run skybrushd -c etc/conf/skybrush-outdoor.jsonc
[13:32:13]   server                 Starting Skybrush server 2.15.0
           ✔ skybrush               Loaded configuration from '/home/skybrush/skybrush-server/etc/conf/skybrush-outdoor.jsonc'
             logging                Storing logs in '/home/skybrush/.cache/Skybrush Server/log'
             logging                Logging started
             http_server            Starting HTTP server on :5000
           ▲ insomnia               Cannot prevent sleep mode on this platform
             mavlink     mav        Routing primary traffic to mav
             mavlink     mav        Routing RTK corrections to mav
             mavlink     mav        Routing RC overrides to mav
             mavlink     mav        Connection at :14550 up and running
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Build SITL
&lt;/h2&gt;

&lt;p&gt;1.Press &lt;code&gt;+&lt;/code&gt; button and create new console and switch to it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PvQapiJr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gc66g6ulkyodgnf5gssz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PvQapiJr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gc66g6ulkyodgnf5gssz.png" alt="Image description" width="800" height="139"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HHQuFH0t--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mmb20hv5jp2mxtop0y56.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HHQuFH0t--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mmb20hv5jp2mxtop0y56.png" alt="Image description" width="800" height="130"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2.Build SITL&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone https://github.com/skybrush-io/ardupilot.git
cd ardupilot/
git checkout CMCopter-4.2
git submodule update --init --recursive
sudo apt install python3.10-venv
python3 -m venv .venv
source .venv/bin/activate
pip install -U pip wheel
pip install future empy intelhex pexpect
./waf configure --debug --board sitl
./waf copter
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3.Test SITL&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;build/sitl/bin/arducopter
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Build ap-swarm-launcher
&lt;/h2&gt;

&lt;p&gt;1.Build ap-swarm-launcher&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;deactivate
cd ~
git clone https://github.com/skybrush-io/ap-swarm-launcher
cd ap-swarm-launcher
python3 -m poetry install

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2.Launch ap-swarm-launcher&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python3 -m poetry run ap-sitl-swarm -n 20 --num-drones-per-row 5 --spacing 5 --pos-noise 0.5 --yaw-noise 10 ../ardupilot/build/sitl/bin/arducopt
er
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;If you correctly launch it, the result will be like below.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;skybrush@MyComputer:~/ap-swarm-launcher$ python3 -m poetry run ap-sitl-swarm -n 20 --num-drones-per-row 5 --spacing 5 --pos-noise 0.5 --yaw-noise 10 ../ardupilot/build/sitl/bin/arducopter
    1 | Setting SIM_SPEEDUP=1.000000
    1 | Suggested EK3_BCOEF_* = 16.288, EK3_MCOEF = 0.209
    1 | Home: -35.363254 149.165234 alt=584.000000m hdg=345.000000
    1 | Starting sketch 'ArduCopter'
    1 | Starting SITL input
    1 | Using Irlock at port : 9005
    1 | UDP connection 127.0.0.1:14550
    1 | Loaded defaults from /tmp/sitl-swarm-kkeeabzu/drones/001/default.param
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kkeeabzu/drones/019/default.param
   20 | validate_structures:476: Validating structures
   20 | Loaded defaults from /tmp/sitl-swarm-kkeeabzu/drones/020/default.param
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Launch Skybrush live
&lt;/h2&gt;

&lt;p&gt;1.Back to Host OS(wiundows11), download Skybrush live &lt;a href="https://skybrush.io/modules/live/"&gt;Installer&lt;/a&gt; and install.&lt;/p&gt;

&lt;p&gt;2.Launch Skybrush live&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If you can see drones, it's showtime!
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fqspM0_k--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s9sw5zt7xnvakicfdh7n.png" alt="Image description" width="800" height="430"&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
  </channel>
</rss>
