Skip to content

Commit 848f2b0

Browse files
Pre-Commit (#4915)
* Add pre-commit Signed-off-by: Nils-ChristianIseke <[email protected]> * Add codespell workflow Signed-off-by: Nils-ChristianIseke <[email protected]> * Codespell write_changes=false. As otherwise CI does not fail. Signed-off-by: Nils-ChristianIseke <[email protected]> * Configure isort Signed-off-by: Nils-ChristianIseke <[email protected]> * add precommit Signed-off-by: Nils-ChristianIseke <[email protected]> * Introducing some issues. Signed-off-by: Nils-ChristianIseke <[email protected]> * Revert "Introducing some issues." This reverts commit 5377b65. Signed-off-by: Nils-ChristianIseke <[email protected]> * Removing pre-commit workflow. Signed-off-by: Nils-ChristianIseke <[email protected]> * Fix formatting error Signed-off-by: Nils-ChristianIseke <[email protected]> * Merge remote-tracking branch 'origin/main' into precommit Signed-off-by: Nils-ChristianIseke <[email protected]> * Change v31 to v32 Signed-off-by: Nils-ChristianIseke <[email protected]> * Revert "Merge remote-tracking branch 'origin/main' into precommit" This reverts commit 8a7ca39. Signed-off-by: Nils-ChristianIseke <[email protected]> * Rm submodule Signed-off-by: Nils-ChristianIseke <[email protected]> * pre-commit run --all after merge Signed-off-by: Nils-ChristianIseke <[email protected]> --------- Signed-off-by: Nils-ChristianIseke <[email protected]>
1 parent 018448f commit 848f2b0

File tree

174 files changed

+521
-725
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

174 files changed

+521
-725
lines changed

.devcontainer/caddy/srv/assets/foxglove/nav2_layout.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,4 +460,4 @@
460460
"direction": "row",
461461
"splitPercentage": 74.87855655794587
462462
}
463-
}
463+
}

.devcontainer/caddy/srv/nav2/github-markdown.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1099,4 +1099,4 @@
10991099

11001100
.markdown-body ::-webkit-calendar-picker-indicator {
11011101
filter: invert(50%);
1102-
}
1102+
}

.github/mergify.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pull_request_rules:
77
backport:
88
branches:
99
- jazzy
10-
10+
1111
- name: backport to iron at reviewers discretion
1212
conditions:
1313
- base=main
@@ -16,7 +16,7 @@ pull_request_rules:
1616
backport:
1717
branches:
1818
- iron
19-
19+
2020
- name: backport to humble at reviewers discretion
2121
conditions:
2222
- base=main

.github/workflows/codespell.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Codespell
2+
on:
3+
pull_request:
4+
5+
jobs:
6+
codespell:
7+
name: Run codespell
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- name: Install codespell
12+
run: pip install codespell
13+
- name: Run codespell
14+
run: codespell --toml ./tools/pyproject.toml

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,3 @@ Session.vim
6969

7070
# Vim Temporary
7171
.netrwhist
72-

