Compare commits
3 Commits
3918ef5bd5
...
2bbd5254a9
Author | SHA1 | Date |
---|---|---|
|
2bbd5254a9 | |
|
cab78410a4 | |
|
ef9216f388 |
240
.idea/editor.xml
240
.idea/editor.xml
|
@ -81,7 +81,7 @@
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseEraseAlgorithm/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseEraseAlgorithm/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseFamiliarTemplateSyntaxForGenericLambdas/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseFamiliarTemplateSyntaxForGenericLambdas/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTooWideScope/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTooWideScope/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTooWideScopeInitStatement/@EntryIndexedValue" value="HINT" type="string" />
|
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTooWideScopeInitStatement/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantNamespaceDefinition/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantNamespaceDefinition/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonInlineFunctionDefinitionInHeaderFile/@EntryIndexedValue" value="WARNING" type="string" />
|
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonInlineFunctionDefinitionInHeaderFile/@EntryIndexedValue" value="WARNING" type="string" />
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonInlineVariableDefinitionInHeaderFile/@EntryIndexedValue" value="WARNING" type="string" />
|
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonInlineVariableDefinitionInHeaderFile/@EntryIndexedValue" value="WARNING" type="string" />
|
||||||
|
@ -283,244 +283,6 @@
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=StringLiteralTypo/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=StringLiteralTypo/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CommentTypo/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CommentTypo/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=IdentifierTypo/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=IdentifierTypo/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSmartPointerVsMakeFunction/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCStyleCast/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionalStyleCast/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReinterpretCastFromVoidPtr/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExplicitConvertingConstructor/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExplicitConversionOperator/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDiscardedPostfixOperatorResult/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConstValueFunctionReturnType/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberFunctionMayBeConst/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberFunctionMayBeStatic/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableMayBeConst/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterMayBeConst/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVariableCanBeMadeConstexpr/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterMayBeConstPtrOrRef/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPassValueParameterByConstReference/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppThrowExpressionCanBeReplacedWithRethrow/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppZeroConstantCanBeReplacedWithNullptr/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCompileTimeConstantCanBeReplacedWithBooleanConstant/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIfCanBeReplacedByConstexprIf/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=IfStdIsConstantEvaluatedCanBeReplaced/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=StdIsConstantEvaluatedWillAlwaysEvaluateToConstant/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConstevalIfIsAlwaysConstant/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassCanBeFinal/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseStructuredBinding/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseTypeTraitAlias/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAlgorithmWithCount/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseRangeAlgorithm/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseElementsView/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseStdSize/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppForLoopCanBeReplacedWithWhile/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppJoinDeclarationAndAssignment/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReplaceTieWithStructuredBinding/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReplaceMemsetWithZeroInitialization/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAssociativeContains/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseEraseAlgorithm/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseFamiliarTemplateSyntaxForGenericLambdas/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTooWideScope/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTooWideScopeInitStatement/@EntryIndexRemoved" />
|
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTooWideScopeInitStatement/@EntryIndexRemoved" />
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantNamespaceDefinition/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonInlineFunctionDefinitionInHeaderFile/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonInlineVariableDefinitionInHeaderFile/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionIsNotImplemented/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrivateSpecialMemberFunctionIsNotImplemented/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHiddenFunction/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHidingFunction/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPolymorphicClassWithNonVirtualPublicDestructor/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractClassWithoutSpecifier/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIncompleteSwitchStatement/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultCaseNotHandledInSwitchStatement/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyErroneousEmptyStatements/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppExpressionWithoutSideEffects/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNoDiscardExpression/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionResultShouldBeUsed/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMissingKeywordThrow/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDependentTypeWithoutTypenameKeyword/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDependentTemplateWithoutTemplateKeyword/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppImplicitDefaultConstructorNotAvailable/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeedsConstructorBecauseOfUninitializedMember/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUninitializedNonStaticDataMember/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRangeBasedForIncompatibleReference/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppZeroValuedExpressionUsedAsNullPointer/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyUnintendedObjectSlicing/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyUninitializedMember/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorDisambiguatedAsFunction/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVirtualFunctionInFinalClass/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMustBePublicVirtualToImplementInterface/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationSpecifierWithoutDeclarators/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEmptyDeclaration/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationHidesLocal/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationHidesUncapturedLocal/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMismatchedClassTags/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUsingResultOfAssignmentAsCondition/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIntegralToPointerConversion/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPointerToIntegralConversion/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIncompatiblePointerConversion/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPointerConversionDropsQualifiers/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStringLiteralToCharPointerConversion/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExceptionSafeResourceAcquisition/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVirtualFunctionCallInsideCtor/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractVirtualFunctionCallInCtor/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppInvalidLineContinuation/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfBadFormat/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfRiskyFormat/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfMissedArg/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfExtraArg/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatBadCode/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatLegacyCode/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatMixedArgs/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatTooFewArgs/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatTooManyArgs/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeprecatedEntity/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMissingIncludeGuard/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenSyntaxError/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenUnresolvedReference/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenUndocumentedParameter/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeletingVoidPointer/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBooleanIncrementExpression/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeprecatedRegisterStorageClassSpecifier/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIdenticalOperandsInBinaryExpression/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEqualOperandsInBinaryExpression/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedefinitionOfDefaultArgumentInOverrideFunction/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnnamedNamespaceInHeaderFile/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterNamesMismatch/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultedSpecialMemberFunctionIsImplicitlyDeleted/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNodiscardFunctionWithoutReturnValue/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantComplexityInComparison/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractFinalClass/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSpecialFunctionWithoutNoexceptSpecification/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnsignedZeroComparison/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMultiCharacterLiteral/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMultiCharacterWideLiteral/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantQualifier/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantAccessSpecifier/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAccessSpecifierWithNoDeclarations/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTypenameKeyword/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTemplateKeyword/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElseKeyword/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElseKeywordInsideCompoundStatement/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantControlFlowJump/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantEmptyStatement/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantEmptyDeclaration/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantParentheses/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantLambdaParameterList/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantCastExpression/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHeaderHasBeenAlreadyIncluded/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateArgumentsCanBeDeduced/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTemplateArguments/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticSpecifierOnAnonymousNamespaceMember/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantStaticSpecifierOnMemberAllocationFunction/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantStaticSpecifierOnThreadLocalLocalVariable/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBaseClassAccessSpecifier/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantInlineSpecifier/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantConstSpecifier/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBooleanExpressionArgument/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantVoidArgumentList/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantMemberInitializer/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBaseClassInitializer/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConstParameterInDeclaration/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVolatileParameterInDeclaration/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFinalFunctionInFinalClass/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFinalNonOverridingVirtualFunction/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElaboratedTypeSpecifier/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantDereferencingAndTakingAddress/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantConditionalExpression/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConditionalExpressionCanBeSimplified/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantExportKeyword/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantZeroInitializerInAggregateInitialization/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUserDefinedLiteralSuffixDoesNotStartWithUnderscore/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassIsIncomplete/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateParameterShadowing/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMutableSpecifierOnReferenceMember/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultInitializationWithNoUserConstructor/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppExplicitSpecializationInNonNamespaceScope/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnionMemberOfReferenceType/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUninitializedDependentBaseClass/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrecompiledHeaderIsNotIncluded/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrecompiledHeaderNotFound/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCoroutineCallResolveError/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAwaiterTypeIsNotClass/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppOutParameterMustBeWritten/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWarningDirective/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticAssertFailure/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEvaluationFailure/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorNeverUsed/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTypeAliasNeverUsed/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConceptNeverUsed/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeverUsed/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnumeratorNeverUsed/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLambdaCaptureNeverUsed/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableWithNonTrivialDtorIsNeverUsed/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterNeverUsed/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateParameterNeverUsed/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEntityAssignedButNoRead/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEntityUsedOnlyInUnevaluatedContext/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableMightNotBeInitialized/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppObjectMemberMightNotBeInitialized/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSomeObjectMembersMightNotBeInitialized/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorUsedBeforeInitialization/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnusedIncludeDirective/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNotAllPathsReturnValue/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CDeclarationWithImplicitIntType/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionDoesntReturnValue/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReturnNoValueInNonVoidFunction/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCVQualifierCanNotBeAppliedToReference/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDereferenceOperatorLimitExceeded/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppForwardEnumDeclarationWithoutUnderlyingType/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnmatchedPragmaRegionDirective/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnmatchedPragmaEndRegionDirective/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticDataMemberInUnnamedStruct/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultIsUsedAsIdentifier/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLongFloat/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtReinterpretCastFromNullptr/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtBindingRValueToLvalueReference/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtAddressOfClassRValue/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtDoubleUserConversionInCopyInit/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtCopyElisionInCopyInitDeclarator/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtNotInitializedStaticConstLocalVar/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRemoveRedundantBraces/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceIfStatementBraces/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceForStatementBraces/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceWhileStatementBraces/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceDoStatementBraces/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWrongIncludesOrder/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWrongSlashesInIncludeDirective/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceNestedNamespacesStyle/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceTypeAliasCodeStyle/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceFunctionDeclarationStyle/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberInitializersOrder/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceOverridingFunctionStyle/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceOverridingDestructorStyle/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAuto/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAutoForNumeric/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceCVQualifiersPlacement/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceCVQualifiersOrder/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnnecessaryWhitespace/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTabsAreDisallowed/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantConditions/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFANullDereference/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFANotInitializedField/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALoopConditionNotUpdated/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFADeletedPointer/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAMemoryLeak/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAInvalidatedMemory/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALocalValueEscapesScope/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALocalValueEscapesFunction/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantParameter/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantFunctionResult/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAArrayIndexOutOfBounds/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreachableCode/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreachableFunctionCall/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAEndlessLoop/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAInfiniteRecursion/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnusedValue/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreadVariable/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFATimeOver/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppInconsistentNaming/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=StringLiteralTypo/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CommentTypo/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=IdentifierTypo/@EntryIndexRemoved" />
|
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
|
@ -49,7 +49,7 @@ macro(blt_add_project name source type)
|
||||||
project(4p78-final-project)
|
project(4p78-final-project)
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
project(4p78-final-project VERSION 0.0.6)
|
project(4p78-final-project VERSION 0.0.7)
|
||||||
|
|
||||||
option(ENABLE_ADDRSAN "Enable the address sanitizer" OFF)
|
option(ENABLE_ADDRSAN "Enable the address sanitizer" OFF)
|
||||||
option(ENABLE_UBSAN "Enable the ub sanitizer" OFF)
|
option(ENABLE_UBSAN "Enable the ub sanitizer" OFF)
|
||||||
|
|
Binary file not shown.
|
@ -1,10 +1,12 @@
|
||||||
|
#include "headers.h"
|
||||||
#include "Adafruit_VL53L0X.h"
|
#include "Adafruit_VL53L0X.h"
|
||||||
|
|
||||||
Adafruit_VL53L0X lox = Adafruit_VL53L0X();
|
Adafruit_VL53L0X lox = Adafruit_VL53L0X();
|
||||||
float distanceReading = 0;
|
float distanceReading = 0;
|
||||||
|
|
||||||
void initDistance(){
|
void initDistance(){
|
||||||
|
|
||||||
if (!lox.begin()) {
|
if (!lox.begin(0x29, false, &Wire1, Adafruit_VL53L0X::VL53L0X_SENSE_LONG_RANGE)) {
|
||||||
Serial.println(F("Failed to boot VL53L0X"));
|
Serial.println(F("Failed to boot VL53L0X"));
|
||||||
while(1);
|
while(1);
|
||||||
}
|
}
|
|
@ -0,0 +1,82 @@
|
||||||
|
#include "headers.h"
|
||||||
|
#include "AS5600.h"
|
||||||
|
|
||||||
|
AS5600 as5600_0(&Wire1);
|
||||||
|
AS5600 as5600_1(&Wire2);
|
||||||
|
|
||||||
|
EncoderOdom odom;
|
||||||
|
|
||||||
|
void zeroOdom(){
|
||||||
|
|
||||||
|
odom.left = 0.0;
|
||||||
|
odom.right = 0.0;
|
||||||
|
odom.x = 0.0;
|
||||||
|
odom.y = 0.0;
|
||||||
|
odom.angle = 0.0;
|
||||||
|
|
||||||
|
wire2();
|
||||||
|
as5600_0.resetCumulativePosition(0);
|
||||||
|
wire1();
|
||||||
|
as5600_1.resetCumulativePosition(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void initEncoder(){
|
||||||
|
odom.left = 0.0;
|
||||||
|
odom.right = 0.0;
|
||||||
|
odom.x = 0.0;
|
||||||
|
odom.y = 0.0;
|
||||||
|
odom.angle = 0.0;
|
||||||
|
|
||||||
|
wire2();
|
||||||
|
as5600_0.begin();
|
||||||
|
Serial.print("Connect device 0: ");
|
||||||
|
Serial.println(as5600_0.isConnected() ? "true" : "false");
|
||||||
|
as5600_0.resetCumulativePosition(0);
|
||||||
|
|
||||||
|
wire1();
|
||||||
|
as5600_1.begin();
|
||||||
|
Serial.print("Connect device 1: ");
|
||||||
|
Serial.println(as5600_1.isConnected() ? "true" : "false");
|
||||||
|
as5600_1.resetCumulativePosition(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void updateEncoder(){
|
||||||
|
#define WHEEL_CIRCUM (2*PI*4.0625)
|
||||||
|
#define WHEEL_DISTANCE (7 + 12.0/16.0)
|
||||||
|
|
||||||
|
wire2();
|
||||||
|
int rawL = as5600_0.getCumulativePosition();
|
||||||
|
wire1();
|
||||||
|
int rawR = as5600_1.getCumulativePosition();
|
||||||
|
|
||||||
|
float left = rawL/4096.0 * -WHEEL_CIRCUM;
|
||||||
|
float right = rawR/4096.0 * WHEEL_CIRCUM;
|
||||||
|
|
||||||
|
float d_left = left-odom.left;
|
||||||
|
float d_right= right-odom.right;
|
||||||
|
|
||||||
|
odom.left = left;
|
||||||
|
odom.right = right;
|
||||||
|
|
||||||
|
float displacement = (d_left + d_right)/2;
|
||||||
|
float oldAng = odom.angle;
|
||||||
|
odom.angle += (d_left-d_right)/(2*WHEEL_DISTANCE);
|
||||||
|
float ang = (odom.angle+oldAng)/2;
|
||||||
|
|
||||||
|
float dispx = odom.x-desiredPos.x;
|
||||||
|
float dispy = odom.y-desiredPos.y;
|
||||||
|
posInput = sqrt(dispx*dispx+dispy*dispy);
|
||||||
|
|
||||||
|
desiredYaw = atan2(dispy, dispx)*180/PI;
|
||||||
|
if(abs(fmod(desiredYaw-currentYaw, 180.0))<90){
|
||||||
|
desiredYaw = fmod(desiredYaw+180.0, 360.0);
|
||||||
|
if(desiredYaw>180)desiredYaw-=180.0;
|
||||||
|
|
||||||
|
posInput = -posInput;
|
||||||
|
}
|
||||||
|
// Serial.println(desiredYaw);
|
||||||
|
|
||||||
|
odom.x += (float)(cos(ang)*displacement);
|
||||||
|
odom.y += (float)(sin(ang)*displacement);
|
||||||
|
}
|
|
@ -1,50 +0,0 @@
|
||||||
|
|
||||||
|
|
||||||
struct Encoder{
|
|
||||||
int rotations;
|
|
||||||
int currentAngle;
|
|
||||||
int estAngle;
|
|
||||||
bool threashhold;
|
|
||||||
|
|
||||||
float position(){
|
|
||||||
return rotations + (estAngle / 360.0);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Encoder encoder;
|
|
||||||
|
|
||||||
|
|
||||||
void initEncoder(){
|
|
||||||
pinMode(A0, INPUT);
|
|
||||||
encoder.currentAngle = 0;
|
|
||||||
encoder.rotations = 0;
|
|
||||||
encoder.estAngle=0;
|
|
||||||
encoder.threashhold=false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void updateEncoder(){
|
|
||||||
int rawIn = analogRead(A0);
|
|
||||||
// static long lastRan = 0;
|
|
||||||
// if(50>millis()-lastRan) return;
|
|
||||||
// lastRan = millis();
|
|
||||||
|
|
||||||
|
|
||||||
int rotation = map(rawIn, 4, 348, 0, 360);
|
|
||||||
int diff = rotation-encoder.currentAngle;
|
|
||||||
if(!encoder.threashhold && (abs(diff)>=50)){
|
|
||||||
encoder.threashhold=true;
|
|
||||||
if(diff<0){
|
|
||||||
encoder.rotations++;
|
|
||||||
encoder.estAngle = 0;
|
|
||||||
}
|
|
||||||
if(diff>0){
|
|
||||||
encoder.rotations--;
|
|
||||||
encoder.estAngle = 360;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(abs(diff)<30){
|
|
||||||
encoder.threashhold=false;
|
|
||||||
encoder.estAngle = rotation;
|
|
||||||
}
|
|
||||||
encoder.currentAngle = rotation;
|
|
||||||
}
|
|
|
@ -1,12 +1,8 @@
|
||||||
|
#include "headers.h"
|
||||||
#include "MPU6050_6Axis_MotionApps612.h"
|
#include "MPU6050_6Axis_MotionApps612.h"
|
||||||
//#include "MPU6050.h" // not necessary if using MotionApps include file
|
//#include "MPU6050.h" // not necessary if using MotionApps include file
|
||||||
|
|
||||||
|
MPU6050 mpu(MPU6050_ADDRESS_AD0_LOW, &Wire1);
|
||||||
#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE
|
|
||||||
#include "Wire.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
MPU6050 mpu;
|
|
||||||
|
|
||||||
// MPU control/status vars
|
// MPU control/status vars
|
||||||
bool dmpReady = false; // set true if DMP init was successful
|
bool dmpReady = false; // set true if DMP init was successful
|
||||||
|
@ -54,6 +50,8 @@ void initGyro(){
|
||||||
Serial.println(F("Initializing DMP..."));
|
Serial.println(F("Initializing DMP..."));
|
||||||
devStatus = mpu.dmpInitialize();
|
devStatus = mpu.dmpInitialize();
|
||||||
|
|
||||||
|
// mpu.setRate(0);
|
||||||
|
|
||||||
// supply your own gyro offsets here, scaled for min sensitivity
|
// supply your own gyro offsets here, scaled for min sensitivity
|
||||||
|
|
||||||
mpu.setXAccelOffset(-6009);
|
mpu.setXAccelOffset(-6009);
|
||||||
|
@ -102,17 +100,15 @@ void initGyro(){
|
||||||
bool updateGyro(){
|
bool updateGyro(){
|
||||||
if (!dmpReady) return false;
|
if (!dmpReady) return false;
|
||||||
if (mpu.dmpGetCurrentFIFOPacket(fifoBuffer)) {
|
if (mpu.dmpGetCurrentFIFOPacket(fifoBuffer)) {
|
||||||
// Xf = 1/4*(aaRealLast.x + aaReal.x)t^2 + Vot + Xo
|
|
||||||
// aaRealLast = aaReal;
|
|
||||||
|
|
||||||
mpu.dmpGetQuaternion(&q, fifoBuffer);
|
mpu.dmpGetQuaternion(&q, fifoBuffer);
|
||||||
mpu.dmpGetAccel(&aa, fifoBuffer);
|
// mpu.dmpGetAccel(&aa, fifoBuffer);
|
||||||
mpu.dmpGetGyro(&gy, fifoBuffer);
|
// mpu.dmpGetGyro(&gy, fifoBuffer);
|
||||||
mpu.dmpGetGravity(&gravity, &q);
|
mpu.dmpGetGravity(&gravity, &q);
|
||||||
mpu.dmpGetYawPitchRoll(ypr, &q, &gravity);
|
mpu.dmpGetYawPitchRoll(ypr, &q, &gravity);
|
||||||
mpu.dmpGetEuler(euler, &q);
|
// mpu.dmpGetEuler(euler, &q);
|
||||||
mpu.dmpGetLinearAccel(&aaReal, &aa, &gravity);
|
// mpu.dmpGetLinearAccel(&aaReal, &aa, &gravity);
|
||||||
mpu.dmpGetLinearAccelInWorld(&aaWorld, &aaReal, &q);
|
// mpu.dmpGetLinearAccelInWorld(&aaWorld, &aaReal, &q);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
|
@ -0,0 +1,114 @@
|
||||||
|
|
||||||
|
#define LOOP_INTERVAL_MS 20
|
||||||
|
|
||||||
|
struct FVec2{
|
||||||
|
float x,y;
|
||||||
|
};
|
||||||
|
struct FVec3{
|
||||||
|
float x,y,z;
|
||||||
|
};
|
||||||
|
struct FVec4{
|
||||||
|
float x,y,z;
|
||||||
|
};
|
||||||
|
|
||||||
|
extern FVec2 desiredPos;
|
||||||
|
|
||||||
|
struct Everything{
|
||||||
|
float motorTargetAngle;
|
||||||
|
float position;
|
||||||
|
FVec3 anglePID;
|
||||||
|
FVec3 posPID;
|
||||||
|
FVec3 ypr;
|
||||||
|
FVec3 euler;
|
||||||
|
FVec3 gravity;
|
||||||
|
FVec4 q;
|
||||||
|
FVec3 aa;
|
||||||
|
FVec3 gy;
|
||||||
|
FVec3 aaReal;
|
||||||
|
FVec3 aaWorld;
|
||||||
|
};
|
||||||
|
|
||||||
|
extern float angleOffset;
|
||||||
|
extern float desiredYaw;
|
||||||
|
extern float currentYaw;
|
||||||
|
|
||||||
|
struct DebugState{
|
||||||
|
int motorTargetAngle;
|
||||||
|
};
|
||||||
|
|
||||||
|
extern DebugState dbgState;
|
||||||
|
|
||||||
|
//-------- wire
|
||||||
|
#include <Wire.h>
|
||||||
|
#define Wire1 Wire
|
||||||
|
#define Wire2 Wire
|
||||||
|
|
||||||
|
void wire1();
|
||||||
|
void wire2();
|
||||||
|
|
||||||
|
//-------- gyro
|
||||||
|
#include "MPU6050_6Axis_MotionApps612.h"
|
||||||
|
|
||||||
|
extern Quaternion q; // [w, x, y, z] quaternion container
|
||||||
|
extern VectorInt16 aa; // [x, y, z] accel sensor measurements
|
||||||
|
extern VectorInt16 gy; // [x, y, z] gyro sensor measurements
|
||||||
|
extern VectorInt16 aaReal; // [x, y, z] gravity-free accel sensor measurements
|
||||||
|
extern VectorInt16 aaRealLast; // [x, y, z] gravity-free accel sensor measurements
|
||||||
|
extern VectorInt16 aaWorld; // [x, y, z] world-frame accel sensor measurements
|
||||||
|
extern VectorFloat gravity; // [x, y, z] gravity vector
|
||||||
|
extern float euler[3]; // [psi, theta, phi] Euler angle container
|
||||||
|
extern float ypr[3]; // [yaw, pitch, roll] yaw/pitch/roll container and gravity vector
|
||||||
|
|
||||||
|
void initGyro();
|
||||||
|
bool updateGyro();
|
||||||
|
|
||||||
|
//-------- distance
|
||||||
|
extern float distanceReading;
|
||||||
|
|
||||||
|
void initDistance();
|
||||||
|
void updateDistance();
|
||||||
|
|
||||||
|
//-------- encoder
|
||||||
|
|
||||||
|
struct EncoderOdom{
|
||||||
|
float x;
|
||||||
|
float y;
|
||||||
|
float angle;
|
||||||
|
|
||||||
|
float left;
|
||||||
|
float right;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
extern EncoderOdom odom;
|
||||||
|
|
||||||
|
void zeroOdom();
|
||||||
|
void initEncoder();
|
||||||
|
void updateEncoder();
|
||||||
|
|
||||||
|
//--------- pid
|
||||||
|
#include <PID_v1.h>
|
||||||
|
#define PID_ARR_COUNT 3
|
||||||
|
extern PID* pids[];
|
||||||
|
|
||||||
|
extern double angleInput, angleOutput, angleSetpoint;
|
||||||
|
extern PID anglePID;
|
||||||
|
|
||||||
|
extern double posInput, posOutput, posSetpoint;
|
||||||
|
extern PID posPID;
|
||||||
|
|
||||||
|
extern double turnInput, turnOutput, turnSetpoint;
|
||||||
|
extern PID turnPID;
|
||||||
|
|
||||||
|
struct Speeds{
|
||||||
|
float left;
|
||||||
|
float right;
|
||||||
|
};
|
||||||
|
|
||||||
|
Speeds updatePID();
|
||||||
|
void initPID();
|
||||||
|
|
||||||
|
//--------- webserver
|
||||||
|
|
||||||
|
void initWifi(bool host);
|
||||||
|
void initServer();
|
|
@ -1,3 +1,4 @@
|
||||||
|
#include "headers.h"
|
||||||
#include <PID_v1.h>
|
#include <PID_v1.h>
|
||||||
|
|
||||||
//double angKp=3.5, angKi=80, angKd=0.042;
|
//double angKp=3.5, angKi=80, angKd=0.042;
|
||||||
|
@ -17,9 +18,9 @@ double posInput, posOutput, posSetpoint;
|
||||||
PID posPID(&posInput, &posOutput, &posSetpoint, posKp, posKi, posKd, P_ON_E, DIRECT);
|
PID posPID(&posInput, &posOutput, &posSetpoint, posKp, posKi, posKd, P_ON_E, DIRECT);
|
||||||
|
|
||||||
double turnInput, turnOutput, turnSetpoint;
|
double turnInput, turnOutput, turnSetpoint;
|
||||||
PID turnPID(&turnInput, &turnOutput, &turnSetpoint, turnKp, turnKi, turnKd, P_ON_E, REVERSE);
|
PID turnPID(&turnInput, &turnOutput, &turnSetpoint, turnKp, turnKi, turnKd, P_ON_E, DIRECT);
|
||||||
|
|
||||||
PID* pids[] = {&anglePID, &posPID, &turnPID};
|
PID* pids[PID_ARR_COUNT] = {&anglePID, &posPID, &turnPID};
|
||||||
|
|
||||||
void initPID(){
|
void initPID(){
|
||||||
angleSetpoint = 0;
|
angleSetpoint = 0;
|
||||||
|
@ -39,11 +40,7 @@ void initPID(){
|
||||||
turnPID.SetSampleTime(5);
|
turnPID.SetSampleTime(5);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Speeds{
|
|
||||||
float left;
|
|
||||||
float right;
|
|
||||||
};
|
|
||||||
|
|
||||||
Speeds updatePID(){
|
Speeds updatePID(){
|
||||||
posPID.Compute();
|
posPID.Compute();
|
||||||
angleSetpoint = posOutput;
|
angleSetpoint = posOutput;
|
||||||
|
@ -51,8 +48,8 @@ Speeds updatePID(){
|
||||||
|
|
||||||
float maxTurn = max(0.0f, 15.0f-abs((float)angleOutput));
|
float maxTurn = max(0.0f, 15.0f-abs((float)angleOutput));
|
||||||
turnPID.SetOutputLimits(-maxTurn, maxTurn);
|
turnPID.SetOutputLimits(-maxTurn, maxTurn);
|
||||||
turnSetpoint = desiredYaw;
|
turnSetpoint = 0;
|
||||||
turnInput = currentYaw;
|
turnInput = fmod(currentYaw-desiredYaw, 180);
|
||||||
turnPID.Compute();
|
turnPID.Compute();
|
||||||
|
|
||||||
Speeds speeds;
|
Speeds speeds;
|
|
@ -1,5 +1,16 @@
|
||||||
|
|
||||||
#include "I2Cdev.h"
|
|
||||||
|
#include "headers.h"
|
||||||
|
|
||||||
|
void wire1(){
|
||||||
|
Wire1.begin(SDA, SCL);
|
||||||
|
Wire1.setClock(400000);
|
||||||
|
}
|
||||||
|
|
||||||
|
void wire2(){
|
||||||
|
Wire1.begin(D7, D5);
|
||||||
|
Wire2.setClock(400000);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#include <Servo.h>
|
#include <Servo.h>
|
||||||
|
@ -10,19 +21,10 @@ float angleOffset = -2.4241745;
|
||||||
float desiredYaw = 0.0;
|
float desiredYaw = 0.0;
|
||||||
float currentYaw = 0.0;
|
float currentYaw = 0.0;
|
||||||
|
|
||||||
struct DebugState{
|
FVec2 desiredPos;
|
||||||
int motorTargetAngle;
|
|
||||||
};
|
|
||||||
|
|
||||||
DebugState dbgState;
|
DebugState dbgState;
|
||||||
|
|
||||||
#include "distance.h"
|
|
||||||
#include "encoder.h"
|
|
||||||
#include "gyro.h"
|
|
||||||
#include "pid.h"
|
|
||||||
#include "webserver.h"
|
|
||||||
|
|
||||||
|
|
||||||
void initSerial(){
|
void initSerial(){
|
||||||
Serial.begin(115200);
|
Serial.begin(115200);
|
||||||
while (!Serial);
|
while (!Serial);
|
||||||
|
@ -36,11 +38,10 @@ void initMotors(){
|
||||||
}
|
}
|
||||||
|
|
||||||
void initI2C(){
|
void initI2C(){
|
||||||
digitalWrite(D2, LOW);
|
delay(100);
|
||||||
digitalWrite(D1, LOW);
|
|
||||||
delay(100);
|
wire2();
|
||||||
Wire.begin();
|
wire1();
|
||||||
Wire.setClock(400000);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
|
@ -50,23 +51,24 @@ void setup() {
|
||||||
initMotors();
|
initMotors();
|
||||||
initPID();
|
initPID();
|
||||||
initI2C();
|
initI2C();
|
||||||
initEncoder();
|
|
||||||
initDistance();
|
initDistance();
|
||||||
initGyro();
|
initGyro();
|
||||||
|
initEncoder();
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
|
long start = millis();
|
||||||
|
|
||||||
if (updateGyro()) { //gyro data
|
if (updateGyro()) { //gyro data
|
||||||
currentYaw=ypr[0]*180/M_PI;
|
|
||||||
double angle = ypr[1] * 180 / M_PI;
|
double angle = ypr[1] * 180 / M_PI;
|
||||||
if(angle>180)
|
if(angle>180)
|
||||||
angle -= 180;
|
angle -= 180;
|
||||||
angleInput = angle + angleOffset;
|
angleInput = angle + angleOffset;
|
||||||
}
|
}
|
||||||
{// encoder data
|
|
||||||
updateEncoder();
|
updateEncoder();
|
||||||
posInput = encoder.position();
|
currentYaw=odom.angle*180/M_PI;
|
||||||
}
|
|
||||||
updateDistance();
|
updateDistance();
|
||||||
|
|
||||||
|
|
||||||
|
@ -76,6 +78,13 @@ void loop() {
|
||||||
speeds.right = min(90.0f-10, max(-90.0f+10, speeds.right));
|
speeds.right = min(90.0f-10, max(-90.0f+10, speeds.right));
|
||||||
left.write(90+(int)speeds.left);
|
left.write(90+(int)speeds.left);
|
||||||
right.write(90+(int)speeds.right);
|
right.write(90+(int)speeds.right);
|
||||||
|
|
||||||
|
long end = millis();
|
||||||
|
|
||||||
delay(5);
|
if(end-start>LOOP_INTERVAL_MS){
|
||||||
|
Serial.print("Overran ");
|
||||||
|
Serial.println(end-start);
|
||||||
|
}else{
|
||||||
|
delay(LOOP_INTERVAL_MS-(end-start));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
#include "headers.h"
|
||||||
|
|
||||||
#include <ESP8266WiFi.h>
|
#include <ESP8266WiFi.h>
|
||||||
#include <ESPAsyncTCP.h>
|
#include <ESPAsyncTCP.h>
|
||||||
#include <ESPAsyncWebServer.h>
|
#include <ESPAsyncWebServer.h>
|
||||||
|
@ -31,48 +33,31 @@ void initWifi(bool host){
|
||||||
Serial.println(WiFi.localIP());
|
Serial.println(WiFi.localIP());
|
||||||
}
|
}
|
||||||
|
|
||||||
struct FVec3{
|
|
||||||
float x,y,z;
|
|
||||||
};
|
|
||||||
struct FVec4{
|
|
||||||
float x,y,z;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct Everything{
|
|
||||||
float motorTargetAngle;
|
|
||||||
float position;
|
|
||||||
FVec3 anglePID;
|
|
||||||
FVec3 posPID;
|
|
||||||
FVec3 ypr;
|
|
||||||
FVec3 euler;
|
|
||||||
FVec3 gravity;
|
|
||||||
FVec4 q;
|
|
||||||
FVec3 aa;
|
|
||||||
FVec3 gy;
|
|
||||||
FVec3 aaReal;
|
|
||||||
FVec3 aaWorld;
|
|
||||||
};
|
|
||||||
|
|
||||||
void initServer(){
|
void initServer(){
|
||||||
server.on("/", HTTP_GET, [](AsyncWebServerRequest *request){
|
server.on("/", HTTP_GET, [](AsyncWebServerRequest *request){
|
||||||
request->send_P(200, "text/html", index_html);
|
request->send_P(200, "text/html", index_html);
|
||||||
});
|
});
|
||||||
server.on("/get_stuff_bin", HTTP_GET, [](AsyncWebServerRequest *request){
|
server.on("/get_stuff_bin", HTTP_GET, [](AsyncWebServerRequest *request){
|
||||||
|
static float arr[4];
|
||||||
|
arr[0] = odom.angle;
|
||||||
|
arr[1] = distanceReading;
|
||||||
|
arr[2] = odom.x;
|
||||||
|
arr[3] = odom.y;
|
||||||
|
request->send(200, "application/octet-stream", (uint8_t*)(const char*)arr, sizeof(arr));
|
||||||
|
});
|
||||||
|
server.on("/fuckyou", HTTP_GET, [](AsyncWebServerRequest *request){
|
||||||
float arr[] = {
|
float arr[] = {
|
||||||
dbgState.motorTargetAngle,
|
odom.angle,
|
||||||
encoder.position(),
|
distanceReading,
|
||||||
angleSetpoint, angleInput, angleOutput,
|
odom.x,
|
||||||
posSetpoint, posInput, posOutput,
|
odom.y
|
||||||
ypr[0]*180/M_PI, ypr[1]*180/M_PI, ypr[2]*180/M_PI,
|
|
||||||
euler[0]*180/M_PI, euler[1]*180/M_PI, euler[2]*180/M_PI,
|
|
||||||
gravity.x, gravity.y, gravity.z,
|
|
||||||
q.w, q.x, q.y, q.z,
|
|
||||||
aa.x, aa.y, aa.z,
|
|
||||||
gy.x, gy.y, gy.z,
|
|
||||||
aaReal.x, aaReal.y, aaReal.z,
|
|
||||||
aaWorld.x, aaWorld.y, aaWorld.z
|
|
||||||
};
|
};
|
||||||
request->send(200, "application/text", (const uint8_t*)arr, sizeof(arr)*4);
|
request->send(200, "application/text", "hello");
|
||||||
|
});
|
||||||
|
server.on("/zero", HTTP_GET, [](AsyncWebServerRequest *request){
|
||||||
|
zeroOdom();
|
||||||
|
request->send(200);
|
||||||
});
|
});
|
||||||
server.on("/get_stuff", HTTP_GET, [](AsyncWebServerRequest *request){
|
server.on("/get_stuff", HTTP_GET, [](AsyncWebServerRequest *request){
|
||||||
char buff[1024];
|
char buff[1024];
|
||||||
|
@ -84,6 +69,7 @@ void initServer(){
|
||||||
"anglePID": {"setpoint": %lf, "input": %lf, "output": %lf},
|
"anglePID": {"setpoint": %lf, "input": %lf, "output": %lf},
|
||||||
"posPID": {"setpoint": %lf, "input": %lf, "output": %lf},
|
"posPID": {"setpoint": %lf, "input": %lf, "output": %lf},
|
||||||
"turnPID": {"setpoint": %lf, "input": %lf, "output": %lf},
|
"turnPID": {"setpoint": %lf, "input": %lf, "output": %lf},
|
||||||
|
"odom": {"left": %f, "right": %f, "x": %f, "y": %f, "angle": %f},
|
||||||
"ypr": {"yaw": %f, "pitch": %f, "roll": %f},
|
"ypr": {"yaw": %f, "pitch": %f, "roll": %f},
|
||||||
"euler": {"psi": %f, "theta": %f, "phi": %f},
|
"euler": {"psi": %f, "theta": %f, "phi": %f},
|
||||||
"gravity": {"x": %f, "y": %f, "z": %f},
|
"gravity": {"x": %f, "y": %f, "z": %f},
|
||||||
|
@ -95,10 +81,11 @@ void initServer(){
|
||||||
})",
|
})",
|
||||||
(float)dbgState.motorTargetAngle,
|
(float)dbgState.motorTargetAngle,
|
||||||
(float)distanceReading,
|
(float)distanceReading,
|
||||||
encoder.position(),
|
0.0, //encoder.position(),
|
||||||
angleSetpoint, angleInput, angleOutput,
|
angleSetpoint, angleInput, angleOutput,
|
||||||
posSetpoint, posInput, posOutput,
|
posSetpoint, posInput, posOutput,
|
||||||
turnSetpoint, turnInput, turnOutput,
|
turnSetpoint, turnInput, turnOutput,
|
||||||
|
odom.left, odom.right, odom.x, odom.y, odom.angle,
|
||||||
ypr[0]*180/M_PI, ypr[1]*180/M_PI, ypr[2]*180/M_PI,
|
ypr[0]*180/M_PI, ypr[1]*180/M_PI, ypr[2]*180/M_PI,
|
||||||
euler[0]*180/M_PI, euler[1]*180/M_PI, euler[2]*180/M_PI,
|
euler[0]*180/M_PI, euler[1]*180/M_PI, euler[2]*180/M_PI,
|
||||||
gravity.x, gravity.y, gravity.z,
|
gravity.x, gravity.y, gravity.z,
|
46
src/main.cpp
46
src/main.cpp
|
@ -14,14 +14,16 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
#include <deque>
|
||||||
#include <imgui.h>
|
#include <imgui.h>
|
||||||
|
#include <string>
|
||||||
#include <blt/gfx/window.h>
|
#include <blt/gfx/window.h>
|
||||||
|
#include <blt/gfx/renderer/font_renderer.h>
|
||||||
|
#include <blt/std/requests.h>
|
||||||
#include <blt/std/time.h>
|
#include <blt/std/time.h>
|
||||||
#include "blt/gfx/renderer/batch_2d_renderer.h"
|
#include "blt/gfx/renderer/batch_2d_renderer.h"
|
||||||
#include "blt/gfx/renderer/camera.h"
|
#include "blt/gfx/renderer/camera.h"
|
||||||
#include "blt/gfx/renderer/resource_manager.h"
|
#include "blt/gfx/renderer/resource_manager.h"
|
||||||
#include <string>
|
|
||||||
#include <blt/std/requests.h>
|
|
||||||
|
|
||||||
#ifdef __EMSCRIPTEN__
|
#ifdef __EMSCRIPTEN__
|
||||||
#include <emscripten.h>
|
#include <emscripten.h>
|
||||||
|
@ -31,10 +33,12 @@
|
||||||
blt::gfx::matrix_state_manager global_matrices;
|
blt::gfx::matrix_state_manager global_matrices;
|
||||||
blt::gfx::resource_manager resources;
|
blt::gfx::resource_manager resources;
|
||||||
blt::gfx::batch_renderer_2d renderer_2d(resources, global_matrices);
|
blt::gfx::batch_renderer_2d renderer_2d(resources, global_matrices);
|
||||||
|
blt::gfx::font_renderer_t fr2d{};
|
||||||
blt::gfx::first_person_camera_2d camera;
|
blt::gfx::first_person_camera_2d camera;
|
||||||
|
|
||||||
std::array<char, 100> buffer;
|
std::array<char, 100> buffer;
|
||||||
size_t last_time_ran = 0;
|
size_t last_time_ran = 0;
|
||||||
|
size_t last_time_ran1 = 0;
|
||||||
|
|
||||||
bool ready = false;
|
bool ready = false;
|
||||||
|
|
||||||
|
@ -66,12 +70,30 @@ blt::vec2 current_position;
|
||||||
|
|
||||||
struct boy_trust_t
|
struct boy_trust_t
|
||||||
{
|
{
|
||||||
std::vector<blt::vec2f> point_cloud;
|
std::deque<blt::vec2f> point_cloud;
|
||||||
std::vector<blt::gfx::line2d_t> lines;
|
std::vector<blt::gfx::line2d_t> lines;
|
||||||
|
|
||||||
void consolidate(blt::u64 run_time)
|
void consolidate(const blt::u64 run_time)
|
||||||
{
|
{
|
||||||
|
const auto cur_time = blt::system::getCurrentTimeMilliseconds();
|
||||||
|
if (cur_time - last_time_ran1 > run_time)
|
||||||
|
{
|
||||||
|
last_time_ran1 = cur_time;
|
||||||
|
// constexpr float min_dist = 5;
|
||||||
|
// for (auto [i, a] : enumerate(point_cloud))
|
||||||
|
// {
|
||||||
|
// for (auto [j, b] : enumerate(point_cloud))
|
||||||
|
// {
|
||||||
|
// if (i == j)
|
||||||
|
// continue;
|
||||||
|
// auto diff = (a - b).abs();
|
||||||
|
// if (diff.x() < min_dist && diff.y() < min_dist)
|
||||||
|
// {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} point_data;
|
} point_data;
|
||||||
|
|
||||||
|
@ -96,6 +118,7 @@ bool check_for_request(needed_t& data)
|
||||||
}
|
}
|
||||||
std::memcpy(&data, result.data(), sizeof(needed_t));
|
std::memcpy(&data, result.data(), sizeof(needed_t));
|
||||||
data.position *= 25.4;
|
data.position *= 25.4;
|
||||||
|
data.yaw = static_cast<float>(2 * blt::PI) - data.yaw;
|
||||||
// blt::mem::fromBytes<true>(result.data(), data.yaw);
|
// blt::mem::fromBytes<true>(result.data(), data.yaw);
|
||||||
// blt::mem::fromBytes<true>(result.data() + sizeof(float), data.distance);
|
// blt::mem::fromBytes<true>(result.data() + sizeof(float), data.distance);
|
||||||
// blt::mem::fromBytes<true>(result.data() + sizeof(float) * 2, data.position);
|
// blt::mem::fromBytes<true>(result.data() + sizeof(float) * 2, data.position);
|
||||||
|
@ -126,6 +149,7 @@ void init(const blt::gfx::window_data&)
|
||||||
global_matrices.create_internals();
|
global_matrices.create_internals();
|
||||||
resources.load_resources();
|
resources.load_resources();
|
||||||
renderer_2d.create();
|
renderer_2d.create();
|
||||||
|
fr2d.create_default(250, 2048);
|
||||||
}
|
}
|
||||||
|
|
||||||
void update(const blt::gfx::window_data& data)
|
void update(const blt::gfx::window_data& data)
|
||||||
|
@ -158,11 +182,19 @@ void update(const blt::gfx::window_data& data)
|
||||||
}
|
}
|
||||||
ImGui::End();
|
ImGui::End();
|
||||||
|
|
||||||
needed_t robot_data;
|
static needed_t robot_data;
|
||||||
if (check_for_request(robot_data))
|
if (check_for_request(robot_data))
|
||||||
{
|
{
|
||||||
handle_data(robot_data);
|
handle_data(robot_data);
|
||||||
}
|
}
|
||||||
|
renderer_2d.drawPoint(blt::gfx::point2d_t{robot_data.position, 35}, blt::make_color(0, 0, 1), 3);
|
||||||
|
renderer_2d.drawLine(blt::gfx::line2d_t{robot_data.position, {0, 0}}, blt::make_color(0, 0, 1), 2);
|
||||||
|
fr2d.render_text("Yaw " + std::to_string(robot_data.yaw), 32).setPosition(robot_data.position + blt::vec2{10, 0});
|
||||||
|
|
||||||
|
blt::vec2f current_position;
|
||||||
|
current_position[0] = robot_data.position[0] + 100 * std::cos(robot_data.yaw);
|
||||||
|
current_position[1] = robot_data.position[1] + 100 * std::sin(robot_data.yaw);
|
||||||
|
renderer_2d.drawLine(blt::gfx::line2d_t{robot_data.position, current_position}, blt::make_color(1, 0, 0), 2);
|
||||||
|
|
||||||
for (const auto& point_cloud : point_data.point_cloud)
|
for (const auto& point_cloud : point_data.point_cloud)
|
||||||
renderer_2d.drawPoint(blt::gfx::point2d_t{point_cloud, point_size}, blt::make_color(0, 1, 0), 1);
|
renderer_2d.drawPoint(blt::gfx::point2d_t{point_cloud, point_size}, blt::make_color(0, 1, 0), 1);
|
||||||
|
@ -170,6 +202,7 @@ void update(const blt::gfx::window_data& data)
|
||||||
renderer_2d.drawLine(line, blt::make_color(1, 0, 0), 0);
|
renderer_2d.drawLine(line, blt::make_color(1, 0, 0), 0);
|
||||||
|
|
||||||
renderer_2d.render(data.width, data.height);
|
renderer_2d.render(data.width, data.height);
|
||||||
|
fr2d.render();
|
||||||
}
|
}
|
||||||
|
|
||||||
void destroy(const blt::gfx::window_data&)
|
void destroy(const blt::gfx::window_data&)
|
||||||
|
@ -177,6 +210,7 @@ void destroy(const blt::gfx::window_data&)
|
||||||
global_matrices.cleanup();
|
global_matrices.cleanup();
|
||||||
resources.cleanup();
|
resources.cleanup();
|
||||||
renderer_2d.cleanup();
|
renderer_2d.cleanup();
|
||||||
|
fr2d.cleanup();
|
||||||
blt::gfx::cleanup();
|
blt::gfx::cleanup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue