Skip to content

Commit

Permalink
Extended map server (#23)
Browse files Browse the repository at this point in the history
* map server services

* map server services

* further changes

* Fix PolygonIterator

* Coverage server

* Couple of significant changes
- migrated to Gazebo Harmonic. ROS bridge needs to be built from a source
- changes to nav2 stack, so navigation is actually working
- fixed a couple of annoying bugs

* Fix ros2_control UDF
Improve launches

* Sim node
  • Loading branch information
jkaflik committed Jun 2, 2024
1 parent 9f50ac1 commit 0bae609
Show file tree
Hide file tree
Showing 121 changed files with 6,744 additions and 1,356 deletions.
65 changes: 65 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
BasedOnStyle: Google
AccessModifierOffset: -2
ConstructorInitializerIndentWidth: 2
AlignEscapedNewlinesLeft: false
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AlwaysBreakTemplateDeclarations: true
AlwaysBreakBeforeMultilineStrings: true
BreakBeforeBinaryOperators: false
BreakBeforeTernaryOperators: false
BreakConstructorInitializersBeforeComma: true
BinPackParameters: true
ColumnLimit: 120
ConstructorInitializerAllOnOneLineOrOnePerLine: true
DerivePointerBinding: false
PointerBindsToType: true
ExperimentalAutoDetectBinPacking: false
IndentCaseLabels: true
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 60
PenaltyBreakString: 1
PenaltyBreakFirstLessLess: 1000
PenaltyExcessCharacter: 1000
PenaltyReturnTypeOnItsOwnLine: 90
SpacesBeforeTrailingComments: 2
Cpp11BracedListStyle: false
Standard: Auto
IndentWidth: 2
TabWidth: 2
UseTab: Never
IndentFunctionDeclarationAfterType: false
SpacesInParentheses: false
SpacesInAngles: false
SpaceInEmptyParentheses: false
SpacesInCStyleCastParentheses: false
SpaceAfterControlStatementKeyword: true
SpaceBeforeAssignmentOperators: true
ContinuationIndentWidth: 4
SortIncludes: false
SpaceAfterCStyleCast: false

# Configure each individual brace in BraceWrapping
BreakBeforeBraces: Custom

# Control of individual brace wrapping cases
BraceWrapping: {
AfterClass: 'true'
AfterControlStatement: 'true'
AfterEnum : 'true'
AfterFunction : 'true'
AfterNamespace : 'true'
AfterStruct : 'true'
AfterUnion : 'true'
BeforeCatch : 'true'
BeforeElse : 'true'
IndentBraces : 'false'
}
...
147 changes: 147 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
# Generated from CLion Inspection settings
---
Checks: '-*,
bugprone-argument-comment,
bugprone-assert-side-effect,
bugprone-bad-signal-to-kill-thread,
bugprone-branch-clone,
bugprone-copy-constructor-init,
bugprone-dangling-handle,
bugprone-dynamic-static-initializers,
bugprone-fold-init-type,
bugprone-forward-declaration-namespace,
bugprone-forwarding-reference-overload,
bugprone-inaccurate-erase,
bugprone-incorrect-roundings,
bugprone-integer-division,
bugprone-lambda-function-name,
bugprone-macro-parentheses,
bugprone-macro-repeated-side-effects,
bugprone-misplaced-operator-in-strlen-in-alloc,
bugprone-misplaced-pointer-arithmetic-in-alloc,
bugprone-misplaced-widening-cast,
bugprone-move-forwarding-reference,
bugprone-multiple-statement-macro,
bugprone-no-escape,
bugprone-parent-virtual-call,
bugprone-posix-return,
bugprone-reserved-identifier,
bugprone-sizeof-container,
bugprone-sizeof-expression,
bugprone-spuriously-wake-up-functions,
bugprone-string-constructor,
bugprone-string-integer-assignment,
bugprone-string-literal-with-embedded-nul,
bugprone-suspicious-enum-usage,
bugprone-suspicious-include,
bugprone-suspicious-memset-usage,
bugprone-suspicious-missing-comma,
bugprone-suspicious-semicolon,
bugprone-suspicious-string-compare,
bugprone-suspicious-memory-comparison,
bugprone-suspicious-realloc-usage,
bugprone-swapped-arguments,
bugprone-terminating-continue,
bugprone-throw-keyword-missing,
bugprone-too-small-loop-variable,
bugprone-undefined-memory-manipulation,
bugprone-undelegated-constructor,
bugprone-unhandled-self-assignment,
bugprone-unused-raii,
bugprone-unused-return-value,
bugprone-use-after-move,
bugprone-virtual-near-miss,
cert-dcl21-cpp,
cert-dcl58-cpp,
cert-err34-c,
cert-err52-cpp,
cert-err60-cpp,
cert-flp30-c,
cert-msc50-cpp,
cert-msc51-cpp,
cert-str34-c,
cppcoreguidelines-interfaces-global-init,
cppcoreguidelines-narrowing-conversions,
cppcoreguidelines-pro-type-member-init,
cppcoreguidelines-pro-type-static-cast-downcast,
cppcoreguidelines-slicing,
google-default-arguments,
google-explicit-constructor,
google-runtime-operator,
hicpp-exception-baseclass,
hicpp-multiway-paths-covered,
misc-misplaced-const,
misc-new-delete-overloads,
misc-no-recursion,
misc-non-copyable-objects,
misc-throw-by-value-catch-by-reference,
misc-unconventional-assign-operator,
misc-uniqueptr-reset-release,
modernize-avoid-bind,
modernize-concat-nested-namespaces,
modernize-deprecated-headers,
modernize-deprecated-ios-base-aliases,
modernize-loop-convert,
modernize-make-shared,
modernize-make-unique,
modernize-pass-by-value,
modernize-raw-string-literal,
modernize-redundant-void-arg,
modernize-replace-auto-ptr,
modernize-replace-disallow-copy-and-assign-macro,
modernize-replace-random-shuffle,
modernize-return-braced-init-list,
modernize-shrink-to-fit,
modernize-unary-static-assert,
modernize-use-auto,
modernize-use-bool-literals,
modernize-use-emplace,
modernize-use-equals-default,
modernize-use-equals-delete,
modernize-use-nodiscard,
modernize-use-noexcept,
modernize-use-nullptr,
modernize-use-override,
modernize-use-transparent-functors,
modernize-use-uncaught-exceptions,
mpi-buffer-deref,
mpi-type-mismatch,
openmp-use-default-none,
performance-faster-string-find,
performance-for-range-copy,
performance-implicit-conversion-in-loop,
performance-inefficient-algorithm,
performance-inefficient-string-concatenation,
performance-inefficient-vector-operation,
performance-move-const-arg,
performance-move-constructor-init,
performance-no-automatic-move,
performance-noexcept-move-constructor,
performance-trivially-destructible,
performance-type-promotion-in-math-fn,
performance-unnecessary-copy-initialization,
performance-unnecessary-value-param,
portability-simd-intrinsics,
readability-avoid-const-params-in-decls,
readability-const-return-type,
readability-container-size-empty,
readability-convert-member-functions-to-static,
readability-delete-null-pointer,
readability-deleted-default,
readability-inconsistent-declaration-parameter-name,
readability-make-member-function-const,
readability-misleading-indentation,
readability-misplaced-array-index,
readability-non-const-parameter,
readability-redundant-control-flow,
readability-redundant-declaration,
readability-redundant-function-ptr-dereference,
readability-redundant-smartptr-get,
readability-redundant-string-cstr,
readability-redundant-string-init,
readability-simplify-subscript-expr,
readability-static-accessed-through-instance,
readability-static-definition-in-anonymous-namespace,
readability-string-compare,
readability-uniqueptr-delete-release,
readability-use-anyofallof'
1 change: 1 addition & 0 deletions .devcontainer/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
home/p*
1 change: 1 addition & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ RUN apt-get update \
python3-pip \
curl \
rsync \
psmisc \
&& rm -rf /var/lib/apt/lists/*

RUN echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "OpenMowerROS2 development environment",
"name": "OpenMowerNext development environment",
"privileged": true,
"remoteUser": "openmower",
"dockerComposeFile": "docker-compose.yaml",
Expand Down
2 changes: 0 additions & 2 deletions .devcontainer/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ services:
depends_on:
- xserver
groot:
profiles:
- with_groot
image: jkaflik/behaviortree-groot:latest
ipc: host
pid: host
Expand Down
28 changes: 20 additions & 8 deletions .devcontainer/home/map.geojson
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@
"properties": {
"id": "0859c0c1-ec2d-4197-96b7-2d12f6cf1cd9",
"name": "backyard",
"type": "lawn",
"fill": "#00ff00"
"type": "operation",
"fill": "#00ff00",
"style": {
"color": "#00ff00"
}
},
"geometry": {
"coordinates": [
Expand Down Expand Up @@ -84,7 +87,10 @@
"id": "6387f8e9-bc4e-48a5-95e2-fedd3b3b5c09",
"name": "driveway",
"type": "navigation",
"fill": "#ffffff"
"fill": "#ffffff",
"style": {
"color": "#ffffff"
}
},
"geometry": {
"coordinates": [
Expand Down Expand Up @@ -119,8 +125,11 @@
"type": "Feature",
"properties": {
"id": "a7a3e913-5e9e-4959-8044-059f40356996",
"type": "lawn",
"fill": "#00ff00"
"type": "operation",
"fill": "#00ff00",
"style": {
"color": "#00ff00"
}
},
"geometry": {
"coordinates": [
Expand Down Expand Up @@ -170,10 +179,13 @@
{
"type": "Feature",
"properties": {
"fill": "#ff0000",
"type": "obstacle",
"type": "exclusion",
"name": "tree",
"id": "90cd67cb-a606-4878-be1c-2c08f8fc085d"
"id": "90cd67cb-a606-4878-be1c-2c08f8fc085d",
"fill": "#ff0000",
"style": {
"color": "#ff0000"
}
},
"geometry": {
"coordinates": [
Expand Down
27 changes: 26 additions & 1 deletion .devcontainer/scripts/remote_devices.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,40 @@ then
exit 1
fi

isFirstRun=false

# check if RSA private key exists, if not create it
if [ ! -f ~/.ssh/id_rsa ]; then
isFirstRun=true

ssh-keygen -t rsa -b 4096 -C "devcontainer@devcontainer" -f ~/.ssh/id_rsa -q -N ""

echo "Add the following public key to the authorized_keys file on the host:"
echo "----------------------------------------"

cat ~/.ssh/id_rsa.pub

echo "----------------------------------------"
echo "Press any key to continue"
read -n 1 -s
fi

ssh-copy-id -i ~/.ssh/id_rsa.pub $username@$host
echo "Checking if host is reachable"

# check if can ssh to host
if ! ssh -o ConnectTimeout=2 $username@$host exit > /dev/null; then
echo "Cannot connect to host"
exit 1
fi

if [ "$isFirstRun" = true ]; then
echo "Install socat on host"

ssh $username@$host "sudo apt install -y socat > /dev/null"
fi

echo "Making sure all socat processes are killed on host"

ssh $username@$host "sudo killall socat || true"

#trap "trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXIT
Expand All @@ -45,9 +66,13 @@ sshAndSocatSerialToTCP() {

killall socat > /dev/null || true

echo "Starting socat processes"

sshAndSocatSerialToTCP ttyAMA0 115200 65000 & \
sshAndSocatSerialToTCP ttyAMA1 921600 65001 & \
sshAndSocatSerialToTCP ttyAMA2 115200 65002 & \
sshAndSocatSerialToTCP ttyAMA3 115200 65003 & \
sshAndSocatSerialToTCP ttyAMA4 115200 65004 && fg
&& fg

echo "All socat processes have exited, exiting..."
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ __pycache__/

.clion.source.upload.marker

cmake-build-debug/
cmake-build-debug*/

/.name
/.idea
Loading

0 comments on commit 0bae609

Please sign in to comment.