.pre-commit-config.yaml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
2+
# To use:
3+
#
4+
# pre-commit run -a
5+
#
6+
# Or:
7+
#
8+
# pre-commit install # (runs every time you commit in git)
9+
#
10+
# To update this file:
11+
#
12+
# pre-commit autoupdate
13+
#
14+
# See https://github.com/pre-commit/pre-commit
15+
exclude: ".pgm$|.svg$"
16+
repos:
17+
- repo: https://github.com/pre-commit/pre-commit-hooks
18+
rev: v5.0.0
19+
hooks:
20+
- id: check-added-large-files
21+
- id: check-ast
22+
- id: check-case-conflict
23+
- id: check-merge-conflict
24+
- id: check-symlinks
25+
- id: check-xml
26+
- id: check-yaml
27+
args: ["--allow-multiple-documents"]
28+
- id: debug-statements
29+
- id: end-of-file-fixer
30+
- id: forbid-submodules
31+
- id: mixed-line-ending
32+
- id: trailing-whitespace
33+
exclude_types: [rst]
34+
- id: fix-byte-order-marker
35+
- repo: https://github.com/pycqa/isort
36+
rev: 6.0.1
37+
hooks:
38+
- id: isort
39+
args: ["tools/pyproject.toml"]
40+
name: isort (python)
41+
42+
- repo: https://github.com/codespell-project/codespell
43+
rev: v2.4.1
44+
hooks:
45+
- id: codespell
46+
additional_dependencies:
47+
- tomli
48+
args:
49+
[--toml=./tools/pyproject.toml]
50+
- repo: https://github.com/python-jsonschema/check-jsonschema
51+
rev: 0.31.1
52+
hooks:
53+
- id: check-github-workflows
54+
args: ["--verbose"]
55+
- id: check-github-actions
56+
args: ["--verbose"]
57+
- id: check-dependabot
58+
args: ["--verbose"]
59+
- repo: local
60+
hooks:
61+
- id: ament_lint_cmake
62+
name: ament_lint_cmake
63+
description: Check CMake code style using cmakelint.
64+
language: system
65+
types: [cmake]
66+
entry: ament_lint_cmake
67+
- id: ament_cpplint
68+
name: ament_cpplint
69+
description: Code style checking using cpplint.
70+
language: system
71+
types: [c++]
72+
entry: ament_cpplint
73+
- id: ament_uncrustify
74+
name: ament_uncrustify
75+
description: Code style checking using uncrustify.
76+
language: system
77+
types: [c++]
78+
args: ["--reformat"]
79+
entry: ament_uncrustify
80+
- id: ament_xmllint
81+
name: ament_xmllint
82+
description: Check XML markup using xmllint.
83+
language: system
84+
types: [xml]
85+
entry: ament_xmllint
86+
- id: ament_flake8
87+
name: ament_flake8
88+
description: Check Python code style using flake8.
89+
language: system
90+
types: [python]
91+
entry: ament_flake8
92+
- id: ament_pep257
93+
name: ament_pep257
94+
description: Check Python code style using pep257.
95+
language: system
96+
types: [python]
97+
entry: ament_pep257

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ RUN mkdir -p $ROOT_SRV
168168

169169
# install demo dependencies
170170
RUN apt-get update && apt-get install -y \
171-
ros-$ROS_DISTRO-rviz2
171+
ros-$ROS_DISTRO-rviz2
172172

173173
# install gzweb dependacies
174174
RUN apt-get install -y --no-install-recommends \

README.md

Lines changed: 39 additions & 39 deletions
Large diffs are not rendered by default.

doc/development/codespaces.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ TODO: gazebo example with gzweb
2020

2121
# References
2222

23-
TODO: links to more info
23+
TODO: links to more info

doc/requirements/_template_requirement.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ The \<navigation system> should be able to \<shall> \<do something>
33

44
## More details
55
- Why is this needed?
6-
- What is the expected user interaction?
6+
- What is the expected user interaction?
77
- What use case does this map to?
88
- Are there any non-functional requirements (build system, tools, performance, etc)
99

doc/requirements/requirements.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ Id | Handle | Priority | Description | Notes
156156
TP001 | Target Platforms.Operating Systems.Ubuntu | 1 | The Navigation System MUST support Ubuntu Desktop 16.04 and Ubuntu Desktop 18.04
157157
TP002 | Target Platforms.Operating Systems.MacOS | 1 | The Navigation System MUST support MacOS 10.13 (High Sierra) and MacOS 10.14 (Mohave)
158158
TP003 | Target Platforms.Operating Systems.Windows | 1 | The Navigation System MUST support Windows 10 Professional
159-
TP004 | Target Platforms.Operating Systems.Clear Linux | 1 | The Navigation System SHOULD support the Intel's Clear Linux distribution | Clear Linux uses a continuous deployment model.
159+
TP004 | Target Platforms.Operating Systems.Clear Linux | 1 | The Navigation System SHOULD support the Intel's Clear Linux distribution | Clear Linux uses a continuous deployment model.
160160
TP005 | Target Platforms.CPU.Word Size | 1 | The Navigation System SHALL support 64-bit processors | Don't assume a specific pointer size
161161
TP006 | Target Platforms.Minimum Platform | 1 | *TODO: Should we specify a minimum target platform? Or, should this be expressed as minimum platform requirements?*
162162

