<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: jishnu </title>
    <description>The latest articles on Forem by jishnu  (@lonebots).</description>
    <link>https://forem.com/lonebots</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F356651%2F09737847-7176-434d-8d58-6111690651ce.png</url>
      <title>Forem: jishnu </title>
      <link>https://forem.com/lonebots</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/lonebots"/>
    <language>en</language>
    <item>
      <title>Seamless Robotics Integration: Setting Up micro-ROS on ESP32</title>
      <dc:creator>jishnu </dc:creator>
      <pubDate>Mon, 12 Jun 2023 18:18:34 +0000</pubDate>
      <link>https://forem.com/lonebots/seamless-robotics-integration-setting-up-micro-ros-on-esp32-2ad2</link>
      <guid>https://forem.com/lonebots/seamless-robotics-integration-setting-up-micro-ros-on-esp32-2ad2</guid>
      <description>&lt;p&gt;Let's get the job done. Setting up micro-ROS on resource-constrained edge computing systems like ESP32 was a tedious job for me, which made me think of writing a blog to make it easy. So in this article, we will be mainly discussing some basics of ROS, micro-ROS and how to get it working within a robotic system.&lt;/p&gt;

&lt;p&gt;ROS(Robot Operating System) or presently its new version ROS 2 is an open-source framework that eases the process of building a robot. It provides libraries, packages, and message-passing systems which act as an abstraction above underlying operating systems like Linux or Windows (currently ROS is not supported on Mac).&lt;/p&gt;

&lt;p&gt;Simulations always go along with ROS and but how we can connect real-world sensors to these simulated environments, there come micro ROS. Most edge computing systems are highly resource constrained, thus we need some highly resource-optimized library that bridges the gap between high computing devices and these MCUs.&lt;/p&gt;

&lt;p&gt;micro-ROS is a simple miniaturized version of ROS client API that runs on MCU, over an RTOS (Real Time Operating System) and supports all of the ROS concepts. It helps in the easy integration of microcontrollers with the robotics system. Now, let's get into the installation.&lt;/p&gt;

&lt;p&gt;Installation&lt;/p&gt;

&lt;p&gt;ROS 2 Humble Installation :&lt;/p&gt;

&lt;p&gt;ROS 2 humble has nice documentation, which will help you install the same with simple steps. You can follow the documentation over here. I am using Ubuntu 22.04 LTS version for this installation. You can try out some examples to get familiarised with different ROS concepts.&lt;/p&gt;

&lt;p&gt;ESP IDF Installation :&lt;/p&gt;

&lt;p&gt;It is the official development framework for the ESP32 and ESP32-s series of SoCs, and the installation is fairly simple following their official documentation over here.&lt;/p&gt;

&lt;p&gt;We can also install it as a simple VScode extension, which I will recommend since it is fairly simple and less time-consuming.&lt;/p&gt;

&lt;p&gt;micro-ROS installation :&lt;/p&gt;

&lt;p&gt;Build system installation :&lt;/p&gt;

&lt;p&gt;MicroROS build system can be installed easily by following the below steps;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Source the ROS 2 installation
source /opt/ros/$ROS_DISTRO/setup.bash

# Create a workspace and download the micro-ROS tools
mkdir microros_ws
cd microros_ws
git clone -b $ROS_DISTRO https://github.com/micro-ROS/micro_ros_setup.git src/micro_ros_setup

# Update dependencies using rosdep
sudo apt update &amp;amp;&amp;amp; rosdep update
rosdep install --from-path src --ignore-src -y 

# Install pip
sudo apt-get install python3-pip

# Build micro-ROS tools and source them
colcon build
source install/local_setup.bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Creating a firmware workspace :&lt;/p&gt;

&lt;p&gt;We need to create a firmware workspace, to proceed with the installation. this can be easily created using the micro_ros_setup tool package that we installed in the above step. On executing the below-given command a new folder named firmware is automatically created inside the microros_ws.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Create step
ros2 run micro_ros_setup create_firmware_ws.sh freertos esp32
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Micro-ROS currently supports three different RTOS, namely NuttX, FreeRTOS, and Zephyr. We can use any of these according to our needs, which can be found in the reference section.&lt;/p&gt;

&lt;p&gt;Configure firmware :&lt;/p&gt;

&lt;p&gt;We use the below command to configure the firmware we just created.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Configure step
ros2 run micro_ros_setup configure_firmware.sh [APP] [OPTIONS]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We will be using the precompiled, ping_pong app. and the possible options we have are given below&lt;/p&gt;

