<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> <channel> <title>96Boards</title> <description>32- and 64-bit ARM Open Platform Specifications. For software developers. For the maker community. For embedded OEMs. 64-bit ARM for $129.</description> <link>https://www.96boards.org/</link> <atom:link href="https://www.96boards.org/feed.xml" rel="self" type="application/rss+xml"/> <pubDate>Thu, 05 Feb 2026 12:21:41 +0000</pubDate> <lastBuildDate>Thu, 05 Feb 2026 12:21:41 +0000</lastBuildDate> <generator>Jekyll v4.0.1</generator> <item> <title>96boards: Autoware everywhere | Updating Autoware.Auto 3D Perception Stack modules</title> <description>&lt;h1 id=&quot;introduction&quot;&gt;Introduction&lt;/h1&gt; &lt;p&gt;After the &lt;a href=&quot;https://www.96boards.org/blog/k8s_autoware_auto_multiboard/&quot;&gt;last post&lt;/a&gt; of this blog series we now have a very nicely distributed and scalable 3D Perception demo for Autoware.Auto.&lt;/p&gt; &lt;p&gt;In this blog post we will cover the last piece of the puzzle: how do we go about updating the k8s pods? Thanks to the k8s infrastructure the process to update or roll back images can be easily achieved. As we did in the previous post we will run the 3D Perception demo using a combination of &lt;a href=&quot;https://github.com/autocore-ai/autocore_pcu_doc&quot;&gt;AutoCore’s PCU&lt;/a&gt; and &lt;a href=&quot;https://www.96boards.org/product/rb3-platform/&quot;&gt;Qualcomm® Robotics (RB3) Dragonboard-845c Development Platform&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;This post is organized as follows:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href=&quot;#introduction&quot;&gt;Introduction&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#setting-up-the-3d-perception-demo&quot;&gt;Setting up the 3D Perception demo&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#k8s-rolling-update&quot;&gt;k8s rolling update&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#visualization&quot;&gt;Visualization&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#conclusion&quot;&gt;Conclusion&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;hr /&gt; &lt;h2 id=&quot;setting-up-the-3d-perception-demo&quot;&gt;Setting up the 3D Perception demo&lt;/h2&gt; &lt;p&gt;To avoid uncessary repetition and as we just need to set the k8s cluster and the 3D Perception demo in the same way as before, please check the &lt;a href=&quot;https://www.96boards.org/blog/k8s_autoware_auto_multiboard/&quot;&gt;previous post&lt;/a&gt; to follow the step by step process outlined there. As a brief summary we need to:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Bring up the k8s cluster. &lt;ul&gt; &lt;li&gt;Kick-off the master on the laptop.&lt;/li&gt; &lt;li&gt;Join PCU and RB3 to the cluster as workers, default names for the nodes are &lt;code class=&quot;highlighter-rouge&quot;&gt;localhost&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;linaro-alip&lt;/code&gt; respectively.&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li&gt;Apply the k8s deployment yaml files that are hosted &lt;a href=&quot;https://people.linaro.org/~servando.german.serrano/pcu/k8s/autoware.auto-3dperception-demo/multi_board/&quot;&gt;here&lt;/a&gt;.&lt;/li&gt; &lt;/ul&gt; &lt;p&gt;We are now in a situation like the one shown below. &lt;img src=&quot;/assets/images/blog/k8s_multi_sum.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt; &lt;h2 id=&quot;k8s-rolling-update&quot;&gt;k8s rolling update&lt;/h2&gt; &lt;p&gt;As mentioned above it is quite straighforward to perform an update of the running image in one of our k8s deployments. To illustrate the process we will perform an update on the &lt;code class=&quot;highlighter-rouge&quot;&gt;sensing-rear-lidar&lt;/code&gt; deployment.&lt;/p&gt; &lt;p&gt;For the purpose of this blog post we have added 2 new images to the &lt;a href=&quot;https://hub.docker.com/r/96boards/autoware.auto/tags?page=1&amp;amp;ordering=name&quot;&gt;96Boards Dockerhub repo&lt;/a&gt; namely &lt;code class=&quot;highlighter-rouge&quot;&gt;sensing-1.0.0_v2&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;sensing-1.0.0_bad&lt;/code&gt;. These images are just a retag of the &lt;code class=&quot;highlighter-rouge&quot;&gt;sensing-1.0.0&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;udpreplay&lt;/code&gt; images respectively, so the &lt;code class=&quot;highlighter-rouge&quot;&gt;_v2&lt;/code&gt; image contains the Velodyne driver nodes and the &lt;code class=&quot;highlighter-rouge&quot;&gt;_bad&lt;/code&gt; image will lead to an error during the update as the Velodyne driver node is not available.&lt;/p&gt; &lt;p&gt;&lt;img src=&quot;/assets/images/blog/k8s_roll_img.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt; &lt;p&gt;The first thing we need is to identify the name of the pod container within the deployment that we want to update. The &lt;code class=&quot;highlighter-rouge&quot;&gt;sensing-rear-lidar&lt;/code&gt; is a single pod deployment and using the &lt;code class=&quot;highlighter-rouge&quot;&gt;kubectl describe&lt;/code&gt; command we can find the name of the pod container as shown below.&lt;/p&gt; &lt;p&gt;&lt;img src=&quot;/assets/images/blog/k8s_roll_1.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt; &lt;p&gt;We can see that the pod name is &lt;code class=&quot;highlighter-rouge&quot;&gt;sensing-rear-lidar-5f78dd8f44-nmb9d&lt;/code&gt; and that the pod container name is &lt;code class=&quot;highlighter-rouge&quot;&gt;rear-lidar-pod&lt;/code&gt;. To update the image from &lt;code class=&quot;highlighter-rouge&quot;&gt;sensing-1.0.0&lt;/code&gt; to &lt;code class=&quot;highlighter-rouge&quot;&gt;sensing-1.0.0_v2&lt;/code&gt; we just need to do:&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ kubectl set image deployment sensing-rear-lidar rear-lidar-pod=96boards/autoware.auto:sensing-1.0.0_v2 &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;and we can check the progress of the rollout as:&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ kubectl rollout status deployment sensing-rear-lidar &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;After the rollout is completed we can check that the new pod (named &lt;code class=&quot;highlighter-rouge&quot;&gt;sensing-rear-lidar-799fddb689-jcc2m&lt;/code&gt;) is using the new image by using the &lt;code class=&quot;highlighter-rouge&quot;&gt;kubectl describe&lt;/code&gt; command.&lt;/p&gt; &lt;p&gt;&lt;img src=&quot;/assets/images/blog/k8s_roll_2.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt; &lt;p&gt;We can then check that all the pods are running.&lt;/p&gt; &lt;p&gt;&lt;img src=&quot;/assets/images/blog/k8s_roll_3.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt; &lt;p&gt;Now we can go back on the rolled update by simply doing:&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ kubectl rollout undo deployment sensing-rear-lidar &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;&lt;img src=&quot;/assets/images/blog/k8s_roll_4.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt; &lt;p&gt;We can see that the new pod with the old image is &lt;code class=&quot;highlighter-rouge&quot;&gt;sensing-rear-lidar-5f78dd8f44-bt5q2&lt;/code&gt;. Now let’s try rolling an update with the &lt;code class=&quot;highlighter-rouge&quot;&gt;sensing-1.0.0_bad&lt;/code&gt; image which will fail upon running as the Velodyne driver is not available.&lt;/p&gt; &lt;p&gt;&lt;img src=&quot;/assets/images/blog/k8s_roll_5.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt; &lt;p&gt;As shown above the &lt;code class=&quot;highlighter-rouge&quot;&gt;kubectl rollout status&lt;/code&gt; command gets stuck and also k8s keeps the older pod with the &lt;code class=&quot;highlighter-rouge&quot;&gt;sensing-1.0.0&lt;/code&gt; image running as the new one is stuck in a &lt;code class=&quot;highlighter-rouge&quot;&gt;Error&lt;/code&gt; state. Upon finding this situation we can simply roll back the update to keep the previous pod that was running apropriately.&lt;/p&gt; &lt;h2 id=&quot;visualization&quot;&gt;Visualization&lt;/h2&gt; &lt;p&gt;Now that we know how to roll an update for an image let’s see what happens when we visualize the lidar pointcloud. Since the default config for the 3D Perception shows the front lidar data we will roll the update to this pod’s container. To do so we just need to do as above:&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ kubectl set image deployment sensing-front-lidar front-lidar-pod=96boards/autoware.auto:sensing-1.0.0_v2 &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;And as shown below we can see that upon successful completion of the update we keep getting a nice feed of the pointcloud in Rviz2. &lt;img src=&quot;/assets/images/blog/k8s_roll_6.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt; &lt;hr /&gt; &lt;h1 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h1&gt; &lt;p&gt;In this post we have added the missing piece for our k8s deployment management capabilities: being able to roll image updates when needed, as well as exploring the way to take the update back in case the new image fails for whatever reason. With this blog post we complete our exploration on scalability of Autoware.Auto using k8s where we have shown how easy it is to deploy and manage the different software modules on multiple boards.&lt;/p&gt; </description> <pubDate>Wed, 31 Mar 2021 01:00:00 +0000</pubDate> <link>https://www.96boards.org/blog/k8s_roll_update/</link> <guid isPermaLink="true">https://www.96boards.org/blog/k8s_roll_update/</guid> <category>64-bit,</category> <category>96Boards,</category> <category>aarch64,</category> <category>ARM,</category> <category>ARMv8,</category> <category>Consumer</category> <category>Edition,</category> <category>Linaro,</category> <category>Linux,</category> <category>arm64,</category> <category>real</category> <category>time,</category> <category>ROS2,</category> <category>Autoware,</category> <category>AutoCore,</category> <category>PCU</category> <category>blog</category> </item> <item> <title>96boards: Autoware everywhere | Multi-board Autoware.Auto 3D Perception Stack using k8s</title> <description>&lt;h1 id=&quot;introduction&quot;&gt;Introduction&lt;/h1&gt; &lt;p&gt;Following our &lt;a href=&quot;https://www.96boards.org/blog/k8s_autoware_auto1/&quot;&gt;previous work&lt;/a&gt; to show how to distribute Autoware.Auto’s modules to complete the 3D Perception demo it comes as a natural question to ask about the benefits of using k8s as opposed to plain Docker or the &lt;a href=&quot;https://gitlab.com/ApexAI/ade-cli&quot;&gt;ade-cli&lt;/a&gt; tool that is used within the Autoware.Auto official documentation to deploy the software.&lt;/p&gt; &lt;p&gt;Well, if you have been following the blog series we showed how to reproduce the &lt;a href=&quot;https://www.96boards.org/blog/autoware_auto_hikey970/&quot;&gt;3D perception demo on a Hikey970&lt;/a&gt; using plain docker, which is very similar to the ade-based steps in the documentation, where the level of manual involvement was quite high with multiple terminals to &lt;code class=&quot;highlighter-rouge&quot;&gt;ssh&lt;/code&gt; into the board, launch nodes, etc. While it is true that we could put together a ROS2 launch file to kick-off all the nodes, we would still need to start the containers manually prior to using the launch file.&lt;/p&gt; &lt;p&gt;On the other hand, if we go down the k8s route, we still need to &lt;code class=&quot;highlighter-rouge&quot;&gt;ssh&lt;/code&gt; into the board to add it to the k8s cluster but once that’s done everything is managed through the master node which provides an easier way to deploy and manage the different components as services within the vehicle. These benefits come closer into play for “stable” software, hence both ways (k8s vs docker/ade) live together as they are meant to target different use cases, development vs closer to production.&lt;/p&gt; &lt;p&gt;In addition, using the k8s infrastructure helps us keep the services running by means of re-spawning if a services dies or while performing an update to a particular module (which we will explore in the near future). Furthermore, while the above is considered for a single board, when we take scalability into account we can introduce redundancies using a k8s cluster with multiple boards or specify nodes attending to board capabilities or interfaces, for example if we had a LIDAR plugged into a k8s node to perform some preprocessing on the data before feeding into the rest of the system so we could use multiple less capable hardware as opposed to a single higher end approach.&lt;/p&gt; &lt;p&gt;All these can be easily achieved thanks to the Eclipse Cyclone DDS middleware for ROS2 as the masterless discovery capabilities mean that we do not need to manually set up the different IP addresses for all the individual containers within each k8s pod.&lt;/p&gt; &lt;p&gt;In this blog we look at this last point. As a proof of concept instead of running the 3D Perception demo modules just on the PCU we will assume that the LIDAR data comes into a separate board (&lt;a href=&quot;https://www.96boards.org/product/rb3-platform/&quot;&gt;Qualcomm® Robotics (RB3) Dragonboard-845c Development Platform&lt;/a&gt;), where the LIDAR drivers are run, with the 3D pointcloud data in ROS2 topics being fed next into the PCU for rest of modules.&lt;/p&gt; &lt;p&gt;This post is organized as follows:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href=&quot;#introduction&quot;&gt;Introduction&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#setting-up-the-rb3&quot;&gt;Setting up the RB3&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#k8s-cluster-bring-up&quot;&gt;k8s cluster bring up&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#assigning-deployments-to-specific-nodes&quot;&gt;Assigning deployments to specific nodes&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#visualization&quot;&gt;Visualization&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#conclusion&quot;&gt;Conclusion&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;hr /&gt; &lt;h2 id=&quot;setting-up-the-rb3&quot;&gt;Setting up the RB3&lt;/h2&gt; &lt;p&gt;To set up the RB3 board we just need to follow the steps &lt;a href=&quot;https://www.96boards.org/product/rb3-platform/&quot;&gt;here&lt;/a&gt; and then install Docker as we &lt;a href=&quot;https://www.96boards.org/blog/db845-ros2/#installing-docker&quot;&gt;showed in the past&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;We can then follow the default steps to &lt;a href=&quot;https://www.96boards.org/blog/cyclonedds_on_kubernetes/#installing-k8s&quot;&gt;install k8s&lt;/a&gt; as we did for the PCU.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt; we need to create the following symlink for kubelet to run nicely with its default settings.&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ ln -s /run/resolvconf /run/systemd/resolve &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;h2 id=&quot;k8s-cluster-bring-up&quot;&gt;k8s cluster bring up&lt;/h2&gt; &lt;p&gt;Now that both boards are ready we just need to create the k8s cluster as usual:&lt;/p&gt; &lt;ul&gt; &lt;li&gt; &lt;p&gt;Kicking off the master node in the laptop first. &lt;img src=&quot;/assets/images/blog/k8s_multiboard_1.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt; &lt;/li&gt; &lt;li&gt; &lt;p&gt;Then joining the PCU and RB3 as worker nodes. &lt;img src=&quot;/assets/images/blog/k8s_multiboard_2.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt; &lt;/li&gt; &lt;li&gt; &lt;p&gt;Upon completion we can verify that the 3 nodes are up and running. RB3 named as &lt;em&gt;linaro-alip&lt;/em&gt; and PCU as &lt;em&gt;localhost&lt;/em&gt;. &lt;img src=&quot;/assets/images/blog/k8s_multiboard_3.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt; &lt;/li&gt; &lt;/ul&gt; &lt;h2 id=&quot;assigning-deployments-to-specific-nodes&quot;&gt;Assigning deployments to specific nodes&lt;/h2&gt; &lt;p&gt;As a recap for the 3D Perception demo we created 3 different deployment files and associated Docker images:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;udpreplay&lt;/code&gt;: replays the Velodyne pcap data.&lt;/li&gt; &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;sensing&lt;/code&gt;: 2-pod deployment for the front and rear Velodyne driver nodes.&lt;/li&gt; &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;perception3d&lt;/code&gt;: multi-pod deployment for the robot state publisher, point cloud filter transform, ray ground classifier and euclidean cluster nodes.&lt;/li&gt; &lt;/ul&gt; &lt;p&gt;Since we will run the LIDAR drivers on the RB3 we will assing the &lt;code class=&quot;highlighter-rouge&quot;&gt;udpreplay&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;sensing&lt;/code&gt; deployments to that node and the &lt;code class=&quot;highlighter-rouge&quot;&gt;perception3d&lt;/code&gt; to the PCU. To do this we just need to modify the deployment files we had and add the keyword &lt;code class=&quot;highlighter-rouge&quot;&gt;nodeName&lt;/code&gt; and the associated node name to each file as shown below. &lt;img src=&quot;/assets/images/blog/k8s_multiboard_4.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt; &lt;p&gt;Once modified we can just create the deployments as usual, which leads to each deployment being created in the right node. &lt;img src=&quot;/assets/images/blog/k8s_multiboard_5.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt; &lt;p&gt;For convenience the modified yaml files can be found &lt;a href=&quot;https://people.linaro.org/~servando.german.serrano/pcu/k8s/autoware.auto-3dperception-demo/multi_board&quot;&gt;here&lt;/a&gt; and can be applied directly as:&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ kubectl apply -f https://people.linaro.org/~servando.german.serrano/pcu/k8s/autoware.auto-3dperception-demo/multi_board/udpreplay.yaml $ kubectl apply -f https://people.linaro.org/~servando.german.serrano/pcu/k8s/autoware.auto-3dperception-demo/multi_board/sensing.yaml $ kubectl apply -f https://people.linaro.org/~servando.german.serrano/pcu/k8s/autoware.auto-3dperception-demo/multi_board/perception3D-demo.yaml &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;h2 id=&quot;visualization&quot;&gt;Visualization&lt;/h2&gt; &lt;p&gt;Finally we can check that the system is working by using the laptop for visualization purposes as we did before. &lt;img src=&quot;/assets/images/blog/k8s_multiboard_6.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt; &lt;hr /&gt; &lt;h1 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h1&gt; &lt;p&gt;In this post we taken the 3D Perception demo further by combining the PCU with the RB3 in a k8s cluster. We have also seen that it is quite straighforward to deploy different Autoware.Auto modules in multiple boards by using the k8s infrastructure as opposed to manually doing the same. We will continue exploring what we can do with k8s in the near future so keep an eye to this space.&lt;/p&gt; </description> <pubDate>Fri, 19 Mar 2021 01:00:00 +0000</pubDate> <link>https://www.96boards.org/blog/k8s_autoware_auto_multiboard/</link> <guid isPermaLink="true">https://www.96boards.org/blog/k8s_autoware_auto_multiboard/</guid> <category>64-bit,</category> <category>96Boards,</category> <category>aarch64,</category> <category>ARM,</category> <category>ARMv8,</category> <category>Consumer</category> <category>Edition,</category> <category>Linaro,</category> <category>Linux,</category> <category>arm64,</category> <category>real</category> <category>time,</category> <category>ROS2,</category> <category>Autoware,</category> <category>AutoCore,</category> <category>PCU</category> <category>blog</category> </item> <item> <title>96boards: Autoware everywhere | Autoware.Auto 3D Perception Stack using k8s on PCU</title> <description>&lt;h1 id=&quot;introduction&quot;&gt;Introduction&lt;/h1&gt; &lt;p&gt;In our &lt;a href=&quot;https://www.96boards.org/blog/k8s_pilot_auto/&quot;&gt;previous blog post&lt;/a&gt; we showed how to we can use &lt;a href=&quot;https://kubernetes.io/&quot;&gt;Kubernetes (k8s)&lt;/a&gt; to create different deployments to replay and echo a rosbag2 data file. Though it was an interesting first step it falls far from being close to what an actual deployment on a vehicle would be.&lt;/p&gt; &lt;p&gt;In this blog post we take the setup further and use the &lt;a href=&quot;https://gitlab.com/autowarefoundation/autoware.auto/AutowareAuto&quot;&gt;Autoware.Auto&lt;/a&gt; software stack to reproduce the &lt;a href=&quot;https://autowarefoundation.gitlab.io/autoware.auto/AutowareAuto/perception-stack-howto.html&quot;&gt;3D perception&lt;/a&gt; demo using k8s.&lt;/p&gt; &lt;p&gt;This post is organized as follows:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href=&quot;#introduction&quot;&gt;Introduction&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#autowareauto&quot;&gt;Autoware.Auto&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#pcu-setup&quot;&gt;PCU setup&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#k8s-setup&quot;&gt;k8s setup&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#running-the-k8s-pods&quot;&gt;Running the k8s pods&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#conclusion&quot;&gt;Conclusion&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;hr /&gt; &lt;h2 id=&quot;autowareauto&quot;&gt;Autoware.Auto&lt;/h2&gt; &lt;p&gt;As we have covered in earlier posts, Autoware.Auto is the next generation successor of the Autoware.AI project through a complete rewrite of the different modules using ROS2 and improved methodology.&lt;/p&gt; &lt;p&gt;Following a succesful &lt;a href=&quot;https://discourse.ros.org/t/autoware-auto-automated-valet-parking-was-a-triumph/16662&quot;&gt;Autonomous Valet Parking&lt;/a&gt; demo, code and documentation cleanup, &lt;a href=&quot;https://discourse.ros.org/t/autoware-auto-1-0-0-is-here/19085&quot;&gt;Autoware.Auto 1.0.0&lt;/a&gt; has been released. We are using this release in this post.&lt;/p&gt; &lt;h2 id=&quot;pcu-setup&quot;&gt;PCU setup&lt;/h2&gt; &lt;p&gt;The first thing we need to do is install k8s in the PCU and laptop. To do so we have first flashed the PCU with Autocore’s provided image as we explained in &lt;a href=&quot;https://www.96boards.org/blog/autocore_pcu_1/&quot;&gt;this post&lt;/a&gt;. We have used the &lt;a href=&quot;https://github.com/autocore-ai/autocore_pcu_doc/blob/master/docs/Resource_download.md#mpu-images&quot;&gt;latest release from AutoCore&lt;/a&gt; which, at the time of writing, is &lt;em&gt;20201214 Release Package&lt;/em&gt;.&lt;/p&gt; &lt;p&gt;After getting the PCU SD card ready we can boot the board, &lt;code class=&quot;highlighter-rouge&quot;&gt;ssh&lt;/code&gt; into it and install k8s as we did before &lt;a href=&quot;https://www.96boards.org/blog/cyclonedds_on_kubernetes/#installing-k8s&quot;&gt;here&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt; We need to enable iptable forwarding rules on the PCU for the pods to communicate with each other, we can do so as:&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ iptables -P FORWARD ACCEPT &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;h2 id=&quot;k8s-setup&quot;&gt;k8s setup&lt;/h2&gt; &lt;p&gt;As we mentioned above the main idea behind the k8s configuration is to split the Autoware.Auto software components into different deployments so they can be managed independently and run as individual services across the k8s cluster. In this demo we will be using 3 deployments:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;udpreplay&lt;/code&gt;: replays the Velodyne pcap data.&lt;/li&gt; &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;sensing&lt;/code&gt;: 2-pod deployment for the front and rear Velodyne driver nodes.&lt;/li&gt; &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;perception3d&lt;/code&gt;: multi-pod deployment for the robot state publisher, point cloud filter transform, ray ground classifier and euclidean cluster nodes.&lt;/li&gt; &lt;/ul&gt; &lt;p&gt;Furthermore, we would expect that each deployment would use a docker image tailored to its needs rather than a more general one, so, instead of building the full Autoware.Auto we have put together 3 Docker images with the needed nodes for each deployment. These images can be found in the &lt;a href=&quot;https://hub.docker.com/r/96boards/autoware.auto/tags?page=1&amp;amp;ordering=last_updated&quot;&gt;96boards/autoware.auto&lt;/a&gt; dockerhub repo.&lt;/p&gt; &lt;p&gt;Taking this into account we are now ready to create the k8s cluster and the 3 deployments. In addition, as we did in the previous post we will be using Rviz2 on the laptop for visualization purposes.&lt;/p&gt; &lt;h2 id=&quot;running-the-k8s-pods&quot;&gt;Running the k8s pods&lt;/h2&gt; &lt;p&gt;We are now ready to get things running on k8s, for the fully detailed steps please check our &lt;a href=&quot;https://www.96boards.org/blog/cyclonedds_on_kubernetes/#using-k8s&quot;&gt;first post about k8s&lt;/a&gt;. As a recap, we need to:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Kick off the master node in the laptop. &lt;img src=&quot;/assets/images/blog/dds_k8s_master_setup.gif&quot; alt=&quot;&quot; /&gt;&lt;/li&gt; &lt;li&gt;Join the PCU as a worker node. &lt;img src=&quot;/assets/images/blog/dds_k8s_worker_setup.gif&quot; alt=&quot;&quot; /&gt;&lt;/li&gt; &lt;li&gt;Enable the &lt;a href=&quot;https://github.com/coreos/flannel&quot;&gt;Flannel CNI add-on&lt;/a&gt; and copy the Flannel environment variables to the PCU.&lt;/li&gt; &lt;/ul&gt; &lt;p&gt;We can check that the worker node on the PCU has joined the cluster by running &lt;code class=&quot;highlighter-rouge&quot;&gt;kubectl get nodes&lt;/code&gt; on the laptop as shown below. &lt;img src=&quot;/assets/images/blog/dds_k8s_nodes2.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt; &lt;p&gt;Now that our k8s cluster is up and running we just need to create our deployments. The yaml files are available &lt;a href=&quot;https://people.linaro.org/~servando.german.serrano/pcu/k8s/autoware.auto-3dperception-demo/&quot;&gt;here&lt;/a&gt;.&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ kubectl apply -f https://people.linaro.org/~servando.german.serrano/pcu/k8s/autoware.auto-3dperception-demo/udpreplay.yaml $ kubectl apply -f https://people.linaro.org/~servando.german.serrano/pcu/k8s/autoware.auto-3dperception-demo/sensing.yaml $ kubectl apply -f https://people.linaro.org/~servando.german.serrano/pcu/k8s/autoware.auto-3dperception-demo/perception3D-demo.yaml &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;&lt;img src=&quot;/assets/images/blog/k8s_percp_1.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt; &lt;p&gt;And the Rviz2 visualization on the laptop. &lt;img src=&quot;/assets/images/blog/k8s_percp_2.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt; &lt;hr /&gt; &lt;h1 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h1&gt; &lt;p&gt;In this post we have explored a bit further on splitting some Autoware.Auto modules using k8s. In addition we have used different Docker images for each deployment as it’ll make it easier to update them when the time comes since they are lighter than a fully-built Autoware.Auto image. We will continue exploring what we can do with k8s in the near future so keep an eye to this space.&lt;/p&gt; </description> <pubDate>Mon, 08 Mar 2021 01:00:00 +0000</pubDate> <link>https://www.96boards.org/blog/k8s_autoware_auto1/</link> <guid isPermaLink="true">https://www.96boards.org/blog/k8s_autoware_auto1/</guid> <category>64-bit,</category> <category>96Boards,</category> <category>aarch64,</category> <category>ARM,</category> <category>ARMv8,</category> <category>Consumer</category> <category>Edition,</category> <category>Linaro,</category> <category>Linux,</category> <category>arm64,</category> <category>real</category> <category>time,</category> <category>ROS2,</category> <category>Autoware,</category> <category>AutoCore,</category> <category>PCU,</category> <category>arm-autonomy</category> <category>blog</category> </item> <item> <title>96boards: Autoware everywhere | K8s-based Autoware deployment on PCU</title> <description>&lt;h1 id=&quot;introduction&quot;&gt;Introduction&lt;/h1&gt; &lt;p&gt;In our &lt;a href=&quot;https://www.96boards.org/blog/cyclonedds_on_kubernetes/&quot;&gt;previous blog post&lt;/a&gt; we showed how to setup a &lt;a href=&quot;https://kubernetes.io/&quot;&gt;Kubernetes (k8s)&lt;/a&gt; cluster using a laptop as the master node and Autocore’s PCU as the worker node to deploy the different k8s pods. To test the setup we run a minimal deployment using the &lt;a href=&quot;https://github.com/eclipse-cyclonedds/cyclonedds/tree/master/src/tools/ddsperf&quot;&gt;ddsperf tool&lt;/a&gt; that is available as part of Cyclone DDS.&lt;/p&gt; &lt;p&gt;In this first exploration we are going to create 2 k8s single-pod deployments on the PCU:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;One that will read a rosbag data file. This data file has been recorded by TierIV using the new architecture implementation.&lt;/li&gt; &lt;li&gt;The other will echo the &lt;code class=&quot;highlighter-rouge&quot;&gt;/sensing/imu/imu_data&lt;/code&gt; topic that is being published by the other pod.&lt;/li&gt; &lt;/ul&gt; &lt;p&gt;In addition we are going to kick off Rviz2 and the rqt-image-view packages from ROS2 in the laptop to visualize the data. For this demo we are setting the pods to use the &lt;code class=&quot;highlighter-rouge&quot;&gt;hostNetwork&lt;/code&gt; as both k8s nodes are in the same local network.&lt;/p&gt; &lt;p&gt;This post is organized as follows:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href=&quot;#introduction&quot;&gt;Introduction&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#new-autoware-architecture-proposal&quot;&gt;New Autoware Architecture Proposal&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#pcu-setup&quot;&gt;PCU setup&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#running-the-k8s-pods&quot;&gt;Running the k8s pods&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#conclusion&quot;&gt;Conclusion&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;hr /&gt; &lt;h2 id=&quot;new-autoware-architecture-proposal&quot;&gt;New Autoware Architecture Proposal&lt;/h2&gt; &lt;p&gt;To improve the development of Autoware capabilities TierIV has developed a &lt;a href=&quot;https://github.com/tier4/AutowareArchitectureProposal.proj/blob/master/design/Overview.md&quot;&gt;new Architecture&lt;/a&gt;. This architecture provides a layered approach to the different software stack components and definition of the interfaces between modules. We will use the &lt;a href=&quot;https://github.com/tier4/AutowareArchitectureProposal.iv/tree/v0.5.0&quot;&gt;ros2 v0.5.0 tag&lt;/a&gt; of the Pilot.Auto software stack which is built using the new architecture as reference.&lt;/p&gt; &lt;h2 id=&quot;pcu-setup&quot;&gt;PCU setup&lt;/h2&gt; &lt;p&gt;The first thing we need to do is install k8s in the PCU and laptop. To do so we have first flashed the PCU with Autocore’s provided image as we explained in &lt;a href=&quot;https://www.96boards.org/blog/autocore_pcu_1/&quot;&gt;this post&lt;/a&gt;. We have used the &lt;a href=&quot;https://github.com/autocore-ai/autocore_pcu_doc/blob/master/docs/Resource_download.md#mpu-images&quot;&gt;latest release from AutoCore&lt;/a&gt; which, at the time of writing, is &lt;em&gt;20201214 Release Package&lt;/em&gt;.&lt;/p&gt; &lt;p&gt;After getting the PCU SD card ready we can boot the board, &lt;code class=&quot;highlighter-rouge&quot;&gt;ssh&lt;/code&gt; into it and install k8s as we did before &lt;a href=&quot;https://www.96boards.org/blog/cyclonedds_on_kubernetes/#installing-k8s&quot;&gt;here&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt; We need to enable iptable forwarding rules on the PCU for the pods to communicate with each other, we can do so as:&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ iptables -P FORWARD ACCEPT &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;h2 id=&quot;running-the-k8s-pods&quot;&gt;Running the k8s pods&lt;/h2&gt; &lt;p&gt;We are now ready to get things running on k8s, for the fully detailed steps please check our &lt;a href=&quot;https://www.96boards.org/blog/cyclonedds_on_kubernetes/#using-k8s&quot;&gt;previous blog&lt;/a&gt;. As a recap, we need to:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Kick off the master node in the laptop. &lt;img src=&quot;/assets/images/blog/dds_k8s_master_setup.gif&quot; alt=&quot;&quot; /&gt;&lt;/li&gt; &lt;li&gt;Join the PCU as a worker node. &lt;img src=&quot;/assets/images/blog/dds_k8s_worker_setup.gif&quot; alt=&quot;&quot; /&gt;&lt;/li&gt; &lt;li&gt;Enable the &lt;a href=&quot;https://github.com/coreos/flannel&quot;&gt;Flannel CNI add-on&lt;/a&gt; and copy the Flannel environment variables to the PCU.&lt;/li&gt; &lt;/ul&gt; &lt;p&gt;We can check that the worker node on the PCU has joined the cluster by running &lt;code class=&quot;highlighter-rouge&quot;&gt;kubectl get nodes&lt;/code&gt; on the laptop as shown below. &lt;img src=&quot;/assets/images/blog/dds_k8s_nodes2.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt; &lt;p&gt;Now to deploy the pods on the PCU node we are going to use the &lt;code class=&quot;highlighter-rouge&quot;&gt;rosbag-echo-pod.yaml&lt;/code&gt; k8s deployment file available &lt;a href=&quot;https://people.linaro.org/~servando.german.serrano/pcu/k8s/&quot;&gt;here&lt;/a&gt;. This file starts the 2 deployments we have mentioned earlier, a rosbag replay deployment and another to echo the IMU data. We can start both deployments as:&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ kubectl apply -f https://people.linaro.org/~servando.german.serrano/pcu/k8s/rosbag-echo-pod.yaml &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;&lt;img src=&quot;/assets/images/blog/k8s_rosbag_depl.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt; &lt;p&gt;We can see that both pods are now running and they have been deployed on the PCU node (named &lt;code class=&quot;highlighter-rouge&quot;&gt;localhost&lt;/code&gt;). To check that the rostopic pod is receiving data we can get the logs from the pod as:&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ kubectl logs --follow rostopic-echo-59967f6cc5-lpgjm &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;&lt;img src=&quot;/assets/images/blog/k8s_rostopic.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt; &lt;p&gt;Now, we can use the laptop to visualize some of the LIDAR data that it’s being replayed in Rviz2. &lt;img src=&quot;/assets/images/blog/k8s_vis.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt; &lt;hr /&gt; &lt;h1 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h1&gt; &lt;p&gt;In this post we have shown how to deploy a couple of k8s pods on the PCU. We can take this initial setup as reference to explore further splitting the different Autoware modules into individual pods that can be managed using k8s.&lt;/p&gt; </description> <pubDate>Fri, 26 Feb 2021 01:00:00 +0000</pubDate> <link>https://www.96boards.org/blog/k8s_pilot_auto/</link> <guid isPermaLink="true">https://www.96boards.org/blog/k8s_pilot_auto/</guid> <category>64-bit,</category> <category>96Boards,</category> <category>aarch64,</category> <category>ARM,</category> <category>ARMv8,</category> <category>Consumer</category> <category>Edition,</category> <category>Linaro,</category> <category>Linux,</category> <category>arm64,</category> <category>real</category> <category>time,</category> <category>ROS2,</category> <category>Autoware,</category> <category>AutoCore,</category> <category>PCU,</category> <category>arm-autonomy</category> <category>blog</category> </item> <item> <title>96boards: Autoware everywhere | Xenomai on PCU</title> <description>&lt;h1 id=&quot;introduction&quot;&gt;Introduction&lt;/h1&gt; &lt;p&gt;&lt;a href=&quot;https://gitlab.denx.de/Xenomai/xenomai/-/wikis/home&quot;&gt;Xenomai&lt;/a&gt; is a Free Software project in which engineers from a wide background collaborate to build a robust and resource-efficient real-time core for Linux© following the dual kernel approach, for applications with stringent latency requirements.&lt;/p&gt; &lt;p&gt;In this post we explore how we can build Xenomai to use on Autocore’s PCU. We will explore how to enable Xenomai’s &lt;a href=&quot;https://gitlab.denx.de/Xenomai/xenomai/-/wikis/Start_Here#user-content-how-does-xenomai-deliver-real-time&quot;&gt;2 options&lt;/a&gt; to provide the real-time capabilities on the board.&lt;/p&gt; &lt;p&gt;This post is organized as follows:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href=&quot;#introduction&quot;&gt;Introduction&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#xenomai&quot;&gt;Xenomai&lt;/a&gt; &lt;ul&gt; &lt;li&gt;&lt;a href=&quot;#mercury-core&quot;&gt;Mercury core&lt;/a&gt; &lt;ul&gt; &lt;li&gt;&lt;a href=&quot;#gettting-the-pcu-image&quot;&gt;Getting the PCU image&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#getting-the-xenomai-sources&quot;&gt;Getting the Xenomai sources&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#building-for-mercury&quot;&gt;Building for Mercury&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#cobalt-co-kernel&quot;&gt;Cobalt co-kernel&lt;/a&gt; &lt;ul&gt; &lt;li&gt;&lt;a href=&quot;#patch-i-pipe-on-the-linux-kernel&quot;&gt;Patch I-pipe on the Linux kernel&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#building-the-patched-linux-kernel&quot;&gt;Building the patched Linux kernel&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#building-for-cobalt&quot;&gt;Building for Cobalt&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#conclusion&quot;&gt;Conclusion&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;hr /&gt; &lt;h1 id=&quot;xenomai&quot;&gt;Xenomai&lt;/h1&gt; &lt;p&gt;As mentioned above Xenomai provides capabilities to support applications with hard real time requirements. It does so either supplementing Linux with a real-time co-kernel running side-by-side with it, the Cobalt co-kernel, or by relying on the real-time capabilities of the native Linux kernel, through the Mercury core.&lt;/p&gt; &lt;p&gt;In this blog post we will show how we can use either of the approaches on AutoCore’s PCU.&lt;/p&gt; &lt;h2 id=&quot;mercury-core&quot;&gt;Mercury core&lt;/h2&gt; &lt;p&gt;The single-kernel approach, through the use of the Mercury core, relies on the real-time capabilities of the antive Linux kernel. This means that we need to provide the Linux kernel with those capabilities through the use of the &lt;a href=&quot;https://wiki.linuxfoundation.org/realtime/start&quot;&gt;PREEMPT-RT patch&lt;/a&gt; which involves patching the kernel with the right patch version, build it for the PCU, etc.&lt;/p&gt; &lt;h3 id=&quot;getting-the-pcu-image&quot;&gt;Getting the PCU image&lt;/h3&gt; &lt;p&gt;In our case, and thanks to the work of the AutoCore team, the default image for the PCU already comes pre-patched with PREEMPT-RT, meaning that we just need to download it, flash it to the SD card and get down to building the Xenomai libraries for the Mercury core. To do so we just need to &lt;a href=&quot;https://github.com/autocore-ai/autocore_pcu_doc/blob/master/docs/Resource_download.md&quot;&gt;Autocore’s Resource Download&lt;/a&gt; site and get the latest image for the PCU. At the time of writing the latest avaialbe image is located in the &lt;em&gt;20201214 Release Package&lt;/em&gt;, it contains (among others):&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Ubuntu 20.04 pre-patched with PREEMPT-RT&lt;/li&gt; &lt;li&gt;ROS2 Foxy&lt;/li&gt; &lt;/ul&gt; &lt;p&gt;Once download we can just flash it on to the SD card and pop it into the PCU. If you need a bit more details to get the PCU up and running, please check our &lt;a href=&quot;https://www.96boards.org/blog/autocore_pcu_1/&quot;&gt;previous blog&lt;/a&gt;.&lt;/p&gt; &lt;h3 id=&quot;getting-the-xenomai-sources&quot;&gt;Getting the Xenomai sources&lt;/h3&gt; &lt;p&gt;As the Xenomai libraries are lightweight we will build them directly on the PCU. So, after flashing the PCU we just need to boot it and log in using the default &lt;code class=&quot;highlighter-rouge&quot;&gt;user&lt;/code&gt; username and password.&lt;/p&gt; &lt;p&gt;As men tioned in the &lt;a href=&quot;https://gitlab.denx.de/Xenomai/xenomai/-/wikis/Installing_Xenomai_3#user-content-building-the-arm64-libraries&quot;&gt;Xenomai build instructions&lt;/a&gt; for arm64 architecture we need to get the &lt;code class=&quot;highlighter-rouge&quot;&gt;next&lt;/code&gt; branch from the Xenomai repository.&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ git clone https://gitlab.denx.de/Xenomai/xenomai.git -b next &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;h3 id=&quot;building-for-mercury&quot;&gt;Building for Mercury&lt;/h3&gt; &lt;p&gt;To build Xenomai Mercury core we just need to do the following.&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ cd xenomai $ ./scripts/bootstrap $ ./configure --with-core=mercury --enable-smp --enable-pshared $ sudo make install &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;&lt;img src=&quot;/assets/images/blog/xenomai_mercury.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt; &lt;p&gt;Once the libraries are installed we can try the &lt;a href=&quot;https://wiki.linuxfoundation.org/realtime/documentation/howto/tools/cyclictest/start&quot;&gt;cyclictest&lt;/a&gt; to get some results running on the real time kernel as shown below.&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ sudo /usr/xenomai/demo/cyclictest --mlockall --smp --priority=98 --interval=200 --distance=0 -D 20 &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;&lt;img src=&quot;/assets/images/blog/xenomai_mercury_test.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt; &lt;p&gt;We can see that we are getting a maximum latency of 120 microsecs in the worst case. We’ll compare later on with the Cobalt co-kernel output.&lt;/p&gt; &lt;h2 id=&quot;cobalt-co-kernel&quot;&gt;Cobalt co-kernel&lt;/h2&gt; &lt;p&gt;We will now get the dual kernel configuration up and running on the PCU. The Cobalt co-kernel deals with the time-critical activities and has higher priority over the native Linux kernel processes.&lt;/p&gt; &lt;p&gt;The process of enabling the Cobalt co-kernel is a bit more involved than for the Mercury core but we’ll make it as straighforward as possible. As outlined in the &lt;a href=&quot;https://gitlab.denx.de/Xenomai/xenomai/-/wikis/Installing_Xenomai_3#cobalt-core-install&quot;&gt;Cobalt core installation instructions&lt;/a&gt; we need to:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Prepare the Linux kernel by patching it with I-pipe.&lt;/li&gt; &lt;li&gt;Build the patched kernel and get it on the PCU.&lt;/li&gt; &lt;li&gt;Build the Xenomai libraries for the Cobalt co-kernel.&lt;/li&gt; &lt;/ul&gt; &lt;h3 id=&quot;getting-all-sources&quot;&gt;Getting all sources&lt;/h3&gt; &lt;p&gt;We will use NXP flex-builder tool to put together the bootpartition with the patched kernel we need for the PCU. To do so, we’ll follow &lt;a href=&quot;https://github.com/autocore-ai/autocore_pcu_doc/blob/master/docs/Mpu_build.md&quot;&gt;Autocore’s guide&lt;/a&gt; to build a suitable image for the PCU together.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: Ubuntu 18.04 is needed to use the flex-builder tool.&lt;/p&gt; &lt;p&gt;First of all we need to get all the source code as outlined &lt;a href=&quot;https://github.com/autocore-ai/autocore_pcu_doc/blob/master/docs/Mpu_build.md#download-source-code&quot;&gt;here&lt;/a&gt;.&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ mkdir 1046a $ vcs import 1046a &amp;lt; 1046a.repos &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;h3 id=&quot;patch-i-pipe-on-the-linux-kernel&quot;&gt;Patch I-pipe on the Linux kernel&lt;/h3&gt; &lt;p&gt;Once the sources are downladed we need to get the Xenomai sources and the appropriate I-pipe patch. The default I-pipe patch in the &lt;a href=&quot;https://xenomai.org/downloads/ipipe/&quot;&gt;download area&lt;/a&gt; fails to apply on the customized kernel v4.14 from Autocore, for convenience a modified I-pipe patch is available &lt;a href=&quot;https://people.linaro.org/~servando.german.serrano/pcu/xenomai/&quot;&gt;here&lt;/a&gt;, which is the one used in the next steps.&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ cd 1046a/flexbuild/packages/linux $ git clone https://gitlab.denx.de/Xenomai/xenomai.git -b next $ wget https://people.linaro.org/~servando.german.serrano/pcu/xenomai/ipipe-4.14.78-arm64.patch &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;Next we use Xenomai’s shell script to prepare the Linux kernel.&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ cd 1046a/flexbuild/packages/linux/xenomai $ ./scripts/prepare-kernel.sh --linux=/1046a/flexbuild/packages/linux/linux --ipipe=/1046a/flexbuild/packages/linux/ipipe-4.14.78-arm64.patch --arch=arm64 &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;&lt;img src=&quot;/assets/images/blog/xenomai_ipipe_patch.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt; &lt;h3 id=&quot;building-the-patched-linux-kernel&quot;&gt;Building the patched Linux kernel&lt;/h3&gt; &lt;p&gt;We are now ready to build the patched kernel for the PCU. As mentioned earlier, we’ll use the flex-builder tool. We will build the patched kernel and bootpartition and replace them in the default PCU image.&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ cd 1046a/flexbuild $ source setup.env $ flex-builder -c linux -a arm64 $ flex-builder -i mkbootpartition -a arm64 &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;After the kernel and boot partition builds complete we need to flash the SD card with the PCU image from &lt;a href=&quot;https://github.com/autocore-ai/autocore_pcu_doc/blob/master/docs/Resource_download.md&quot;&gt;Autocore’s Resource Download&lt;/a&gt; site and replace the boot partition with the newly created one.&lt;/p&gt; &lt;p&gt;The boot partition files are located in &lt;code class=&quot;highlighter-rouge&quot;&gt;1046a/flexbuild/build/images/bootpartition_LS_arm64_lts_4.14&lt;/code&gt; and we just need to copy them over to the &lt;code class=&quot;highlighter-rouge&quot;&gt;boot&lt;/code&gt; folder that has been created in the SD card during the PCU flashing process.&lt;/p&gt; &lt;h3 id=&quot;building-for-cobalt&quot;&gt;Building for Cobalt&lt;/h3&gt; &lt;p&gt;Following the steps in the previous section we are now ready to pop the SD card in the PCU, boot it and log in using the default &lt;code class=&quot;highlighter-rouge&quot;&gt;user&lt;/code&gt; username and password.&lt;/p&gt; &lt;p&gt;We build the Xenomai Cobalt co-kernel following similar steps as for the Mercury core after logging into the PCU.&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ git clone https://gitlab.denx.de/Xenomai/xenomai.git -b next $ cd xenomai $ ./scripts/bootstrap $ ./configure --with-core=cobalt --enable-smp --enable-pshared $ sudo make install &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;&lt;img src=&quot;/assets/images/blog/xenomai_cobalt.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt; &lt;p&gt;Following the installation of the Cobalt co-kernel we can try to &lt;a href=&quot;#https://gitlab.denx.de/Xenomai/xenomai/-/wikis/Installing_Xenomai_3#user-content-booting-the-cobalt-kernel&quot;&gt;boot it&lt;/a&gt; to check that everything went fine.&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ dmesg | grep -i xenomai &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;&lt;img src=&quot;/assets/images/blog/xenomai_cobalt_boot.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt; &lt;p&gt;As we did for the Mercury core we run the &lt;a href=&quot;https://wiki.linuxfoundation.org/realtime/documentation/howto/tools/cyclictest/start&quot;&gt;cyclictest&lt;/a&gt; to get some results running on the real time kernel as shown below.&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ sudo /usr/xenomai/demo/cyclictest --mlockall --smp --priority=98 --interval=200 --distance=0 -D 20 &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;&lt;img src=&quot;/assets/images/blog/xenomai_cobalt_test.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt; &lt;p&gt;We can see that using the Cobalt co-kernel we are getting a maximum latency of 20 microsecs in the worst case, which a big reduction compared with the 120 microsecs we were getting with the Mercury core.&lt;/p&gt; &lt;hr /&gt; &lt;h1 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h1&gt; &lt;p&gt;In this post we have shown how to build Xenomai to provide the PCU with hard real time capabilities. We have seen that taking the dual kernel approach through the Cobalt co-kernel it is possible to achieve more stringent latencies than those of the Mercury core.&lt;/p&gt; </description> <pubDate>Mon, 08 Feb 2021 01:00:00 +0000</pubDate> <link>https://www.96boards.org/blog/xenomai_on_pcu/</link> <guid isPermaLink="true">https://www.96boards.org/blog/xenomai_on_pcu/</guid> <category>64-bit,</category> <category>96Boards,</category> <category>aarch64,</category> <category>ARM,</category> <category>ARMv8,</category> <category>Consumer</category> <category>Edition,</category> <category>Linaro,</category> <category>Linux,</category> <category>arm64,</category> <category>real</category> <category>time,</category> <category>ROS2,</category> <category>Autoware,</category> <category>AutoCore,</category> <category>PCU,</category> <category>arm-autonomy</category> <category>blog</category> </item> <item> <title>96boards: Autoware everywhere | Running Cyclone DDS on Kubernetes</title> <description>&lt;h1 id=&quot;introduction&quot;&gt;Introduction&lt;/h1&gt; &lt;p&gt;&lt;a href=&quot;https://kubernetes.io/&quot;&gt;Kubernetes (k8s)&lt;/a&gt; is an open-source system for automating deployment, scaling, and management of containerized applications. Kubernetes allows us to easily handle multiple distributed applications that might need to be deployed, managed (scaling up or down) and updated on a regular basis.&lt;/p&gt; &lt;p&gt;In this post we explore how to use k8s to deploy two Cyclone DDS based applications on Autocore’s PCU and whether introducing the k8s infrastructure impacts the performance of Cyclone DDS. In order to do so we will use the &lt;a href=&quot;https://github.com/eclipse-cyclonedds/cyclonedds/tree/master/src/tools/ddsperf&quot;&gt;ddsperf tool&lt;/a&gt; that is available as part of Cyclone DDS.&lt;/p&gt; &lt;p&gt;This post is organized as follows:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href=&quot;#introduction&quot;&gt;Introduction&lt;/a&gt; &lt;ul&gt; &lt;li&gt;&lt;a href=&quot;#testing-setup&quot;&gt;Testing setup&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#installing-k8s&quot;&gt;Installing k8s&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#running-the-performance-test&quot;&gt;Running the performance test&lt;/a&gt; &lt;ul&gt; &lt;li&gt;&lt;a href=&quot;#docker-containers&quot;&gt;Docker containers&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#using-k8s&quot;&gt;Using k8s&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#performance-comparison&quot;&gt;Performance comparison&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#conclusion&quot;&gt;Conclusion&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;hr /&gt; &lt;h2 id=&quot;testing-setup&quot;&gt;Testing setup&lt;/h2&gt; &lt;p&gt;For the k8s test we will use the PCU and a laptop as follows:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Laptop: used to run the k8s master node&lt;/li&gt; &lt;li&gt;PCU: used to run k8s deployment pods for the Cyclone DDS tasks.&lt;/li&gt; &lt;/ul&gt; &lt;p&gt;We need to install k8s on laptop and PCU and the steps below are the same for both.&lt;/p&gt; &lt;h2 id=&quot;installing-k8s&quot;&gt;Installing k8s&lt;/h2&gt; &lt;p&gt;The first thing we need to do is install k8s in the PCU and laptop. To do so we have first flashed the PCU with Autocore’s provided image as we explained in &lt;a href=&quot;https://www.96boards.org/blog/autocore_pcu_1/&quot;&gt;this post&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;After getting the PCU SD card ready we can boot the board and &lt;code class=&quot;highlighter-rouge&quot;&gt;ssh&lt;/code&gt; into it.&lt;/p&gt; &lt;p&gt;The following installation steps are the official ones from the &lt;a href=&quot;https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/#installing-kubeadm-kubelet-and-kubectl&quot;&gt;k8s documentation&lt;/a&gt; to install kubeadm, kubelet and kubectl.&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ sudo apt-get update &amp;amp;&amp;amp; sudo apt-get install -y apt-transport-https curl $ curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - $ cat &amp;lt;&amp;lt;EOF | sudo tee /etc/apt/sources.list.d/kubernetes.list deb https://apt.kubernetes.io/ kubernetes-xenial main EOF $ sudo apt-get update $ sudo apt-get install -y kubelet kubeadm kubectl $ sudo apt-mark hold kubelet kubeadm kubectl &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;h2 id=&quot;running-the-performance-test&quot;&gt;Running the performance test&lt;/h2&gt; &lt;p&gt;As part of this post we have built a suitable &lt;a href=&quot;https://hub.docker.com/layers/96boards/pcu/cyclone_k8s/images/sha256-58de4619573d6494344303b108fc68ddaec17e45184dc1d29216eda961236565?context=explore&quot;&gt;Docker image&lt;/a&gt; which contains a compiled Cyclone DDS and a couple of its examples.&lt;/p&gt; &lt;p&gt;Now that the PCU is set up and running with k8s we are ready to run the performance test for Cyclone DDS. To do so we are using the &lt;code class=&quot;highlighter-rouge&quot;&gt;perftest&lt;/code&gt; script available in the &lt;code class=&quot;highlighter-rouge&quot;&gt;examples/perfscript&lt;/code&gt; folder within the Cyclone DDS source code. This script relies on having &lt;code class=&quot;highlighter-rouge&quot;&gt;ssh&lt;/code&gt; connection between the multiple machines that run the ping-pong or sub-pub sides of the performance tests.&lt;/p&gt; &lt;p&gt;To avoid security issues between containers, as we would need to enable a common key pair for the container image to allow the automatic ssh connection without password, we have modified the &lt;code class=&quot;highlighter-rouge&quot;&gt;perftest&lt;/code&gt; slightly and split it in 2 pieces which we can run independently for each deployment. The split scripts are available as part of our Docker image and are not meant to replace the original &lt;code class=&quot;highlighter-rouge&quot;&gt;perftest&lt;/code&gt; script since the split has not been done in a clean way, i.e. just commenting and deleting what was not needed for the sake of this blog post and test.&lt;/p&gt; &lt;h3 id=&quot;docker-containers&quot;&gt;Docker containers&lt;/h3&gt; &lt;p&gt;Since we are going to assess the impact of the k8s infrastructure in the Cyclone DDS performance we need to first run the test manually using 2 docker containers. We will use 3 terminals where we have ssh’ed into the PCU.&lt;/p&gt; &lt;p&gt;First, we pull the docker image from Docker Hub.&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ docker pull 96boards/pcu:cyclone_k8s &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;We will use 2 terminals to start 2 containers and the other to create a network and connect the running containers as we show below.&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ docker run -it --rm --env image_args=&quot;/bin/bash&quot; --name subCont -p 8001:80 96boards/pcu:cyclone_k8s &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;and&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ docker run -it --rm --env image_args=&quot;/bin/bash&quot; --name pubCont -p 8002:80 96boards/pcu:cyclone_k8s &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;&lt;img src=&quot;/assets/images/blog/dds_k8s_containers.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt; &lt;p&gt;Now that the containers are running we can use the split scripts to run the performance test as:&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;./../../cyclonedds/examples/perfscript/perftest_sub &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;and&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;./../../cyclonedds/examples/perfscript/perftest_pub &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;We run both scrips at the same time using the &lt;code class=&quot;highlighter-rouge&quot;&gt;Broadcast group&lt;/code&gt; option in &lt;code class=&quot;highlighter-rouge&quot;&gt;terminator&lt;/code&gt; as can be seen.&lt;/p&gt; &lt;p&gt;&lt;img src=&quot;/assets/images/blog/dds_k8s_containers_test.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt; &lt;p&gt;After the test is finished the data we need will be in the &lt;code class=&quot;highlighter-rouge&quot;&gt;subCont&lt;/code&gt; container named &lt;code class=&quot;highlighter-rouge&quot;&gt;sub-process_pid.log&lt;/code&gt;. We can log into the &lt;code class=&quot;highlighter-rouge&quot;&gt;subCont&lt;/code&gt; container to check the file name to copy it to our host:&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ docker exec -it subCont /bin/bash &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;And to copy the log we just need to do:&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ docker cp subCont:/usr/local/sub-process_pid.log . &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;We will rename the log as &lt;code class=&quot;highlighter-rouge&quot;&gt;raw_containers_test_data.txt&lt;/code&gt; to use it later.&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ mv sub-process_pid.log raw_containers_test_data.txt &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;h3 id=&quot;using-k8s&quot;&gt;Using k8s&lt;/h3&gt; &lt;p&gt;We are now ready to get things running on k8s. To do so we will first create the master node in the laptop.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt; as k8s currently does not support SWAP enabled we need to disable the check on kubelet when creating the master. To do so we add a &lt;code class=&quot;highlighter-rouge&quot;&gt;KUBELET_EXTRA_ARGS&lt;/code&gt; and disable the swap preflight check.&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ sudo sed -i '4a\Environment=&quot;KUBELET_EXTRA_ARGS=--fail-swap-on=falses&quot;' /etc/systemd/system/kubelet.service.d/10-kubeadm.conf $ sudo kubeadm init --pod-network-cidr=10.244.0.0/16 --ignore-preflight-errors=Swap &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;&lt;img src=&quot;/assets/images/blog/dds_k8s_master_setup.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt; &lt;p&gt;As we can see above, upon successful start of the master node we will see: &lt;img src=&quot;/assets/images/blog/dds_k8s_master_setup.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt; &lt;p&gt;We need to follow the instructions to be able to manage the cluster using &lt;code class=&quot;highlighter-rouge&quot;&gt;kubectl&lt;/code&gt;, so:&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ mkdir -p $HOME/.kube $ sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config $ sudo chown $(id -u):$(id -g) $HOME/.kube/config &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;And we need to copy the &lt;code class=&quot;highlighter-rouge&quot;&gt;kubeadm join ...&lt;/code&gt; that we will need to use to ser up a worker node on the PCU. In our case:&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;kubeadm join 192.168.1.121:6443 --token ijliwh.eic48rh4nq580jpa --discovery-token-ca-cert-hash sha256:c491fda8e914efca3df9a0de87bf9cfe050f3d3d4e6ba0d55a6109a1d28354d5 &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;We also need to get a CNI add-on that will take care of configuration and cleanup of the pods. We will use the &lt;a href=&quot;https://github.com/coreos/flannel&quot;&gt;Flannel CNI add-on&lt;/a&gt;, which we can deploy just after starting the master node doing:&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;Running the &lt;code class=&quot;highlighter-rouge&quot;&gt;kubeadm&lt;/code&gt; will throw some preflight errors that for the time being we will ignore. So we can join the PCU as a worker node doing:&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ sudo kubeadm join 192.168.1.121:6443 --token ijliwh.eic48rh4nq580jpa --discovery-token-ca-cert-hash sha256:c491fda8e914efca3df9a0de87bf9cfe050f3d3d4e6ba0d55a6109a1d28354d5 --ignore-preflight-errors=all &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;&lt;img src=&quot;/assets/images/blog/dds_k8s_worker_setup.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt; &lt;p&gt;We can check that the worker node on the PCU has joined the cluster by running &lt;code class=&quot;highlighter-rouge&quot;&gt;kubectl get nodes&lt;/code&gt; on the laptop as shown below. &lt;img src=&quot;/assets/images/blog/dds_k8s_nodes.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt; &lt;p&gt;And we need to copy the flannel environment variables to the PCU by doing:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;On laptop: &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ sudo cp /run/flannel/subnet.env . $ scp subnet.env user@192.168.1.100:~ &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt; &lt;/div&gt; &lt;/li&gt; &lt;li&gt;On PCU: &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ sudo cp subnet.env /run/flannel/subnet.env &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt; &lt;/div&gt; &lt;/li&gt; &lt;/ul&gt; &lt;p&gt;We are now ready to deploy our k8s pods to run the cyclonedds pertest. On the laptop, we download the k8s deployments manifest files as:&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ wget https://people.linaro.org/~servando.german.serrano/pcu/k8s/cyclone-perftest-sub.yaml $ wget https://people.linaro.org/~servando.german.serrano/pcu/k8s/cyclone-perftest-pub.yaml &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;And deploy them using &lt;code class=&quot;highlighter-rouge&quot;&gt;kubectl&lt;/code&gt; on 2 terminals at the same time doing:&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ kubectl apply -f cyclone-perftest-sub.yaml &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;and&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ kubectl apply -f cyclone-perftest-pub.yaml &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;and check that the pods are created. &lt;img src=&quot;/assets/images/blog/dds_k8s_pods.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt; &lt;p&gt;We can check that the test is running by using the &lt;code class=&quot;highlighter-rouge&quot;&gt;kubectl logs&lt;/code&gt; command as shown below. &lt;img src=&quot;/assets/images/blog/dds_k8s_logs.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt; &lt;p&gt;We can log into the running pod using &lt;code class=&quot;highlighter-rouge&quot;&gt;kubectl exec&lt;/code&gt; to find out the process pid to be able to copy the log after the test finishes by doing:&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ kubectl exec --stdin --tty cyclone-perftest-sub-55bf66b5fc-wv5rb -- /bin/bash &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;&lt;img src=&quot;/assets/images/blog/dds_k8s_exec.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt; &lt;p&gt;And that’s it for running the performance test, we just need to wait now for the test to be finished and we can copy the &lt;code class=&quot;highlighter-rouge&quot;&gt;sub-process_pid.log&lt;/code&gt; file from the &lt;code class=&quot;highlighter-rouge&quot;&gt;cyclone-perftest-sub-...&lt;/code&gt; pod as:&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ kubectl cp cyclone-perftest-sub-55bf66b5fc-wv5rb:/usr/local/sub-process_pid.log ./raw_k8s_test_data.txt &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;h3 id=&quot;performance-comparison&quot;&gt;Performance comparison&lt;/h3&gt; &lt;p&gt;Following the completion of both approaches for the performance testing we can now plot both sets of results together to compare them.&lt;/p&gt; &lt;p&gt;We need first to preprocess the subcriber logs. To do so we use the &lt;code class=&quot;highlighter-rouge&quot;&gt;throughput-test-extract&lt;/code&gt; script from the &lt;a href=&quot;https://github.com/eclipse-cyclonedds/cyclonedds/tree/master/examples/perfscript&quot;&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;perfscript&lt;/code&gt;&lt;/a&gt; folder of the Cyclone DDS source code.&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ wget https://raw.githubusercontent.com/eclipse-cyclonedds/cyclonedds/master/examples/perfscript/throughput-test-extract $ sudo chmod +x throughput-test-extract $ ./throughput-test-extract raw_containers_test_data.txt &amp;gt; containers_test_data.txt $ ./throughput-test-extract raw_k8s_test_data.txt &amp;gt; k8s_test_data.txt &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;To plot the data from both tests in the same figure we rename the k8s test data file to &lt;code class=&quot;highlighter-rouge&quot;&gt;k8s_test_data.txt&lt;/code&gt; and the one using Docker containers manually to &lt;code class=&quot;highlighter-rouge&quot;&gt;containers_test_data.txt&lt;/code&gt;. A simple python script can be downloaded into the folder containing the data files and executed to get a figure like the one below:&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ wget https://people.linaro.org/~servando.german.serrano/pcu/k8s/dds_data_plot.py $ python dds_data_plot.py &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;&lt;img src=&quot;/assets/images/blog/dds_data_comp.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt; &lt;p&gt;The above figure shows that the k8s infrastructure does not impact the outcome of running Cyclone DDS performance test. Taking this result into account we are now ready to consider the deployment of Cyclone DDS based applications using k8s to manage the different containers we might need across a range of boards.&lt;/p&gt; &lt;hr /&gt; &lt;h1 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h1&gt; &lt;p&gt;In this post we have shown how to deploy Cyclone DDS based applications on Autocore’s PCU using k8s to manage the infrastructure and whether the k8s infrastructure impacted the performance of Cyclone DDS.&lt;/p&gt; &lt;p&gt;Taking this initial setup as reference we are now ready to take it further with other configurations, such as increasing the number of applications (e.g. Autoware packages) or the amount of worker nodes using a wider range of 96Boards.&lt;/p&gt; </description> <pubDate>Fri, 16 Oct 2020 01:00:00 +0000</pubDate> <link>https://www.96boards.org/blog/cyclonedds_on_kubernetes/</link> <guid isPermaLink="true">https://www.96boards.org/blog/cyclonedds_on_kubernetes/</guid> <category>64-bit,</category> <category>96Boards,</category> <category>aarch64,</category> <category>ARM,</category> <category>ARMv8,</category> <category>Consumer</category> <category>Edition,</category> <category>Linaro,</category> <category>Linux,</category> <category>arm64,</category> <category>real</category> <category>time,</category> <category>ROS2,</category> <category>Autoware,</category> <category>AutoCore,</category> <category>PCU,</category> <category>arm-autonomy</category> <category>blog</category> </item> <item> <title>96boards: Autoware everywhere | meta-arm-autonomy in AutoCore's PCU</title> <description>&lt;h1 id=&quot;introduction&quot;&gt;Introduction&lt;/h1&gt; &lt;p&gt;In our &lt;a href=&quot;https://www.96boards.org/blog/autocore_pcu_1/&quot;&gt;previous post&lt;/a&gt; of the “96boards: Autoware everywhere” blog series we introduced &lt;a href=&quot;https://www.autocore.ai/&quot;&gt;AutoCore’s&lt;/a&gt; PCU as the first heterogeneous hardware platform of the &lt;a href=&quot;https://www.autoware.io/&quot;&gt;Autoware.IO&lt;/a&gt; project.&lt;/p&gt; &lt;p&gt;In this post we will show how to set up the arm-autonomy software stack to be used on the PCU.&lt;/p&gt; &lt;p&gt;This post is organized as follows:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href=&quot;#introduction&quot;&gt;Introduction&lt;/a&gt; &lt;ul&gt; &lt;li&gt;&lt;a href=&quot;#arm-autonomy-yocto-layer&quot;&gt;arm-autonomy Yocto layer&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#yocto-images-build&quot;&gt;Yocto Images build&lt;/a&gt; &lt;ul&gt; &lt;li&gt;&lt;a href=&quot;#getting-the-sources&quot;&gt;Getting the sources&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#patching-the-sources&quot;&gt;Patching the sources&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#guest-image&quot;&gt;Guest image&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#host-image&quot;&gt;Host image&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#sd-card-setup&quot;&gt;SD card setup&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#booting-the-pcu&quot;&gt;Booting the PCU&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#creating-the-domu-and-logging-in&quot;&gt;Creating the domU and logging in&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#video-demo&quot;&gt;Video demo&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#conclusion&quot;&gt;Conclusion&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;hr /&gt; &lt;h2 id=&quot;arm-autonomy-yocto-layer&quot;&gt;arm-autonomy Yocto layer&lt;/h2&gt; &lt;p&gt;The arm-autonomy layer is part of the &lt;a href=&quot;https://git.yoctoproject.org/cgit/cgit.cgi/meta-arm/tree&quot;&gt;meta-arm Yocto repository&lt;/a&gt;. As stated in the &lt;a href=&quot;https://git.yoctoproject.org/cgit/cgit.cgi/meta-arm/tree/meta-arm-autonomy/README.md&quot;&gt;documentation&lt;/a&gt;, the arm-autonomy layer provides an hypervisor based solution (currently based on Xen) for autonomous system. It contains recipes and classes to build host and guest systems.&lt;/p&gt; &lt;p&gt;We will outline how to build the host and guest images, how to setup the micro SD card for the PCU and the way to boot the system and log into the domU.&lt;/p&gt; &lt;h2 id=&quot;yocto-images-build&quot;&gt;Yocto Images build&lt;/h2&gt; &lt;p&gt;The arm-autonomy documentation provides instructions on how to build the host and guest images. We will start with the guest image in order to get it automatically built in the host image in the next step.&lt;/p&gt; &lt;h3 id=&quot;getting-the-sources&quot;&gt;Getting the sources&lt;/h3&gt; &lt;p&gt;First we need to get the sources for our Yocto images, we can use the &lt;em&gt;repo&lt;/em&gt; tool. To install it, please do:&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ mkdir ~/bin $ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo &amp;gt; ~/bin/repo $ chmod a+x ~/bin/repo $ PATH=${PATH}:~/bin &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;Then we can get the repos as:&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ mkdir ~/arm_auto_pcu &amp;amp;&amp;amp; cd ~/arm_auto_pcu $ repo init -u https://git.linaro.org/people/servando.german.serrano/pcu_arm_auto.git/ -b dunfell $ repo sync &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;We are now ready to start building the guest and host images.&lt;/p&gt; &lt;h3 id=&quot;patching-the-sources&quot;&gt;Patching the sources&lt;/h3&gt; &lt;p&gt;To get arm-autonomy to run on our PCU we need to introduce a couple of patches into the downloaded sources.&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ cd ~/arm_auto_pcu/sources/meta-virtualization/recipes-extended/xen/files $ wget https://people.linaro.org/~servando.german.serrano/pcu/patches/0002-temp-hack-for-IRQ-Share.patch &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;And add the patch to &lt;code class=&quot;highlighter-rouge&quot;&gt;~/arm_auto_pcu/sources/meta-virtualization/recipes-extended/xen/xen_git.bb&lt;/code&gt; to &lt;code class=&quot;highlighter-rouge&quot;&gt;SRC_URI&lt;/code&gt;:&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;SRC_URI = &quot;git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \ file://0002-temp-hack-for-IRQ-Share.patch \ &quot; &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;h3 id=&quot;guest-image&quot;&gt;Guest image&lt;/h3&gt; &lt;p&gt;We will start creating the guest image so we can add it automatically to the host image at build time.&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ cd ~/arm_auto_pcu $ source sources/poky/oe-init-build-env guest_prj &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;Now we need to modify the &lt;code class=&quot;highlighter-rouge&quot;&gt;bblayers.conf&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;local.conf&lt;/code&gt; files.&lt;/p&gt; &lt;p&gt;We need to add the needed layers to the guest project &lt;code class=&quot;highlighter-rouge&quot;&gt;bblayers.conf&lt;/code&gt; file, so it will look as shown below:&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf # changes incompatibly POKY_BBLAYERS_CONF_VERSION = &quot;2&quot; BBPATH = &quot;${TOPDIR}&quot; BBFILES ?= &quot;&quot; BBLAYERS ?= &quot; \ /home/linaro/arm_autonomy/pcu_yocto/sources/poky/meta \ /home/linaro/arm_autonomy/pcu_yocto/sources/poky/meta-poky \ /home/linaro/arm_autonomy/pcu_yocto/sources/poky/meta-yocto-bsp \ /home/linaro/arm_autonomy/pcu_yocto/sources/meta-openembedded/meta-oe \ /home/linaro/arm_autonomy/pcu_yocto/sources/meta-openembedded/meta-python \ /home/linaro/arm_autonomy/pcu_yocto/sources/meta-openembedded/meta-filesystems \ /home/linaro/arm_autonomy/pcu_yocto/sources/meta-openembedded/meta-networking \ /home/linaro/arm_autonomy/pcu_yocto/sources/meta-virtualization \ /home/linaro/arm_autonomy/pcu_yocto/sources/meta-arm/meta-arm-autonomy \ &quot; &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;and we add the following to the &lt;code class=&quot;highlighter-rouge&quot;&gt;local.conf&lt;/code&gt; file:&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;MACHINE ??= &quot;arm64-autonomy-guest&quot; DISTRO_FEATURES += &quot;arm-autonomy-guest&quot; BB_NUMBER_THREADS ?= &quot;6&quot; PARALLEL_MAKE ?= &quot;-j 6&quot; DISTRO ?= &quot;poky&quot; PACKAGE_CLASSES ?= &quot;package_rpm&quot; EXTRA_IMAGE_FEATURES ?= &quot;debug-tweaks&quot; USER_CLASSES ?= &quot;buildstats image-mklibs image-prelink&quot; PATCHRESOLVE = &quot;noop&quot; BB_DISKMON_DIRS ??= &quot;\ STOPTASKS,${TMPDIR},1G,100K \ STOPTASKS,${DL_DIR},1G,100K \ STOPTASKS,${SSTATE_DIR},1G,100K \ STOPTASKS,/tmp,100M,100K \ ABORT,${TMPDIR},100M,1K \ ABORT,${DL_DIR},100M,1K \ ABORT,${SSTATE_DIR},100M,1K \ ABORT,/tmp,10M,1K&quot; CONF_VERSION = &quot;1&quot; IMAGE_INSTALL_append = &quot; git bash sudo&quot; XENGUEST_IMAGE_AUTOBOOT = &quot;0&quot; XENGUEST_IMAGE_NETWORK_BRIDGE = &quot;0&quot; INITRAMFS_IMAGE_BUNDLE = &quot;1&quot; INITRAMFS_IMAGE = &quot;core-image-minimal&quot; IMAGE_FSTYPES += &quot;cpio&quot; &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;Following that we build a minimal guest image as:&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ bitbake core-image-minimal &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;h3 id=&quot;host-image&quot;&gt;Host image&lt;/h3&gt; &lt;p&gt;Once we have the guest image built we can create the host project as follows:&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ cd ~/arm_auto_pcu $ source sources/poky/oe-init-build-env host_prj &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;Now we need to modify the &lt;code class=&quot;highlighter-rouge&quot;&gt;bblayers.conf&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;local.conf&lt;/code&gt; files. Your &lt;code class=&quot;highlighter-rouge&quot;&gt;local.conf&lt;/code&gt; file will look as:&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;MACHINE ??= &quot;ls1046afrwy&quot; DISTRO_FEATURES += &quot;arm-autonomy-host&quot; BB_NUMBER_THREADS ?= &quot;6&quot; PARALLEL_MAKE ?= &quot;-j 6&quot; ARM_AUTONOMY_HOST_IMAGE_EXTERN_GUESTS = &quot;/home/linaro/arm_autonomy/pcu_yocto/guest_prj/tmp/deploy/images/arm64-autonomy-guest/Image-initramfs-arm64-autonomy-guest.xenguest;guestname=myguest&quot; XENGUEST_MANAGER_VOLUME_DEVICE = &quot;/dev/mmcblk0p4&quot; XEN_DEVICETREE_DOM0_MEM = &quot;2048M&quot; XEN_DEVICETREE_DOM0_SIZE = &quot;0x03000000&quot; XEN_DEVICETREE_DOM0_BOOTARGS = &quot;console=hvc0 earlycon=xen root=/dev/mmcblk0p3 rw rootwait&quot; DISTRO ?= &quot;poky&quot; PACKAGE_CLASSES ?= &quot;package_rpm&quot; EXTRA_IMAGE_FEATURES ?= &quot;debug-tweaks&quot; USER_CLASSES ?= &quot;buildstats image-mklibs image-prelink&quot; PATCHRESOLVE = &quot;noop&quot; BB_DISKMON_DIRS ??= &quot;\ STOPTASKS,${TMPDIR},1G,100K \ STOPTASKS,${DL_DIR},1G,100K \ STOPTASKS,${SSTATE_DIR},1G,100K \ STOPTASKS,/tmp,100M,100K \ ABORT,${TMPDIR},100M,1K \ ABORT,${DL_DIR},100M,1K \ ABORT,${SSTATE_DIR},100M,1K \ ABORT,/tmp,10M,1K&quot; PACKAGECONFIG_append_pn-qemu-system-native = &quot; sdl&quot; CONF_VERSION = &quot;1&quot; DL_DIR = &quot;/home/linaro/arm_autonomy/pcu_yocto/downloads&quot; SSTATE_DIR = &quot;/home/linaro/arm_autonomy/pcu_yocto/sstate-cache&quot; INHERIT += &quot;own-mirrors&quot; SOURCE_MIRROR_URL ?= &quot;http://git.freescale.com/source/&quot; ACCEPT_FSL_EULA = &quot;1&quot; IMAGE_INSTALL_append = &quot; git bash sudo&quot; &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;and we need to add the following layer to the &lt;code class=&quot;highlighter-rouge&quot;&gt;bblayers.conf&lt;/code&gt; file:&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf # changes incompatibly POKY_BBLAYERS_CONF_VERSION = &quot;2&quot; BBPATH = &quot;${TOPDIR}&quot; BBFILES ?= &quot;&quot; BBLAYERS ?= &quot; \ /home/linaro/arm_autonomy/pcu_yocto/sources/poky/meta \ /home/linaro/arm_autonomy/pcu_yocto/sources/poky/meta-poky \ /home/linaro/arm_autonomy/pcu_yocto/sources/poky/meta-yocto-bsp \ /home/linaro/arm_autonomy/pcu_yocto/sources/meta-openembedded/meta-oe \ /home/linaro/arm_autonomy/pcu_yocto/sources/meta-openembedded/meta-python \ /home/linaro/arm_autonomy/pcu_yocto/sources/meta-openembedded/meta-filesystems \ /home/linaro/arm_autonomy/pcu_yocto/sources/meta-openembedded/meta-networking \ /home/linaro/arm_autonomy/pcu_yocto/sources/meta-virtualization \ /home/linaro/arm_autonomy/pcu_yocto/sources/meta-arm/meta-arm-autonomy \ /home/linaro/arm_autonomy/pcu_yocto/sources/meta-freescale \ /home/linaro/arm_autonomy/pcu_yocto/sources/meta-freescale-distro \ &quot; &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;Following that we build the host image as:&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ bitbake arm-autonomy-host-image-minimal &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;h2 id=&quot;sd-card-setup&quot;&gt;SD card setup&lt;/h2&gt; &lt;p&gt;We need to prepare the SD card for the PCU image. For our testing we have a 16GB card, the table bellow contains the set of partition sizes we have used, they are orientative and will depend on your particular use case.&lt;/p&gt; &lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Partition&lt;/th&gt; &lt;th&gt;Size&lt;/th&gt; &lt;th&gt;Type&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;Free&lt;/td&gt; &lt;td&gt;68MB&lt;/td&gt; &lt;td&gt;Unformatted&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;EFI&lt;/td&gt; &lt;td&gt;24MB&lt;/td&gt; &lt;td&gt;FAT16&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;boot&lt;/td&gt; &lt;td&gt;1.1GB&lt;/td&gt; &lt;td&gt;Ext4&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;rootfs&lt;/td&gt; &lt;td&gt;4GB&lt;/td&gt; &lt;td&gt;Ext4&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;guest&lt;/td&gt; &lt;td&gt;9GB&lt;/td&gt; &lt;td&gt;Ext4&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;p&gt;After the SD card is formatted we need to put the image together as follows.&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ cd ~/arm_auto_pcu/host_prj/tmp/deploy/images/ls1046afrwy $ mkdir output $ dd if=atf/bl2_sd.pbl of=output/firmware_ls1046afrwy_uboot_sdboot bs=512 seek=8 $ dd if=atf/fip_uboot.bin of=output/firmware_ls1046afrwy_uboot_sdboot bs=512 seek=2048 $ dd if=fsl_fman_ucode_ls1046_r1.0_106_4_18.bin of=output/firmware_ls1046afrwy_uboot_sdboot bs=512 seek=18432 $ dd if=boot/iram_Type_A_LS1021a_r1.0.bin of=output/firmware_ls1046afrwy_uboot_sdboot bs=512 seek=18944 $ dd if=ls2-phy/cs4315-cs4340-PHY-ucode.txt of=output/firmware_ls1046afrwy_uboot_sdboot bs=512 seek=19456 $ mkimage -T script -C none -d ./../../../../../sources/meta-qoriq-demos/recipes-bsp/secure-boot/secure-boot-qoriq/flash_images.sh flash_images.scr $ dd if=flash_images.scr of=output/firmware_ls1046afrwy_uboot_sdboot bs=512 seek=19968 $ dd if=fsl-ls1046a-frwy-sdk-xen.dtb of=output/firmware_ls1046afrwy_uboot_sdboot bs=512 seek=30720 $ tail -c +4097 output/firmware_ls1046afrwy_uboot_sdboot &amp;gt; output/firmware_ls1046afrwy_uboot_sdboot.img &amp;amp;&amp;amp; rm output/firmware_ls1046afrwy_uboot_sdboot $ sudo dd if=output/firmware_ls1046afrwy_uboot_sdboot.img of=/dev/sda bs=512 seek=8 $ echo 'load mmc 0:2 0x80080000 Image;load mmc 0:2 0x85000000 fsl-ls1046a-frwy-sdk-xen.dtb;load mmc 0:2 0x86000000 xen-ls1046afrwy;booti 0x86000000 - 0x85000000' &amp;gt;&amp;gt; output/ls1046afrwy_boot.scr.tmp $ mkimage -A arm64 -O linux -T script -C none -a 0 -e 0 -n &quot;boot.scr&quot; -d output/ls1046afrwy_boot.scr.tmp output/ls1046afrwy_boot.scr &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;And we can now copy over to our SD card and extract within the &lt;code class=&quot;highlighter-rouge&quot;&gt;rootfs&lt;/code&gt; partition:&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ sudo cp Image /media/linaro/boot $ sudo cp fsl-ls1046a-frwy-sdk-xen.dtb /media/linaro/boot $ sudo cp output/ls1046afrwy_boot.scr /media/linaro/boot $ sudo cp xen-ls1046afrwy /media/linaro/boot $ sudo cp arm-autonomy-host-image-minimal-ls1046afrwy.tar.gz /media/linaro/rootfs $ cd /media/linaro/rootfs $ sudo tar xzf arm-autonomy-host-image-minimal-ls1046afrwy.tar.gz &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;h2 id=&quot;booting-the-pcu&quot;&gt;Booting the PCU&lt;/h2&gt; &lt;p&gt;We are now ready to insert the micro SD card in its slot and turn on the PCU. We will see Xen booting first followed by the dom0 as shown in the images below.&lt;/p&gt; &lt;p&gt;&lt;img src=&quot;/assets/images/blog/arm_auto_pcu_1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt; &lt;p&gt;&lt;img src=&quot;/assets/images/blog/arm_auto_pcu_2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt; &lt;h2 id=&quot;creating-the-domu-and-logging-in&quot;&gt;Creating the domU and logging in&lt;/h2&gt; &lt;p&gt;After logging into the dom0 we can create the guest image and log into the guest console as:&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ xenguest-manager create /usr/share/guests/myguest.xenguest myguest $ xenguest-manager start myguest $ xl console myguest &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;We can log into the guest VM using the &lt;code class=&quot;highlighter-rouge&quot;&gt;root&lt;/code&gt; username as shown in the image below.&lt;/p&gt; &lt;p&gt;&lt;img src=&quot;/assets/images/blog/arm_auto_pcu_3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt; &lt;h2 id=&quot;video-demo&quot;&gt;Video demo&lt;/h2&gt; &lt;p&gt;We have posted a video demo of the steps to get the arm-autonomy software stack running on the PCU below.&lt;/p&gt; &lt;div class=&quot;embed-responsive embed-responsive-16by9&quot;&gt; &lt;iframe src=&quot;about:blank&quot; allowfullscreen=&quot;allowFullScreen&quot; frameborder=&quot;0&quot; class=&quot;lazyload embed-responsive-item&quot; data-src=&quot; https://youtube.com/embed/zQTMo0EkmLI&quot;&gt;&lt;/iframe&gt; &lt;/div&gt; &lt;hr /&gt; &lt;h1 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h1&gt; &lt;p&gt;In this first look at the &lt;em&gt;arm-autonomy&lt;/em&gt; layer we have shown how to build the stack for AutoCore’s PCU and the way to start the Xen hypervisor, dom0 and domU within the board.&lt;/p&gt; &lt;p&gt;We are now ready to build on top of this and we will look at deploying ROS2 into the guest VM in the next blog, this way we will have all the components that we need to integrate Autoware.Auto to run in a guest VM handled by the Xen hypervisor, so keep an eye to this space.&lt;/p&gt; </description> <pubDate>Fri, 07 Aug 2020 01:00:00 +0000</pubDate> <link>https://www.96boards.org/blog/arm_autonomy_pcu_1/</link> <guid isPermaLink="true">https://www.96boards.org/blog/arm_autonomy_pcu_1/</guid> <category>64-bit,</category> <category>96Boards,</category> <category>aarch64,</category> <category>ARM,</category> <category>ARMv8,</category> <category>Consumer</category> <category>Edition,</category> <category>Linaro,</category> <category>Linux,</category> <category>arm64,</category> <category>real</category> <category>time,</category> <category>ROS2,</category> <category>Autoware,</category> <category>AutoCore,</category> <category>PCU,</category> <category>arm-autonomy</category> <category>blog</category> </item> <item> <title>OpenGLES 3 Demo on the Rock960 running Panfrost drivers</title> <description>&lt;p&gt;Hi all,&lt;/p&gt; &lt;p&gt;Just a quick blog showing OpenGLES 3 applications now running on the Rock960 using the Panfrost GPU drivers.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;A Quick Recap on Panfrost:&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;a href=&quot;https://panfrost.freedesktop.org/&quot;&gt;Panfrost&lt;/a&gt; is a free and open source driver for Mali Midgard and Bifrost GPUs.&lt;/p&gt; &lt;p&gt;The driver is capable of running a few demos and has been upstream to Mesa &amp;amp; Linux (currently in linux-next). It has been tested on Rockchip RK3288/R3399, and Amlogic S912 with the Arm Mali-T764, Arm Mali-T864, and Arm Mali-T820MP3 GPUs respectively.&lt;/p&gt; &lt;p&gt;For more details you can look at &lt;a href=&quot;https://www.96boards.org/blog/panfrost-rock960/&quot;&gt;one of my previous blog&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;A Status Update on Panfrost’s Accessability&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;As of now, many Linux distributions like Fedora, Arch etc already build and use Panfrost based mesa drivers for compatible GPUs, provided that the SBC’s device-tree has it enabled upstream.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;GLES 3 Demo: SuperTuxKart&lt;/strong&gt;&lt;/p&gt; &lt;div class=&quot;embed-responsive embed-responsive-16by9&quot;&gt; &lt;iframe src=&quot;about:blank&quot; allowfullscreen=&quot;allowFullScreen&quot; frameborder=&quot;0&quot; class=&quot;lazyload embed-responsive-item&quot; data-src=&quot; https://youtube.com/embed/1w7rboTZmvw&quot;&gt;&lt;/iframe&gt; &lt;/div&gt; </description> <pubDate>Wed, 27 May 2020 01:00:00 +0000</pubDate> <link>https://www.96boards.org/blog/opengles3-panfrost-rock960/</link> <guid isPermaLink="true">https://www.96boards.org/blog/opengles3-panfrost-rock960/</guid> <category>64-bit,</category> <category>96Boards,</category> <category>aarch64,</category> <category>ARM,</category> <category>ARMv8,</category> <category>Consumer</category> <category>Edition,</category> <category>rock960,</category> <category>Linaro,</category> <category>Linux,</category> <category>arm64,</category> <category>panfrost,</category> <category>gpu,</category> <category>open-source,</category> <category>mali</category> <category>blog</category> </item> <item> <title>AeroCore2 | Zephyr Porting and Upstreaming Efforts</title> <description>&lt;h1 id=&quot;introduction&quot;&gt;Introduction&lt;/h1&gt; &lt;p&gt;This Blog will summarize the recent porting efforts for the AeroCore2 Mezzanine in Zephyr RTOS.&lt;/p&gt; &lt;h2 id=&quot;aerocore-2&quot;&gt;AeroCore 2&lt;/h2&gt; &lt;p&gt;The &lt;a href=&quot;https://www.96boards.org/product/aerocore2/&quot;&gt;AreoCore 2&lt;/a&gt; for 96Boards provides MAV control to 96Boards compliant platforms. With an ARM Cortex-M4 microcontroller, STM32F427VIT6, running NuttX RTOS and an integrated connection to the connected 96Boards device, AeroCore 2 gives users a complete Linux installation on a PX4-compatible platform.&lt;/p&gt; &lt;h2 id=&quot;why-port-to-zephyr-rtos&quot;&gt;Why Port to Zephyr RTOS?&lt;/h2&gt; &lt;p&gt;The AeroCore2 by default runs the NuttX RTOS with the PX4 autopilot stack on top. The last supported verion that this board runs is 1.8.2 since the PX4 autopilot out-grew the capabilities of the MCU. And at the time of writing this blog, the latest verion is 1.10.&lt;/p&gt; &lt;p&gt;So as it stands, this board does not have an up-to-date RTOS stack avilable. And that is the reason why I wanted to add this board to zephyr as it had a pretty decent MCU and a lot of life left.&lt;/p&gt; &lt;h1 id=&quot;porting&quot;&gt;Porting&lt;/h1&gt; &lt;h2 id=&quot;the-pitfalls-and-challenges&quot;&gt;The pitfalls and challenges&lt;/h2&gt; &lt;h3 id=&quot;documentation&quot;&gt;Documentation:&lt;/h3&gt; &lt;p&gt;… Or lack thereoff. This board was created by &lt;a href=&quot;https://www.gumstix.com/&quot;&gt;Gumstix&lt;/a&gt; using their &lt;a href=&quot;https://www.gumstix.com/geppetto/&quot;&gt;Geppetto&lt;/a&gt; which is a “Drag-and-Drop” level of EDA. Because of the astonishingly high level of automation from design to manufacturing, there isn’t any “human readable” for of schematics that we can follow.&lt;/p&gt; &lt;p&gt;This made for a fair bit of pcb tracing, making sense of the automated documentation and even following the NuttX commits with regards to the Aerocore2. Not the easiest thing for your first try at upstreaming a board.&lt;/p&gt; &lt;h3 id=&quot;constant-changes-in-zephyr-source&quot;&gt;Constant changes in Zephyr Source&lt;/h3&gt; &lt;p&gt;Since the time I sent out my &lt;a href=&quot;https://github.com/zephyrproject-rtos/zephyr/pull/22095&quot;&gt;initial Pull Request&lt;/a&gt; the Zephyr RTOS repository has gone through a lot of changes on how it handles SoCs and Devices at build time, moving from KConfig to Device Tree.&lt;/p&gt; &lt;p&gt;This resulted in the PR being re-submitted multiple times and took about 4 months (O_o) to get merged.&lt;/p&gt; &lt;h3 id=&quot;changelog&quot;&gt;Changelog&lt;/h3&gt; &lt;ul&gt; &lt;li&gt;Added all required board files in /boards/arm/96b_aerocore2&lt;/li&gt; &lt;li&gt;Modified pinmux for stm32f4&lt;/li&gt; &lt;li&gt;Add stm32f427 support based on previous work done for the stm32f429.&lt;/li&gt; &lt;li&gt;Rework current stm32f429 implementation to now be based on stm32f427.&lt;/li&gt; &lt;li&gt;Introduce dedicated dtsi for the VI variant of both stm32f427 and stm32f429. This is done to prevent stm32f4.dtsi from being included twice.&lt;/li&gt; &lt;/ul&gt; &lt;h3 id=&quot;what-works-and-what-doesnt&quot;&gt;What Works and What Doesn’t&lt;/h3&gt; &lt;p&gt;Pretty much everything broken out from the STM32 MCU works and is enabled. Better question may be what doesn’t work?&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Most of the sensors: &lt;ul&gt; &lt;li&gt;Sadly most sensors on-board the aerocore2 don’t have a driver in the Zephyr Source tree and hence were out-of-scope for this pull request.&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li&gt;PWM Input: Most drone controller boards have a PWM-in header for controller input, Zephyr at the moment doesn’t have a mechanism to do this.&lt;/li&gt; &lt;/ul&gt; &lt;hr /&gt; &lt;h1 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h1&gt; &lt;p&gt;At the end, I’d like to thank the maintainers of the Zephyr RTOS project and Gumstix for helping out along the way.&lt;/p&gt; &lt;p&gt;You can check out the Aerocore2’s Dedicated page at Zephyr RTOS at: &lt;a href=&quot;https://docs.zephyrproject.org/latest/boards/arm/96b_aerocore2/doc/index.html&quot;&gt;https://docs.zephyrproject.org/latest/boards/arm/96b_aerocore2/doc/index.html&lt;/a&gt;&lt;/p&gt; </description> <pubDate>Wed, 20 May 2020 01:00:00 +0000</pubDate> <link>https://www.96boards.org/blog/aerocore2-upstreaming/</link> <guid isPermaLink="true">https://www.96boards.org/blog/aerocore2-upstreaming/</guid> <category>64-bit,</category> <category>96Boards,</category> <category>aarch64,</category> <category>ARM,</category> <category>gumstix,</category> <category>Mezzanine</category> <category>Edition,</category> <category>stm32,</category> <category>Linaro,</category> <category>zephyr,</category> <category>cortex-m,</category> <category>aerocore2</category> <category>blog</category> </item> <item> <title>96boards: Autoware everywhere | First look at AutoCore's PCU</title> <description>&lt;h1 id=&quot;introduction&quot;&gt;Introduction&lt;/h1&gt; &lt;p&gt;We are back with a new entry of our “96boards: Autoware everywhere” blog series. In previous entries we showed how to run a subset of Autoware’s features due to hardware limitations, but thanks to &lt;a href=&quot;https://www.autocore.ai/&quot;&gt;AutoCore&lt;/a&gt; we are now able to run Autoware on their &lt;a href=&quot;https://github.com/autocore-ai/autocore_pcu_doc&quot;&gt;Perception Computing Unit (PCU)&lt;/a&gt;, the first heterogeneous hardware platform of the &lt;a href=&quot;https://www.autoware.io/&quot;&gt;Autoware.IO&lt;/a&gt; project.&lt;/p&gt; &lt;p&gt;In this first post regarding the PCU we will look at the steps we need to take for our initial setup of the board and how to get Cylone DDS installed and set up to be the default DDS for ROS2.&lt;/p&gt; &lt;p&gt;This post is organized as follows:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href=&quot;#autocores-pcu&quot;&gt;AutoCore’s PCU&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#pcu-setup&quot;&gt;PCU Setup&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#getting-the-pre-built-image&quot;&gt;Getting the pre-built image&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;#getting-cyclone-dds&quot;&gt;Getting Cyclone DDS&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;hr /&gt; &lt;h2 id=&quot;autocores-pcu&quot;&gt;AutoCore’s PCU&lt;/h2&gt; &lt;p&gt;AutoCore announced their PCU publicly on January 21&lt;sup&gt;st&lt;/sup&gt; through &lt;a href=&quot;https://discourse.ros.org/t/open-source-and-free-software-for-autocores-pcu/12418&quot;&gt;this ROS Discourse post&lt;/a&gt;. The PCU is the first reference design of the &lt;a href=&quot;https://www.autoware.io/&quot;&gt;Autoware.IO&lt;/a&gt; project.&lt;/p&gt; &lt;p&gt;A full description of the PCU specification can be found &lt;a href=&quot;https://github.com/autocore-ai/autocore_pcu_doc/blob/master/docs/Pcu_specification.md&quot;&gt;here&lt;/a&gt;. As a summary, it features a heterogeneous architecture with a lock-step MCU and a high performance MPU. Based on the MCU-MPU architecture, different ADAS/AD or relevant functions can be integrated with different functional safety levels up to ASIL D after ISO 26262. A wide variety of interfaces are provided to support vehicle networks connection, sensors and peripherals. Furthermore, additional hardware accelerator could be connected via PCIe to provide additional computing power.&lt;/p&gt; &lt;p&gt;The video below from AutoCore shows a car fitted with the PCU performing some autonomous maneuvers.&lt;/p&gt; &lt;div class=&quot;embed-responsive embed-responsive-16by9&quot;&gt; &lt;iframe src=&quot;about:blank&quot; allowfullscreen=&quot;allowFullScreen&quot; frameborder=&quot;0&quot; class=&quot;lazyload embed-responsive-item&quot; data-src=&quot;https://youtube.com/embed/UrHaz6Qku0g&quot;&gt;&lt;/iframe&gt; &lt;/div&gt; &lt;h2 id=&quot;pcu-setup&quot;&gt;PCU setup&lt;/h2&gt; &lt;p&gt;The image below shows the back of the PCU. As we are booting using a micro SD card we have shorted pins 2-3 in jumpers 1, 2 and 3, as explained in the &lt;a href=&quot;https://github.com/autocore-ai/autocore_pcu_doc/blob/master/docs/Pcu_hardware_manual.md#jmp-1-3&quot;&gt;PCU Hardware manual&lt;/a&gt;. &lt;strong&gt;Note&lt;/strong&gt; for shorting the pins we have used 2.54mm jumper cap shunts.&lt;/p&gt; &lt;p&gt;&lt;img src=&quot;/assets/images/blog/pcu_back.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt; &lt;h2 id=&quot;getting-the-pre-built-image&quot;&gt;Getting the pre-built image&lt;/h2&gt; &lt;p&gt;AutoCore provides a set of software packages for our development on the PCU. The &lt;a href=&quot;https://github.com/autocore-ai/autocore_pcu_doc/blob/master/docs/Resource_download.md#mpu-images&quot;&gt;AutoCore Resource page&lt;/a&gt; lists all the available components to get the most out of our PCU. At the time of writing, the latest release package is &lt;code class=&quot;highlighter-rouge&quot;&gt;20200417&lt;/code&gt;. For the purpose of this first post we will download the &lt;em&gt;MPU Image&lt;/em&gt;, and we will look at the rest of components in the next post.&lt;/p&gt; &lt;p&gt;We can use &lt;a href=&quot;https://www.balena.io/etcher/&quot;&gt;balenaEtcher&lt;/a&gt; as AutoCore suggests to flash our SD card with the downloaded image.&lt;/p&gt; &lt;p&gt;To log into the image we can use any of the following username/password combinations: &lt;code class=&quot;highlighter-rouge&quot;&gt;user&lt;/code&gt;/&lt;code class=&quot;highlighter-rouge&quot;&gt;user&lt;/code&gt; or &lt;code class=&quot;highlighter-rouge&quot;&gt;root&lt;/code&gt;/&lt;code class=&quot;highlighter-rouge&quot;&gt;root&lt;/code&gt;.&lt;/p&gt; &lt;p&gt;Once we log in we can see that AutoCore’s image provides a full installation of ROS Melodic and ROS2 Dashing ready to be used:&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;user@localhost:~$ ls /opt/ros/ dashing melodic &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;In addition, Docker is installed by default so we could directly go ahead and pull the pre-compiled arm64v8 Autoware.AI image from &lt;a href=&quot;https://hub.docker.com/r/autoware/arm64v8/tags&quot;&gt;autoware/arm64v8 Dockerhub repository&lt;/a&gt; or an Autoware.Auto image from our &lt;a href=&quot;https://hub.docker.com/repository/docker/96boards/autoware&quot;&gt;96boards/autoware&lt;/a&gt; Dockerhub repository.&lt;/p&gt; &lt;h2 id=&quot;getting-cyclone-dds&quot;&gt;Getting Cyclone DDS&lt;/h2&gt; &lt;p&gt;We have 2 options for getting Cyclone DDS into our PCU. If we connect the PCU to the internet we can simply &lt;code class=&quot;highlighter-rouge&quot;&gt;ssh&lt;/code&gt; into the board and install Cyclone DDS via:&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ apt install ros-dashing-rmw-cyclonedds-cpp &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;Otherwise we can add the source code to the SD card after flashing AutoCore’s image and build it locally on the board afterwards. In order to do so:&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ cd /path/to/rootfs/mount-point/rootfs/home/user/ $ mkdir -p ros2_cyclonedds/src $ git clone https://github.com/ros2/rmw_cyclonedds -b dashing-eloquent $ git clone https://github.com/eclipse-cyclonedds/cyclonedds -b V0.5.0 &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;The steps above will get a compatible version of CycloneDDS with ROS2 Dashing. Once we log into the PCU we need to change the owner of the folder we created earlier and compile CycloneDDS:&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ sudo chown -R $USER ros2_cyclonedds $ source /opt/ros/dashing/local_setup.bash $ cd ros2_cyclonedds $ colcon build &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;To set it to be the default DDS we can add the following to the &lt;code class=&quot;highlighter-rouge&quot;&gt;bashrc&lt;/code&gt; file:&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ echo &quot;export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp&quot; &amp;gt;&amp;gt; ~/.bashrc $ source ~./bashrc &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;In addition, if we have built CycloneDDS from source we will need to overlay our CycloneDDS workspace after sourcing ROS2 or, if we want it to be sourced by default when logging into the PCU:&lt;/p&gt; &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ echo &quot;source /opt/ros/dashing/local_setup.bash&quot; &amp;gt;&amp;gt; ~/.bashrc $ echo &quot;source /home/user/ros2_cyclonedds/install/local_setup.bash&quot; &amp;gt;&amp;gt; ~/.bashrc $ source ~./bashrc &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;hr /&gt; &lt;h1 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h1&gt; &lt;p&gt;In this first look at AutoCore’s PCU we have just prepared the board to run Autoware and set up Cyclone DDS as the default one for ROS2 and Autoware.Auto.&lt;/p&gt; &lt;p&gt;Next time, we will use some of the available software packages from AutoCore for our Autoware development, so keep an eye to this space.&lt;/p&gt; </description> <pubDate>Mon, 11 May 2020 01:00:00 +0000</pubDate> <link>https://www.96boards.org/blog/autocore_pcu_1/</link> <guid isPermaLink="true">https://www.96boards.org/blog/autocore_pcu_1/</guid> <category>64-bit,</category> <category>96Boards,</category> <category>aarch64,</category> <category>ARM,</category> <category>ARMv8,</category> <category>Consumer</category> <category>Edition,</category> <category>Linaro,</category> <category>Linux,</category> <category>arm64,</category> <category>real</category> <category>time,</category> <category>ROS2,</category> <category>Autoware,</category> <category>AutoCore,</category> <category>PCU</category> <category>blog</category> </item> </channel> </rss>