@@ -178,7 +178,7 @@ MP005 | Mission Planning.Navigation Commands.Enqueue | 2 | The Mission Plan SHOU
178178
MP006 | Mission Planning.Navigation Commands.Follow | 2 | The Mission Plan SHOULD be able to convey the information required for a robot to be able to follow another specified robot. | This one doesn't have a completion state (reaching the goal), unless it specifies additional information such as "follow until destination reached."
179179
MP007 | Mission Planning.Navigation Commands.Maintain Pose | 1 | The Mission Plan SHOULD be able to convey the information required for a robot to maintain its current pose. | Could be indefinite or time-based.
180180
MP008 | Mission Planning.Navigation Commands.Park | 2 | The Mission Plan SHOULD be able to convey the information required for a robot to park itself. | The implementation of the parking command could interact with the robot to cause it, for example, to shut down or enter a low-power state.
181-
MP009 | Mission Planning.Navigation Commands.Dock to Charger | 2 | The Mission Plan SHOULD be able to convey the information required for a robot to dock to a specific charging station.
181+
MP009 | Mission Planning.Navigation Commands.Dock to Charger | 2 | The Mission Plan SHOULD be able to convey the information required for a robot to dock to a specific charging station.
182182
MP010 | Mission Planning.Policy | 1 | The Mission Plan SHOULD be able to express information about how and when the navigation commands are to be carried out. | Time and safety constraints.
183183
MP011 | Mission Planning.Policy.Time.Initiation | 1 | The Mission Plan SHOULD be able to convey when a mission should begin.
184184
MP012 | Mission Planning.Policy.Time.Completion | 1 | The Mission Plan SHOULD be able to convey by when a mission should end.
@@ -216,7 +216,7 @@ PLN002 | Planning.Inputs.Navigation Command | 1 | The Planning Module SHALL rece
216216
PLN003 | Planning.Inputs.Policy | 1 | The Planning Module SHALL receive policy information associated with the Navigation Command to execute. | This could be global policy and/or per-command policy. Policy could contain, for example, a list of conventions for the robot to follow (navigate on the right side of a path, for example).
217217
PLN004 | Planning.Inputs.Mapping.Maps | 1 | The Planning Module MUST have access to one or more maps available that describe the robot's environment.
218218
PLN005 | Planning.Inputs.Perception.Sensory Input | 1 | The Planning Module MUST have access to data from the Perception Subsystem.
219-
PLN006 | Planning.Inputs.Prediction.Predicted Trajectories | 1 | The Planning Module MAY have access to predicted trajectories of objects detected by the Perception Subsystem. | In simple planners, there is no prediction of moving objects, but in more complex planners, this may be considered.
219+
PLN006 | Planning.Inputs.Prediction.Predicted Trajectories | 1 | The Planning Module MAY have access to predicted trajectories of objects detected by the Perception Subsystem. | In simple planners, there is no prediction of moving objects, but in more complex planners, this may be considered.
220220
PLN007 | Planning.Inputs.Localization.Current Pose | 1 | The Planning Module MUST have access to the robot's current pose. | The pose could be be provided manually or automatically determined (outside of this module).
221221
PLN008 | Planning.Outputs.Path | 1 | The Planning Module SHOULD output the Path for the robot to follow to execute the input Navigation Command and MUST respect any associated policy.
222222
PLN009 | Planning.Feedback.Inputs | 1 | The Planning Module MAY receive error input from the downstream Execution Module. | So that it can attempt to recover from execution failures.
@@ -303,7 +303,7 @@ PER002 | Perception.Latency | 1 | *TODO*
303303

304304
### 2.4.3 Prediction
305305

306-
The Prediction Subsystem uses input from the Perception Subsystem and predicts the trajectories of the detected objects over time.
306+
The Prediction Subsystem uses input from the Perception Subsystem and predicts the trajectories of the detected objects over time.
307307