&lt;p&gt;The options available for this configuration step are:&lt;/p&gt;

&lt;p&gt;--transport or -t: udp, serial or any hardware-specific transport label&lt;/p&gt;

&lt;p&gt;--dev or -d: agent string descriptor in a serial-like transport&lt;/p&gt;

&lt;p&gt;--ip or -i: agent IP in a network-like transport&lt;/p&gt;

&lt;p&gt;--port or -p: agent port in a network-like transport&lt;/p&gt;

&lt;p&gt;Run the below command for our setup for the ping_pong app.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Configure step with ping_pong app and serial transport
ros2 run micro_ros_setup configure_firmware.sh ping_pong --transport serial
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can check the complete content of the ping_pong app here.&lt;/p&gt;

&lt;p&gt;Note: When using udp mode for transport*, the next build step may give you an error and follow this* issue on GitHub to rectify the error. You can use the menuconfig to configure the wifi connectivity for the board&lt;/p&gt;

&lt;p&gt;Build firmware :&lt;/p&gt;

&lt;p&gt;Run the below command to build the firmware.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ros2 run micro_ros_setup build_firmware.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The build process may take some time to complete and on successful completion ([100%] app build), we can proceed further.&lt;/p&gt;

&lt;p&gt;Flash firmware :&lt;/p&gt;

&lt;p&gt;Before moving to this step make sure you have connected the ESP32 module to the host machine and proceed to run the below command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ros2 run micro_ros_setup flash_firmware.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Setting up micro-ROS Agent&lt;/p&gt;

&lt;p&gt;Since the ping_pong app is flashed, now we need a micro-ROS agent for it to connect and start talking with the rest of the ROS 2 world. Running the agent helps in making the micro-ROS namespace available to the external ROS 2 system running on the host machine so they can communicate with each other. Follow the below steps to create, build and run the agent.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Download micro-ROS-Agent packages
ros2 run micro_ros_setup create_agent_ws.sh

# Build step
ros2 run micro_ros_setup build_agent.sh
source install/local_setup.bash

# Run a micro-ROS agent
ros2 run micro_ros_agent micro_ros_agent serial --dev [device]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note: In the last step, the [device] is the serial port to which the EPS32 is connected (eg: /dev/ttyUSB0), also this step varies with the type of transport we chose in the firmware configuration step&lt;/p&gt;

&lt;p&gt;Testing the micro-ROS app&lt;/p&gt;

&lt;p&gt;We may need to press the (EN) button to reset or disconnect and reconnect the ESP32 to establish the connection.&lt;/p&gt;

&lt;p&gt;Now, open a new terminal and check the ROS 2 topics and new topics, /microROS/ping and microROS/pong will be available. Subscribe to the topics using the following command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;source /opt/ros/$ROS_DISTRO/setup.bash

# Subscribe to micro-ROS ping topic
ros2 topic echo /microROS/ping
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see the topic messages published by the Ping Pong node every 5 seconds:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;user@user:~$ ros2 topic echo /microROS/ping
stamp:
  sec: 20
  nanosec: 867000000
frame_id: '1344887256_1085377743'
---
stamp:
  sec: 25
  nanosec: 942000000
frame_id: '730417256_1085377743'
---
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we know that the pings are getting published, we can check if it can answer someone else's pings (fake pings). For testing that, open a new terminal and subscribe to the /microROS/pong topic.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;source /opt/ros/$ROS_DISTRO/setup.bash

# Subscribe to micro-ROS pong topic
ros2 topic echo /microROS/pong
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The pong topic reacts when a ping message is manual send to the ping topic, now we can mimic this by sending a fake ping message using the below command, the changes will be seen within the terminal echoing /microROS/ping and /microROS/pong topics.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;source /opt/ros/$ROS_DISTRO/setup.bash

# Send a fake ping
ros2 topic pub --once /microROS/ping std_msgs/msg/Header '{frame_id: "fake_ping"}'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, we should see this fake_ping in the ping subscriber console, along with the board’s pings:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;user@user:~$ ros2 topic echo /microROS/ping
stamp:
  sec: 0
  nanosec: 0
frame_id: fake_ping
---
stamp:
  sec: 305
  nanosec: 973000000
frame_id: '451230256_1085377743'
---
stamp:
  sec: 310
  nanosec: 957000000
frame_id: '2084670932_1085377743'
---
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The following change will be seen in the pong subscriber console;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;user@user:~$ ros2 topic echo /microROS/pong
stamp:
  sec: 0
  nanosec: 0
