-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Copy params into docker image * Update service image * Add device and robot namespace * Format * Move files in better dirs
- Loading branch information
1 parent
b3b04a8
commit e041742
Showing
8 changed files
with
191 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.vscode | ||
|
||
*.pyc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
--- | ||
repos: | ||
# Standard hooks | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.6.0 | ||
hooks: | ||
- id: check-added-large-files | ||
# mesh files has to be taken into account | ||
args: [--maxkb=3000] | ||
- id: check-ast | ||
- id: check-case-conflict | ||
- id: check-merge-conflict | ||
- id: check-symlinks | ||
- id: check-xml | ||
- id: check-yaml | ||
- id: debug-statements | ||
- id: destroyed-symlinks | ||
- id: detect-private-key | ||
- id: end-of-file-fixer | ||
- id: fix-byte-order-marker | ||
- id: name-tests-test | ||
- id: mixed-line-ending | ||
- id: trailing-whitespace | ||
|
||
# Python hooks | ||
- repo: https://github.com/asottile/pyupgrade | ||
rev: v3.15.2 | ||
hooks: | ||
- id: pyupgrade | ||
args: [--py36-plus] | ||
|
||
- repo: https://github.com/psf/black | ||
rev: 24.4.0 | ||
hooks: | ||
- id: black | ||
args: [--line-length=99] | ||
|
||
- repo: https://github.com/PyCQA/flake8 | ||
rev: 7.0.0 | ||
hooks: | ||
- id: flake8 | ||
args: ['--ignore=E501,W503'] # ignore too long line and line break before binary operator, | ||
# black checks it | ||
|
||
- repo: https://github.com/PyCQA/isort | ||
rev: 5.13.2 | ||
hooks: | ||
- id: isort | ||
args: [--profile, black] | ||
|
||
# XML | ||
- repo: https://github.com/tier4/pre-commit-hooks-ros | ||
rev: v0.8.0 | ||
hooks: | ||
- id: prettier-package-xml | ||
- id: sort-package-xml | ||
|
||
# YAML | ||
- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt | ||
rev: 0.2.3 | ||
hooks: | ||
- id: yamlfmt | ||
files: ^(?!.*compose)(?!.*ekf\.yaml$).*$ | ||
args: [--mapping, '2', --sequence, '4', --offset, '2', --width, '100'] | ||
|
||
# Copyright | ||
- repo: local | ||
hooks: | ||
- id: ament_copyright | ||
name: ament_copyright | ||
description: Check if copyright notice is available in all files. | ||
entry: ament_copyright | ||
language: system | ||
|
||
# Spellcheck | ||
- repo: https://github.com/codespell-project/codespell | ||
rev: v2.2.6 | ||
hooks: | ||
- id: codespell | ||
args: [--write-changes, --uri-ignore-words-list=ist, -L manuel] | ||
exclude: CHANGELOG\.rst|\.(svg|pyc|drawio)$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,8 @@ | ||
services: | ||
nmea-gps: | ||
image: husarion/nmea-gps:humble-2.0.1-20240209 | ||
image: husarion/nmea-gps:humble-2.0.1-20240617 | ||
network_mode: host | ||
restart: always | ||
volumes: | ||
- ./params:/params | ||
command: > | ||
ros2 run nmea_navsat_driver nmea_socket_driver --ros-args | ||
--params-file /params/nmea_socket_driver.yaml | ||
-r __ns:=/panther | ||
ros2 launch /nmea_navsat.launch.py | ||
robot_namespace:=panther |
3 changes: 2 additions & 1 deletion
3
demo/params/nmea_socket_driver.yaml → demo/config/nmea_navsat_params.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
--- | ||
/**/nmea_navsat_driver: | ||
ros__parameters: | ||
ip: "10.15.20.2" | ||
ip: 10.15.20.2 | ||
port: 5000 | ||
buffer_size: 4096 | ||
timeout_sec: 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# Copyright 2024 Husarion sp. z o.o. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
from launch import LaunchDescription | ||
from launch.actions import DeclareLaunchArgument | ||
from launch.substitutions import ( | ||
EnvironmentVariable, | ||
LaunchConfiguration, | ||
PythonExpression, | ||
) | ||
from launch_ros.actions import Node | ||
|
||
|
||
def generate_launch_description(): | ||
device_namespace = LaunchConfiguration("device_namespace") | ||
declare_device_namespace_arg = DeclareLaunchArgument( | ||
"device_namespace", | ||
default_value="gps", | ||
description="Namespace for the device, utilized in TF frames and preceding device topics. This aids in differentiating between multiple cameras on the same robot.", | ||
) | ||
|
||
params_file = LaunchConfiguration("params_file") | ||
declare_params_file_arg = DeclareLaunchArgument( | ||
"params_file", | ||
default_value="/config/nmea_navsat_params.yaml", | ||
description="Path to the parameter file for the nmea_socket_driver node.", | ||
) | ||
|
||
robot_namespace = LaunchConfiguration("robot_namespace") | ||
declare_robot_namespace_arg = DeclareLaunchArgument( | ||
"robot_namespace", | ||
default_value=EnvironmentVariable("ROBOT_NAMESPACE", default_value=""), | ||
description="Namespace to all launched nodes and use namespace as tf_prefix. This aids in differentiating between multiple robots with the same devices.", | ||
) | ||
|
||
tf_prefix = PythonExpression( | ||
["'", robot_namespace, "/' if '", robot_namespace, "' != '' else ''"] | ||
) | ||
|
||
nmea_driver = Node( | ||
package="nmea_navsat_driver", | ||
executable="nmea_socket_driver", | ||
name=device_namespace, | ||
namespace=robot_namespace, | ||
parameters=[ | ||
{ | ||
"frame_id": device_namespace, | ||
"tf_prefix": tf_prefix, | ||
}, | ||
params_file, | ||
], | ||
remappings=[ | ||
("fix", "~/fix"), | ||
("heading", "~/heading"), | ||
("time_reference", "~/time_reference"), | ||
("vel", "~/vel"), | ||
], | ||
) | ||
|
||
return LaunchDescription( | ||
[ | ||
declare_params_file_arg, | ||
declare_robot_namespace_arg, | ||
declare_device_namespace_arg, | ||
nmea_driver, | ||
] | ||
) |