308308
Id | Handle | Priority | Description | Notes
309309
-- | ------ | -------- | ----------- | -----
@@ -325,8 +325,8 @@ LOC002 | Localization.Robot Pose.Accuracy | 1 | The Localization Module MUST pro
325325
* What are the scalability for the ROS2 Navigation System?
326326
* Any other important design goals to call out?
327327
* Should we specify a minimum target platform? Or, should this be expressed as minimum platform requirements?
328-
* What is the right latency value for detecting a collision?
329-
* Should we add any safety-related functionality at the robot interface level?
330-
* Do safety zones need unique names?
328+
* What is the right latency value for detecting a collision?
329+
* Should we add any safety-related functionality at the robot interface level?
330+
* Do safety zones need unique names?
331331
* What is the target latency for the perception subsystem?
332-
* How far into the future should the object prediction work?
332+
* How far into the future should the object prediction work?

doc/use_cases/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,3 @@ The Nav2 system is targeting the following use cases:
1313

1414
## Stretch Target
1515
3D Navigation - Drones
16-

doc/use_cases/_template_use_case.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ As a \<Developer, Researcher, Technician, etc.> I want the robot to \<action> so
33

44
## More details
55
- Why is this needed?
6-
- What is the expected user interaction?
6+
- What is the expected user interaction?
77
- Are there any non-functional requirements? (build system, tools, performance, etc)
88

99
# Example:
@@ -15,7 +15,7 @@ As a robot user, I want the robot to navigate without colliding into people or o
1515
- Why is this needed?
1616
- I want this so that I know the robot won't damage itself, damage property or hurt anyone
1717
- Example: a logistics robot in a warehouse must avoid shelves, people, forklifts, and other robots
18-
- What is the expected user interaction?
18+
- What is the expected user interaction?
1919
- I shouldn't have to interact with the robot to prevent it from crashing into people or things
2020
- Are there any non-functional requirements? (build system, tools, performance, etc)
2121
- The performance needs to be fast enough to avoid moving objects such as people walking or other moving robots

doc/use_cases/collision_avoidance_use_case.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,3 @@ As a Robot user I want to my robot to avoid colliding with people or objects so
1010
- The user should be able to walk in front of a robot and it should avoid crashing into that person
1111

1212
- Are there any non-functional requirements? (build system, tools, performance, etc)
13-
14-

doc/use_cases/indoor_localization_use_case.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,3 @@ As a Robot user I want my robot to know its location on a given map of an indoor
1111
- The robot should be able to deduce it's own position on a map autonomously
1212

1313
- Are there any non-functional requirements? (build system, tools, performance, etc)
14-
15-

doc/use_cases/indoor_navigation_use_case.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ As a Robot user I want my robot to autonomously navigate to a given location on
77
- Example: a courier robot in a logistics warehouse
88

99
- What is the expected user interaction?
10-
- The user should be able to specify a map to use and a location on that map for the robot to move to.
10+
- The user should be able to specify a map to use and a location on that map for the robot to move to.
1111

1212
- Are there any non-functional requirements? (build system, tools, performance, etc)
13-
14-
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Keep Out Zones
2-
As a Robot user I want to be able to designate keep-out zones or areas on a map so that my robot will go around those areas instead of through them
2+
As a Robot user I want to be able to designate keep-out zones or areas on a map so that my robot will go around those areas instead of through them
33

44
## More details
55
- Why is this needed?
@@ -10,5 +10,3 @@ As a Robot user I want to be able to designate keep-out zones or areas on a map
1010
- The user should be able to specify keep out zones for the robot to avoid
1111

1212
- Are there any non-functional requirements? (build system, tools, performance, etc)
13-
14-

doc/use_cases/multi-story-building_use_case.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@ As a Robot user I want my robot to be able to navigate stairways, ramps or eleva
33

44
## More details
55
- Why is this needed?
6-
- Example: a delivery robot in an office building
6+
- Example: a delivery robot in an office building
77

88
- What is the expected user interaction?
99
- The user should be able to specify stairways, ramps and elevators on a map for a robot to use or not use
10-
- via a GUI
10+
- via a GUI
1111
- via a config file or API so that it can be done by another program
1212

1313
- Are there any non-functional requirements? (build system, tools, performance, etc)
14-
15-

doc/use_cases/outdoor_localization_use_case.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,3 @@ As a Robot user I want my robot to know its location on a given map of an outdoo
1111
- The robot should be able to deduce it's own position on a map autonomously
1212

1313
- Are there any non-functional requirements? (build system, tools, performance, etc)
14-
15-