frame_id: fake_ping
---
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That brings us to the end.&lt;br&gt;
TLDR; Here we have set up the micro-ROS app, flashed it to an ESP32 board, and tested it using a micro-ROS agent.&lt;/p&gt;

&lt;p&gt;Happy learning!&lt;/p&gt;

</description>
      <category>ros</category>
      <category>microros</category>
      <category>esp32</category>
      <category>robotics</category>
    </item>
    <item>
      <title>Getting Started with Machine Learning!</title>
      <dc:creator>jishnu </dc:creator>
      <pubDate>Mon, 02 Jan 2023 17:16:29 +0000</pubDate>
      <link>https://forem.com/lonebots/getting-started-with-machine-learning-1k2o</link>
      <guid>https://forem.com/lonebots/getting-started-with-machine-learning-1k2o</guid>
      <description>&lt;p&gt;     The word machine learning might instilled wonders in your mind like mine and for the past few months I was trying to unravel the mystery behind the black curtains. So let's get started and I will be taking you down through my experiences after I finally decided to learn something new.&lt;/p&gt;

&lt;p&gt;     Machine learning is one among the top disruptive technology for the future and with this good read you will be taking the baby steps to this entirely fascinating world.&lt;/p&gt;

&lt;p&gt;     As always we need to get the basics right first and then only we can build upon on that. The fundamental break down of the different areas connected with ML(abbreviation for Machine Learning) is provided in the below ven diagram. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F2su3qm7ebd5uiiis6dzz.png" class="article-body-image-wrapper"&gt;&lt;img alt="ml-ven-diagram" src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F2su3qm7ebd5uiiis6dzz.png" width="715" height="716"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;     I hope it makes some sense to you, even if not don't worry I didn't understand anything when I saw it for the first time. It shows how ML basically is related to the other big crowd pullers like AI(Artificial intelligence) and DL(Deep Learning). Here we can take DL as sub part of ML and together they both makes a part of the bigger AI. We also have many other areas like NLP,Image Recognition, Data Science which are totally beyond the scope of this discussion.&lt;/p&gt;

&lt;p&gt;     In the present day world, ML is of great importance and we make use of it solve very complex real life problems. With the help of enhancing computational power this area grows exponentially. We can find these technologies rooting in almost all sectors and sections of human life ranging from the basic smart phones to big spaceships and health, agriculture, military (many more).&lt;/p&gt;

&lt;p&gt;    ML is different from normal programming where in a computer generates the output for a certain input values according to the program that we feed on to it. But in ML the input and output for a specific scenario are given to the machine and it finds out valuable insights from those information, using which it trains the model based on many of the learning algorithms to predict outputs for an entirely new set of input data.&lt;/p&gt;

&lt;p&gt;     There are many algorithms to talk about, which we will be covering in future blogs. For this post we are sticking on to pure basics. Let me give you a scenario, consider you and 2 of your friends are going to buy icecream from a shop and the cost of icecream for different number of people are listed in a chart as given below&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcp6s65tkl9cdg6wweckg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcp6s65tkl9cdg6wweckg.png" alt="icecreacart-problem-visualisation" width="715" height="593"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;    Including you, it requires you to buy 3 icecream and that value is missing on the chart, human mind can easily calculate the rate for 3 icecream and we get Rs.30, this is because of the cognitive and mathematical ability that our mind posses or gains over our life, but computers or machines in itself do not have this ability or intelligence. So we have to make use of various methods which involves step by step learning of the scenario with the help of algorithms. Generally we call it the &lt;strong&gt;Learning algorithm&lt;/strong&gt; which enables the machine to learn and help us in prediction or classification. &lt;/p&gt;

&lt;p&gt;     From the above case we used a price chart initially which contains all the data we need, it becomes our &lt;strong&gt;Data set&lt;/strong&gt;(we have divisions within this data set, just keep in mind). The scenario explained here is a simple case of machine learning techniques called the &lt;strong&gt;Supervised learning&lt;/strong&gt;. It is a type of learning algorithm in which the initial learning datasets are provided by a human in order for the machine(program) to learn. Once the model learns via a process called &lt;strong&gt;training&lt;/strong&gt; (repetitive learning processes carried over the datasets) helps in predicting a future value which the machine doesn't know. This is mainly by forming certain relationships or patterns in the given input data.&lt;/p&gt;

&lt;p&gt;    tldr; To summarize, here we have seen a simple example(which you may find strange) of supervised learning. ML is not required for solving this problem but in real life complex problems replaces it. There are numerous learning techniques/methods and algorithms which we may cover in the future. Hope to write more and happy learning!&lt;/p&gt;

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