Skip to content

Commit 0c19ec1

Browse files
committed
Minor updates.
1 parent 5c05338 commit 0c19ec1

File tree

3 files changed

+25
-17
lines changed

3 files changed

+25
-17
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ __pycache__/
66
# C extensions
77
*.so
88

9+
codegen
10+
911
# Distribution / packaging
1012
.Python
1113
build/

IMU_Follower.m

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
function outputs = IMU_Follower(inputs)
2+
% IMU_Follower: A function that processes raw IMU accelerometer and
3+
% gyroscope data to calculate spatial rotation about the x axis.
4+
5+
% Author: Kevin Best
6+
% Date: August 28th, 2024
27
persistent fusion_filter
38
if isempty(fusion_filter)
49
fusion_filter = imufilter('SampleRate',100, 'ReferenceFrame','NED');
510
end
611
q = fusion_filter([inputs.accel.x, inputs.accel.y, inputs.accel.z], ...
712
[inputs.gyro.x, inputs.gyro.y, inputs.gyro.z]);
813
euler_angles = quat2eul(q);
9-
outputs.knee_angle_rad = max(min(euler_angles(3), pi/2), 0);
10-
end
14+
outputs.knee_angle_rad = max(min(euler_angles(3), 3*pi/4), 0);
15+
end
16+