doc/use_cases/outdoor_navigation_use_case.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ As a Robot user I want my robot to autonomously navigate to a given location on
77
- Example: a delivery robot on a college campus
88

99
- What is the expected user interaction?
10-
- The user should be able to specify a map to use and a location on that map for the robot to move to.
10+
- The user should be able to specify a map to use and a location on that map for the robot to move to.
1111

1212
- Are there any non-functional requirements? (build system, tools, performance, etc)
13-
14-

nav2_behavior_tree/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The nav2_behavior_tree module provides:
99

1010
See its [Configuration Guide Page](https://docs.nav2.org/configuration/packages/configuring-bt-xml.html) for additional parameter descriptions and a list of XML nodes made available in this package. Also review the [Nav2 Behavior Tree Explanation](https://docs.nav2.org/behavior_trees/index.html) pages explaining more context on the default behavior trees and examples provided in this package. A [tutorial](https://docs.nav2.org/plugin_tutorials/docs/writing_new_bt_plugin.html) is also provided to explain how to create a simple BT plugin.
1111

12-
See the [Navigation Plugin list](https://docs.nav2.org/plugins/index.html) for a list of the currently known and available planner plugins.
12+
See the [Navigation Plugin list](https://docs.nav2.org/plugins/index.html) for a list of the currently known and available planner plugins.
1313

1414
## The bt_action_node Template and the Behavior Tree Engine
1515

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
// This was automativally generated by cmake
3-
namespace nav2::details
3+
namespace nav2::details
44
{
55
const char* BT_BUILTIN_PLUGINS = "@plugin_libs@";
66
}

nav2_behavior_tree/test/plugins/action/test_spin_cancel_node.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class CancelSpinServer : public TestActionServer<nav2_msgs::action::Spin>
3636
goal_handle)
3737
{
3838
while (!goal_handle->is_canceling()) {
39-
// Spining here until goal cancels
39+
// Spinning here until goal cancels
4040
std::this_thread::sleep_for(std::chrono::milliseconds(15));
4141
}
4242
}
@@ -135,7 +135,7 @@ TEST_F(CancelSpinActionTestFixture, test_ports)
135135
// Setting target yaw
136136
goal_msg.target_yaw = 1.57;
137137

138-
// Spining for server and sending a goal
138+
// Spinning for server and sending a goal
139139
client_->wait_for_action_server();
140140
client_->async_send_goal(goal_msg, send_goal_options);
141141

nav2_behaviors/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ See its [Configuration Guide Page](https://docs.nav2.org/configuration/packages/
1515
See the [Navigation Plugin list](https://docs.nav2.org/plugins/index.html) for a list of the currently known and available planner plugins.
1616

1717
The `TimedBehavior` template makes use of a [nav2_util::TwistPublisher](../nav2_util/README.md#twist-publisher-and-twist-subscriber-for-commanded-velocities).
18-
The `AssistedTeleop` behavior makes use of a [nav2_util::TwistSubscriber](../nav2_util/README.md#twist-publisher-and-twist-subscriber-for-commanded-velocities).
18+
The `AssistedTeleop` behavior makes use of a [nav2_util::TwistSubscriber](../nav2_util/README.md#twist-publisher-and-twist-subscriber-for-commanded-velocities).

nav2_bringup/launch/bringup_launch.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,13 @@
1515
import os
1616

1717
from ament_index_python.packages import get_package_share_directory
18-
1918
from launch import LaunchDescription
20-
from launch.actions import (
21-
DeclareLaunchArgument,
22-
GroupAction,
23-
IncludeLaunchDescription,
24-
SetEnvironmentVariable,
25-
)
19+
from launch.actions import (DeclareLaunchArgument, GroupAction, IncludeLaunchDescription,
20+
SetEnvironmentVariable)
2621
from launch.conditions import IfCondition
2722
from launch.launch_description_sources import PythonLaunchDescriptionSource
2823
from launch.substitutions import LaunchConfiguration, PythonExpression
29-
from launch_ros.actions import Node
30-
from launch_ros.actions import PushROSNamespace
24+
from launch_ros.actions import Node, PushROSNamespace
3125
from launch_ros.descriptions import ParameterFile
3226
from nav2_common.launch import RewrittenYaml
3327

0 commit comments

Comments
 (0)