Firmware: Difference between revisions

From Distributed Autonomous and Networked Control Lab
Jump to navigation Jump to search
Jnoronha (talk | contribs)
m Added Navigation bar
 
Jnoronha (talk | contribs)
Added Firmware Log block examples
Line 1: Line 1:
Not much work has been done in the Firmware yet. (as of 7/20/16) The few things we have been able to successfully modify are:
#Creating New Log Blocks
#Modifying the Default Yaw Mode
#Adding and Modifying Parameter Values
==Log Blocks==
In the Crazyflie Firmware there is a generalized logging framework that allows us to make any group of variables into a log block. It makes things very easy to log. Here are a few examples:
:1. Magnometer Log Block (code found in ''Firmware > modules > src > stabilizer.c'')
<blockquote>
<code>
<pre>
LOG_GROUP_START(mag)
LOG_ADD(LOG_FLOAT, x, &mag.x)
LOG_ADD(LOG_FLOAT, y, &mag.y)
LOG_ADD(LOG_FLOAT, z, &mag.z)
LOG_GROUP_STOP(mag)
</pre>
</code>
</blockquote>
:So with this code we have created a log block called 'mag' and it contains the X, Y, and Z measurements from the magnetometer sensor.
:2. Accelerometer Log Block (code found in ''Firmware > modules > src > stabilizer.c'')
<blockquote>
<code>
<pre>
LOG_GROUP_START(acc)
LOG_ADD(LOG_FLOAT, x, &acc.x)
LOG_ADD(LOG_FLOAT, y, &acc.y)
LOG_ADD(LOG_FLOAT, z, &acc.z)
LOG_ADD(LOG_FLOAT, zw, &accWZ)
LOG_ADD(LOG_FLOAT, mag2, &accMAG)
LOG_GROUP_STOP(acc)
</pre>
</code>
</blockquote>
:So just like in the magnetometer block, here we have created a log group called 'acc' and inside this group we are logging the variables for the accelerometer's X, Y, and Z values as well as 2 other gravity based variables used for thrust compensation.
===Using New Log Blocks in Swarm Client===





Revision as of 16:04, 20 July 2016

Not much work has been done in the Firmware yet. (as of 7/20/16) The few things we have been able to successfully modify are:

  1. Creating New Log Blocks
  2. Modifying the Default Yaw Mode
  3. Adding and Modifying Parameter Values

Log Blocks

In the Crazyflie Firmware there is a generalized logging framework that allows us to make any group of variables into a log block. It makes things very easy to log. Here are a few examples:

1. Magnometer Log Block (code found in Firmware > modules > src > stabilizer.c)


LOG_GROUP_START(mag)
LOG_ADD(LOG_FLOAT, x, &mag.x)
LOG_ADD(LOG_FLOAT, y, &mag.y)
LOG_ADD(LOG_FLOAT, z, &mag.z)
LOG_GROUP_STOP(mag)

So with this code we have created a log block called 'mag' and it contains the X, Y, and Z measurements from the magnetometer sensor.
2. Accelerometer Log Block (code found in Firmware > modules > src > stabilizer.c)


LOG_GROUP_START(acc)
LOG_ADD(LOG_FLOAT, x, &acc.x)
LOG_ADD(LOG_FLOAT, y, &acc.y)
LOG_ADD(LOG_FLOAT, z, &acc.z)
LOG_ADD(LOG_FLOAT, zw, &accWZ)
LOG_ADD(LOG_FLOAT, mag2, &accMAG)
LOG_GROUP_STOP(acc)

So just like in the magnetometer block, here we have created a log group called 'acc' and inside this group we are logging the variables for the accelerometer's X, Y, and Z values as well as 2 other gravity based variables used for thrust compensation.

Using New Log Blocks in Swarm Client


Crazyflie Swarm | PC Client Software | USB Radio | Firmware