IMU_Follower.prj

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<deployment-project plugin="plugin.coder" plugin-version="R2023a">
2-
<configuration build-checksum="2435049039" file="C:\Users\tkbest\Desktop\TestIMU\IMU_Follower.prj" location="C:\Users\tkbest\Desktop\TestIMU" name="IMU_Follower" target="target.unifiedcoder" target-name="MATLAB Coder">
2+
<configuration build-checksum="1735482036" file="C:\Users\tkbest\Documents\MATLAB_Python_IMU_Demo\IMU_Follower.prj" location="C:\Users\tkbest\Documents\MATLAB_Python_IMU_Demo" name="IMU_Follower" target="target.unifiedcoder" target-name="MATLAB Coder">
33
<profile key="profile.mex">
44
<param.BuiltInstrumentedMex />
55
<param.RanInstrumentedMex>false</param.RanInstrumentedMex>
@@ -11,15 +11,15 @@
1111
<var.SimdQueryHardwareVendor>Generic</var.SimdQueryHardwareVendor>
1212
<var.SimdQueryHardwareType>MATLAB Host Computer</var.SimdQueryHardwareType>
1313
<param.InstructionSetExtensionsAvailableInUI>false</param.InstructionSetExtensionsAvailableInUI>
14-
<param.ResponsivenessChecks>true</param.ResponsivenessChecks>
15-
<param.ExtrinsicCalls>true</param.ExtrinsicCalls>
16-
<param.IntegrityChecks>true</param.IntegrityChecks>
14+
<param.ResponsivenessChecks />
15+
<param.ExtrinsicCalls />
16+
<param.IntegrityChecks />
1717
<param.SaturateOnIntegerOverflow>true</param.SaturateOnIntegerOverflow>
1818
<param.EnableAutoParallelization>false</param.EnableAutoParallelization>
1919
<param.NumberOfCpuThreads>0</param.NumberOfCpuThreads>
2020
<param.OptimizeReductions>false</param.OptimizeReductions>
21-
<param.SIMDAcceleration>option.SIMDAcceleration.Portable</param.SIMDAcceleration>
22-
<param.GlobalDataSyncMethod>option.GlobalDataSyncMethod.SyncAlways</param.GlobalDataSyncMethod>
21+
<param.SIMDAcceleration />
22+
<param.GlobalDataSyncMethod />
2323
<param.EnableVariableSizing>true</param.EnableVariableSizing>
2424
<param.EnableDynamicMemoryAllocation>true</param.EnableDynamicMemoryAllocation>
2525
<param.DynamicMemoryAllocation>option.DynamicMemoryAllocation.Threshold</param.DynamicMemoryAllocation>
@@ -38,7 +38,7 @@
3838
<param.CodeFormattingTool>option.CodeFormattingTool.Auto</param.CodeFormattingTool>
3939
<param.ReservedNameArray />
4040
<param.CppStyleConst>true</param.CppStyleConst>
41-
<param.EnableDebugging>false</param.EnableDebugging>
41+
<param.EnableDebugging />
4242
<param.Verbosity>option.Verbosity.Info</param.Verbosity>
4343
<param.ReportPotentialDifferences>false</param.ReportPotentialDifferences>
4444
<param.GenerateReport>true</param.GenerateReport>
@@ -60,12 +60,12 @@
6060
<param.CustomSource />
6161
<param.CustomLibrary />
6262
<param.PostCodeGenCommand />
63-
<param.mex.GenCodeOnly>false</param.mex.GenCodeOnly>
63+
<param.mex.GenCodeOnly />
6464
<param.ConstantFoldingTimeout>40000</param.ConstantFoldingTimeout>
6565
<param.CompileTimeRecursionLimit>50</param.CompileTimeRecursionLimit>
6666
<param.EnableRuntimeRecursion>true</param.EnableRuntimeRecursion>
6767
<param.PreserveVariableNames>option.PreserveVariableNames.None</param.PreserveVariableNames>
68-
<param.EchoExpressions>true</param.EchoExpressions>
68+
<param.EchoExpressions />
6969
<param.InlineThreshold>10</param.InlineThreshold>
7070
<param.InlineThresholdMax>200</param.InlineThresholdMax>
7171
<param.InlineStackLimit>1000000</param.InlineStackLimit>
@@ -77,13 +77,13 @@
7777
<param.EnableOpenMP>true</param.EnableOpenMP>
7878
<param.InitFltsAndDblsToZero>true</param.InitFltsAndDblsToZero>
7979
<param.DefaultVariableInitialization>option.DefaultVariableInitialization.None</param.DefaultVariableInitialization>
80-
<param.ConstantInputs>option.ConstantInputs.CheckValues</param.ConstantInputs>
80+
<param.ConstantInputs />
8181
<param.EnableCRICodeCoverage>true</param.EnableCRICodeCoverage>
8282
<param.EnableAutoParallelizationReporting>true</param.EnableAutoParallelizationReporting>
8383
<param.CacheDynamicArrayDataPointer>true</param.CacheDynamicArrayDataPointer>
8484
<param.EnableJIT>false</param.EnableJIT>
8585
<param.EnableJITSilentBailOut />
86-
<param.CheckForIssuesJIT>true</param.CheckForIssuesJIT>
86+
<param.CheckForIssuesJIT />
8787
<param.EnableGitSupport>false</param.EnableGitSupport>
8888
<param.EnableAutoCommit>true</param.EnableAutoCommit>
8989
<param.RepositoryStyle>option.RepositoryStyle.Auto</param.RepositoryStyle>
@@ -622,12 +622,12 @@
622622
<param.hdlParamStorage />
623623
<var.gc.lastOutputRoot>codegen\dll\IMU_Follower</var.gc.lastOutputRoot>
624624
<var.gc.lastOutputType>SHARED_LIBRARY</var.gc.lastOutputType>
625-
<var.gc.preBuildChecksum>2435049039</var.gc.preBuildChecksum>
625+
<var.gc.preBuildChecksum>1735482036</var.gc.preBuildChecksum>
626626
<var.cfi.lastOutputRoot />
627627
<var.cfi.preBuildChecksum />
628628
<var.outdatedOnRestore>false</var.outdatedOnRestore>
629-
<var.lastUserSourceChecksum>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;&lt;checksum&gt;&lt;includedFiles&gt;&lt;file&gt;C:\Users\tkbest\Desktop\TestIMU\IMU_Follower.m&lt;/file&gt;&lt;/includedFiles&gt;&lt;value&gt;3832089872&lt;/value&gt;&lt;/checksum&gt;</var.lastUserSourceChecksum>
630-
<var.sourceSetState>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;&lt;sourceModel&gt;&lt;primarySourceFiles&gt;&lt;file&gt;C:\Users\tkbest\Desktop\TestIMU\IMU_Follower.m&lt;/file&gt;&lt;/primarySourceFiles&gt;&lt;fixedPointSourceFiles/&gt;&lt;fixedPointSourceRegistered&gt;false&lt;/fixedPointSourceRegistered&gt;&lt;fixedPointSourceSelected&gt;false&lt;/fixedPointSourceSelected&gt;&lt;/sourceModel&gt;</var.sourceSetState>
629+
<var.lastUserSourceChecksum>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;&lt;checksum&gt;&lt;includedFiles&gt;&lt;file&gt;C:\Users\tkbest\Documents\MATLAB_Python_IMU_Demo\IMU_Follower.m&lt;/file&gt;&lt;/includedFiles&gt;&lt;value&gt;2138282761&lt;/value&gt;&lt;/checksum&gt;</var.lastUserSourceChecksum>
630+
<var.sourceSetState>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;&lt;sourceModel&gt;&lt;primarySourceFiles&gt;&lt;file&gt;C:\Users\tkbest\Documents\MATLAB_Python_IMU_Demo\IMU_Follower.m&lt;/file&gt;&lt;/primarySourceFiles&gt;&lt;fixedPointSourceFiles/&gt;&lt;fixedPointSourceRegistered&gt;false&lt;/fixedPointSourceRegistered&gt;&lt;fixedPointSourceSelected&gt;false&lt;/fixedPointSourceSelected&gt;&lt;/sourceModel&gt;</var.sourceSetState>
631631
<param.forceMexBuild>false</param.forceMexBuild>
632632
<param.NoDefaultJIT>false</param.NoDefaultJIT>
633633
<param.configImportActive>false</param.configImportActive>
@@ -927,7 +927,7 @@
927927
</file>
928928
</fileset.inputtypes>
929929
<build-deliverables>
930-
<file location="${PROJECT_ROOT}\codegen\dll\IMU_Follower" name="IMU_Follower.dll" optional="false">C:\Users\tkbest\Desktop\TestIMU\codegen\dll\IMU_Follower\IMU_Follower.dll</file>
930+
<file location="${PROJECT_ROOT}\codegen\dll\IMU_Follower" name="IMU_Follower.dll" optional="false">C:\Users\tkbest\Documents\MATLAB_Python_IMU_Demo\codegen\dll\IMU_Follower\IMU_Follower.dll</file>
931931
</build-deliverables>
932932
<workflow />
933933
<matlab>

0 commit comments

Comments
 (0)