Skip to content

Commit

Permalink
do one thing and do it well
Browse files Browse the repository at this point in the history
* remove all rplidar-related files

* remove all rplidar-related code

* strip writers* and all other unnecessary stuff

* remove the "vs" folder

* create separate include directory for header files

* remove all "#ifdef USING_SFML" - it's now default

SFMLGUISettings -> GUISettings, SFMLGUI -> GUI

* rework README

Co-authored-by: dsonyy <[email protected]>
  • Loading branch information
bartekpacia and dsonyy committed Dec 27, 2020
0 parents commit cf0226f
Show file tree
Hide file tree
Showing 26 changed files with 1,557 additions and 0 deletions.
181 changes: 181 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
---
Language: Cpp
# BasedOnStyle: Chromium
AccessModifierOffset: -1
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: false
AlignConsecutiveAssignments: false
AlignConsecutiveBitFields: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: Align
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortEnumsOnASingleLine: true
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Inline
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: true
BinPackParameters: false
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 100
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DeriveLineEnding: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^<ext/.*\.h>'
Priority: 2
SortPriority: 0
- Regex: '^<.*\.h>'
Priority: 1
SortPriority: 0
- Regex: '^<.*'
Priority: 2
SortPriority: 0
- Regex: '.*'
Priority: 3
SortPriority: 0
IncludeIsMainRegex: '([-_](test|unittest))?$'
IncludeIsMainSourceRegex: ''
IndentCaseLabels: true
IndentCaseBlocks: false
IndentGotoLabels: true
IndentPPDirectives: None
IndentExternBlock: AfterExternBlock
IndentWidth: 2
IndentWrappedFunctionNames: false
InsertTrailingCommas: None
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Never
ObjCBlockIndentWidth: 2
ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
RawStringFormats:
- Language: Cpp
Delimiters:
- cc
- CC
- cpp
- Cpp
- CPP
- 'c++'
- 'C++'
CanonicalDelimiter: ''
BasedOnStyle: google
- Language: TextProto
Delimiters:
- pb
- PB
- proto
- PROTO
EnclosingFunctions:
- EqualsProto
- EquivToProto
- PARSE_PARTIAL_TEXT_PROTO
- PARSE_TEST_PROTO
- PARSE_TEXT_PROTO
- ParseTextOrDie
- ParseTextProtoOrDie
- ParseTestProto
- ParsePartialTestProto
CanonicalDelimiter: ''
BasedOnStyle: google
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
Standard: Auto
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 8
UseCRLF: false
UseTab: Never
WhitespaceSensitiveMacros:
- STRINGIZE
- PP_STRINGIZE
- BOOST_PP_STRINGIZE
...
17 changes: 17 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# tools
.vs
.vscode

# dependency dirs
sfml

# generated stuff
Release
Debug
*.o
lidarvis

# other
*.user
*.xcf
.DS_Store
23 changes: 23 additions & 0 deletions .github/workflows/code_style.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Check code style

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: clang-format
uses: DoozyX/[email protected]
with:
source: "./src"
clangFormatVersion: 11
inplace: True
- uses: EndBug/add-and-commit@v4
with:
author_name: clang-format (auto)
author_email: [email protected]
message: "fix code style using clang-format"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40 changes: 40 additions & 0 deletions .github/workflows/release_linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build Linux release

on:
push:
tags:
- "v*"

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Install SFML
run: ./install_sfml
- name: Build executable
run: make
- name: Archive executable
run: |
zip --junk-paths pcv_linux.zip pcv
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: vunnamed_tag
release_name: Unnamed release
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./pcv_linux.zip
asset_name: pcv_linux.zip
asset_content_type: application/zip
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# tools
.vs
.vscode

# dependency dirs
sfml

# generated stuff
Release
Debug
*.o
/pcv
/datasets

# other
*.user
*.xcf
.DS_Store
22 changes: 22 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Contributing

When contributing to this repository, please first discuss the change you wish to make via
issue, email, or any other method with the owners of this repository before making a change.

## Git stuff

- `master` branch is stable. Releases are build from it.
- Target `dev` branch by default, unless you have a very good reason not to.

## Code stuff

We use [`clang-format`](https://clang.llvm.org/docs/ClangFormat.html) to format the code according
to the [Chromium style guide](https://chromium.googlesource.com/chromium/src/+/HEAD/styleguide/c++/c++.md).
If you want to get your PR merged, format your code with `clang-format`.

## Markdown stuff

- We format Markdown files with [Prettier](https://prettier.io/), so please, use it after you
edited some `.md` file.
- Don't let your lines exceed 100 characters of length (it's hard to read files with lines
longer than ~100 characters in the terminal)
39 changes: 39 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
ROOT := ${CURDIR}

CXX := g++
CPPFLAGS := -std=c++17
LIBS := -lsfml-graphics -lsfml-window -lsfml-system
LDFLAGS += -L$(ROOT)/sfml/lib
INCLUDES := -I$(ROOT)/sfml/include -I$(ROOT)/include

pcv: main.o app.o cloud.o cloud-grabbers.o guis.o scenarios.o
$(CXX) --output pcv \
main.o \
app.o \
cloud.o \
cloud-grabbers.o \
guis.o \
scenarios.o \
$(LDFLAGS) \
$(LIBS)

main.o: src/main.cpp
$(CXX) $(CPPFLAGS) -c src/main.cpp $(INCLUDES)

app.o: src/app.cpp
$(CXX) $(CPPFLAGS) -c src/app.cpp $(INCLUDES)

cloud.o: src/cloud.cpp
$(CXX) $(CPPFLAGS) -c src/cloud.cpp $(INCLUDES)

cloud-grabbers.o: src/cloud-grabbers.cpp
$(CXX) $(CPPFLAGS) -c src/cloud-grabbers.cpp $(INCLUDES)

guis.o: src/guis.cpp
$(CXX) $(CPPFLAGS) -c src/guis.cpp $(INCLUDES)

scenarios.o: src/scenarios.cpp
$(CXX) $(CPPFLAGS) -c src/scenarios.cpp $(INCLUDES)

clean:
rm -f *.o src/*.o pcv
Loading

0 comments on commit cf0226f

Please sign in to comment.