Skip to content

Commit

Permalink
Merge pull request #4 from charleneleong-ai/feat/big_t_post
Browse files Browse the repository at this point in the history
feat: clean
  • Loading branch information
charleneleong-ai authored May 30, 2024
2 parents c830196 + 477f540 commit 4366761
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 23 deletions.
2 changes: 1 addition & 1 deletion _site/blog/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ <h5 class="quarto-listing-category-title">Categories</h5><div class="quarto-list

<div class="quarto-listing quarto-listing-container-default" id="listing-listing">
<div class="list quarto-listing-default">
<div class="quarto-post image-right" data-index="0" data-categories="state space models,s4,mamba,sequence models,long range,modelling" data-listing-date-sort="1715558400000" data-listing-file-modified-sort="1716939327504" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="28" data-listing-word-count-sort="5573">
<div class="quarto-post image-right" data-index="0" data-categories="state space models,s4,mamba,sequence models,long range,modelling" data-listing-date-sort="1715558400000" data-listing-file-modified-sort="1716962069058" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="28" data-listing-word-count-sort="5583">
<div class="thumbnail">
<p><a href="../blog/posts/mamba/index.html" class="no-external"></a></p><a href="../blog/posts/mamba/index.html" class="no-external">
<p><img src="../blog/posts/mamba/feature.gif" class="thumbnail-image"></p>
Expand Down
2 changes: 1 addition & 1 deletion _site/blog/posts/mamba/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1843,7 +1843,7 @@ <h1 data-number="5"><span class="header-section-number">5</span> References</h1>
<input type="hidden" id="giscus-base-theme" value="light_high_contrast">
<input type="hidden" id="giscus-alt-theme" value="dark_dimmed">
</div> <!-- /content -->
<script>var lightboxQuarto = GLightbox({"closeEffect":"zoom","openEffect":"zoom","descPosition":"bottom","selector":".lightbox","loop":false});
<script>var lightboxQuarto = GLightbox({"openEffect":"zoom","selector":".lightbox","loop":false,"descPosition":"bottom","closeEffect":"zoom"});
window.onload = () => {
lightboxQuarto.on('slide_before_load', (data) => {
const { slideIndex, slideNode, slideConfig, player, trigger } = data;
Expand Down
2 changes: 1 addition & 1 deletion _site/projects/index-python.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
<atom:link href="https://www.ai-intuition.com/projects/index-python.xml" rel="self" type="application/rss+xml"/>
<description></description>
<generator>quarto-1.4.554</generator>
<lastBuildDate>Fri, 24 May 2024 06:41:47 GMT</lastBuildDate>
<lastBuildDate>Thu, 30 May 2024 01:42:01 GMT</lastBuildDate>
</channel>
</rss>
4 changes: 2 additions & 2 deletions _site/projects/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ <h5 class="quarto-listing-category-title">Categories</h5><div class="quarto-list
</div>
</div>
<div class="list grid quarto-listing-cols-3">
<div class="g-col-1" data-index="0" data-categories="robotics,control,navigation,ros" data-listing-date-sort="1715558400000" data-listing-file-modified-sort="1716531149801" data-listing-date-modified-sort="1716531149000" data-listing-reading-time-sort="10" data-listing-word-count-sort="1839">
<div class="g-col-1" data-index="0" data-categories="robotics,control,navigation,ros" data-listing-date-sort="1715558400000" data-listing-file-modified-sort="1717033313627" data-listing-date-modified-sort="1717033313000" data-listing-reading-time-sort="10" data-listing-word-count-sort="1839">
<a href="../projects/posts/bigT_ros_control/index.html" class="quarto-grid-link">
<div class="quarto-grid-item card h-100 card-left">
<p class="card-img-top"><img src="posts/bigT_ros_control/feature.gif" style="height: 150px;" class="thumbnail-image card-img"/></p>
Expand All @@ -265,7 +265,7 @@ <h5 class="no-anchor card-title listing-title">
</div>
<div class="card-footer">
<div class="card-file-modified listing-file-modified">
<p>May 24, 2024</p>
<p>May 30, 2024</p>
</div>
</div>
</div>
Expand Down
21 changes: 14 additions & 7 deletions _site/projects/posts/bigT_ros_control/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ <h1 class="title">ROS Navigation and Control for a Triangular Holonomic Robot</h
<div>
<div class="quarto-title-meta-heading">Modified</div>
<div class="quarto-title-meta-contents">
<p class="date-modified">May 24, 2024</p>
<p class="date-modified">May 30, 2024</p>
</div>
</div>

Expand Down Expand Up @@ -329,7 +329,14 @@ <h1 data-number="4"><span class="header-section-number">4</span> Control Algorit
<section id="imports-and-global-variables" class="level2" data-number="4.1">
<h2 data-number="4.1" class="anchored" data-anchor-id="imports-and-global-variables"><span class="header-section-number">4.1</span> Imports and Global Variables</h2>
<p>We first import our initial <code>C++</code> <code>ROS</code> headers and instantiate our global variables from the robot’s physical characteristics.</p>
<p>We include the following headers - [<code>ros/ros.h</code>] to include too headers necessary to use the most common public pieces of the ROS system. - <a href="http://docs.ros.org/en/kinetic/api/geometry_msgs/html/msg/Twist.html"><code>geometry_msgs/Twist.h</code></a> to publish linear and angular velocities to facilitate interoperability throughout the system. - <a href="http://docs.ros.org/en/kinetic/api/geometry_msgs/html/msg/Quaternion.html"><code>geometry_msgs/Quaternion.h</code></a> to publish orientation in quarternion form. - <a href="http://docs.ros.org/en/kinetic/api/sensor_msgs/html/msg/Imu.html"><code>sensor_msgs/Imu.h</code></a> to collect sensor data message type from the IMU. The IMU node <a href="http://wiki.ros.org/razor_imu_9do"><code>razor_imu_9dof</code></a> publishes messages to the <code>"imu"</code> topic in the ROS system to be used by motion and planning algorithms such as this <a href="http://wiki.ros.org/robot_pose_ekf"><code>robot_pose_ekf</code></a>. - <a href="https://cplusplus.com/reference/cmath/"><code>math.h</code></a> to perform common mathmetical operations and transformations.</p>
<p>We include the following headers:</p>
<ul>
<li>[<code>ros/ros.h</code>] to include too headers necessary to use the most common public pieces of the ROS system.</li>
<li><a href="http://docs.ros.org/en/kinetic/api/geometry_msgs/html/msg/Twist.html"><code>geometry_msgs/Twist.h</code></a> to publish linear and angular velocities to facilitate interoperability throughout the system.</li>
<li><a href="http://docs.ros.org/en/kinetic/api/geometry_msgs/html/msg/Quaternion.html"><code>geometry_msgs/Quaternion.h</code></a> to publish orientation in quarternion form.</li>
<li><a href="http://docs.ros.org/en/kinetic/api/sensor_msgs/html/msg/Imu.html"><code>sensor_msgs/Imu.h</code></a> to collect sensor data message type from the IMU. The IMU node <a href="http://wiki.ros.org/razor_imu_9do"><code>razor_imu_9dof</code></a> publishes messages to the <code>"imu"</code> topic in the ROS system to be used by motion and planning algorithms such as this <a href="http://wiki.ros.org/robot_pose_ekf"><code>robot_pose_ekf</code></a>.</li>
<li><a href="https://cplusplus.com/reference/cmath/"><code>math.h</code></a> to perform common mathmetical operations and transformations.</li>
</ul>
<p>We then declare our ROS publishers <code>motor_control_pub</code> to publish the motor control signal to the wheels and <code>imu_pub</code> to publish and update the robot’s orientation.</p>
<div data-add-from="control.cpp" data-start-line="1" data-end-line="18" data-code-line-numbers="true">
<div class="sourceCode cell-code" id="cb1" data-startfrom="1"><pre class="sourceCode numberSource cpp number-lines code-with-copy"><code class="sourceCode cpp"><span id="cb1-1"><a href="#cb1-1"></a><span class="pp">#include </span><span class="im">"ros/ros.h"</span></span>
Expand Down Expand Up @@ -527,18 +534,18 @@ <h2 data-number="4.4" class="anchored" data-anchor-id="deriving-the-kinematic-eq
\omega_2 = \frac{1}{r} ( \frac{\cos(\theta) v_y}{3} - \frac{\sin(\theta) v_x}{3} + \frac{\sqrt{3} \sin(\theta) v_y}{3} + \frac{\sqrt{3} \cos(\theta) v_x}{3} + \omega_{\text{body}} h )
\]</span></p>
<p><span class="math display">\[
\omega_3 = \frac{1}{r} ( -\frac{\sqrt{3} \sin(\theta) v_y}{3} + \frac{\cos(\theta) v_y}{3} - \frac{\sqrt{3} \cos(\theta) v_x}{3} - \frac{\sin(\theta) v_x}{3} + \omega_{\text{body}} * h )
\omega_3 = \frac{1}{r} ( -\frac{\sqrt{3} \sin(\theta) v_y}{3} + \frac{\cos(\theta) v_y}{3} - \frac{\sqrt{3} \cos(\theta) v_x}{3} - \frac{\sin(\theta) v_x}{3} + \omega_{\text{body}} h )
\]</span></p>
<p>These equations relate the global motion commands (<span class="math inline">\(v_x\)</span>, <span class="math inline">\(v_y\)</span>, <span class="math inline">\(\omega_{\text{body}}\)</span>) to the angular velocities of the three wheels (<span class="math inline">\(\omega_1\)</span>, <span class="math inline">\(\omega_2\)</span>, <span class="math inline">\(\omega_3\)</span>) taking into account the robot’s orientation <span class="math inline">\(\theta\)</span>, wheel radius <span class="math inline">\(r\)</span> and distance from center to the wheels <span class="math inline">\(h\)</span>.</p>
</section>
<section id="converting-angular-velocities-to-pwm-signal-for-motor-control" class="level2" data-number="4.5">
<h2 data-number="4.5" class="anchored" data-anchor-id="converting-angular-velocities-to-pwm-signal-for-motor-control"><span class="header-section-number">4.5</span> Converting angular velocities to PWM signal for motor control</h2>
<p>After we’ve calculated the angular velocities in terms on radians per second (<span class="math inline">\(rad/s\)</span>), we have to convert to a Pulse Width Modulation (PWM) signal to send updated speed and direction to the motors.</p>
<p><strong>1. Angular Velocity to RPM</strong></p>
<p>We first convert angular velocity (in radians per second) to revolutions per minute (RPM).</p>
<p>We know that <span class="math inline">\(1 revolution=2\pi radians\)</span> and <span class="math inline">\(1 minute = 60 seconds\)</span>, therefore, the conversion factor is:</p>
<p>We first convert angular velocity (<span class="math inline">\(rad/s\)</span>) to revolutions per minute (RPM).</p>
<p>We know that <span class="math inline">\(1 \space revolution=2\pi \space radians\)</span> and <span class="math inline">\(1 \space minute = 60 \space seconds\)</span>, therefore, the conversion factor is:</p>
<p><span class="math display">\[
RPM = \omega\times(60/(2\pi)) \approx \omega\times 9.5493 \approx \omega\times 9.55
RPM = \omega\times(60/2\pi) \approx \omega\times 9.5493 \approx \omega\times 9.55
\]</span></p>
<p><strong>2. Conversion from RPM to PWM</strong></p>
<p>In order to measure and calibrate the relationship betwen PWM and RPM for the motor, an empirical experiment was performed in order to collect measurements and fit a linear regression model to the data.</p>
Expand Down Expand Up @@ -1046,7 +1053,7 @@ <h2 data-number="4.5" class="anchored" data-anchor-id="converting-angular-veloci
<input type="hidden" id="giscus-base-theme" value="light_high_contrast">
<input type="hidden" id="giscus-alt-theme" value="dark_dimmed">
</div> <!-- /content -->
<script>var lightboxQuarto = GLightbox({"openEffect":"zoom","descPosition":"bottom","selector":".lightbox","loop":false,"closeEffect":"zoom"});
<script>var lightboxQuarto = GLightbox({"loop":false,"descPosition":"bottom","selector":".lightbox","openEffect":"zoom","closeEffect":"zoom"});
window.onload = () => {
lightboxQuarto.on('slide_before_load', (data) => {
const { slideIndex, slideNode, slideConfig, player, trigger } = data;
Expand Down
Loading

0 comments on commit 4366761

Please sign in to comment.