Skip to content

Commit 671dde6

Browse files
SteveMacenskiMichael-EquinaiveHobodaisukesruffsl
authored
Foxy sync 2 (July 1 to August 7) (#1932)
* Add slam toolbox as exec dep for nav2_bringup (#1827) * Add slam toolbox as exec dep * Added slam toolbox * Changed version of slam toolbox to foxy-devel * Added modifications to allow for exec depend of slam toolbox without breaking docker / CI * reformatted skip keys * Added tabs to skip key arguments * Removed commented out code block * Add unit tests for follow path, compute path to pose, and navigate to pose BT action nodes (#1844) * Add compute path to pose unit tests Signed-off-by: Sarthak Mittal <[email protected]> * Add follow path action unit tests Signed-off-by: Sarthak Mittal <[email protected]> * Add navigate to pose action unit tests Signed-off-by: Sarthak Mittal <[email protected]> * adding foxy build icons to readme (#1853) * adding foxy build icons * adding dividers * sync master from foxy version updates (#1852) * sync master from foxy version updates * syncing foxy and master * Add unit tests for clear entire costmap and reinitialize global localization BT service nodes (#1845) * Add clear entire costmap service unit tests Signed-off-by: Sarthak Mittal <[email protected]> * Add reinitialize global localization service unit test Signed-off-by: Sarthak Mittal <[email protected]> * Temporarily disable dump_params test (#1856) Signed-off-by: Sarthak Mittal <[email protected]> * commenting out unused validPointPotential (#1854) * Adding ROS2 versions to issue template (#1861) * reload behavior tree before creating RosTopicLogger to prevent nullptr error or no /behavior_tree_log problem (#1849) Signed-off-by: Daisuke Sato <[email protected]> * Add citation for IROS paper (#1867) * Add citation We'll want to add the DOI once published * Bump citation section above build status * Fix line breaks * Changes RCUTILS_CONSOLE_STDOUT_LINE_BUFFERED to RCUTILS_LOGGING_BUFFERED_STREAM (#1868) * Added parameters to configure amcl laser scan topic (#1870) * Added parameters to configure amcl topic * changed parameter to scan_topic and added to all the configuration files * added scan_topic amcl param to docs * Satisfied linter * Move dwb goal/progress checker plugins to nav2_controller (#1857) * Move dwb goal/progress checker plugins to nav2_controller Signed-off-by: Siddarth Gore <[email protected]> * Move goal/progress checker plugins to nav2_controller Address review comments Signed-off-by: Siddarth Gore <[email protected]> * Move goal/progress checker plugins to nav2_controller Use new plugin declaration format and doc update Signed-off-by: Siddarth Gore <[email protected]> * Update bringup.yaml for new plugins in nav2_controller Also remove redundent file from dwb_plugins Signed-off-by: Siddarth Gore <[email protected]> * Fix doc errors and update remaining yaml files Signed-off-by: Siddarth Gore <[email protected]> * Remove mention of goal_checker from dwb docs Signed-off-by: Siddarth Gore <[email protected]> * Add .plugin params to doc Signed-off-by: Siddarth Gore <[email protected]> * Tests for progress_checker plugin declare .plugin only if not declared before Signed-off-by: Siddarth Gore <[email protected]> * Tweak plugin names/description in doc Signed-off-by: Siddarth Gore <[email protected]> * Follow pose (#1859) * Truncate path finished Signed-off-by: Francisco Martin Rico <[email protected]> * Follow Pose finished Signed-off-by: Francisco Martin Rico <[email protected]> * Change names. Add test and doc Signed-off-by: Francisco Martin Rico <[email protected]> * Change names and check atan2 values Signed-off-by: Francisco Martin Rico <[email protected]> * Checking Inf/NaNs and trucate path changes Signed-off-by: Francisco Martin Rico <[email protected]> * Revert changes in launcher Signed-off-by: Francisco Martin Rico <[email protected]> * Documenting Tree Signed-off-by: Francisco Martin Rico <[email protected]> * Update nav2_bt_navigator/README.md Co-authored-by: Steve Macenski <[email protected]> * Update nav2_bt_navigator/README.md Co-authored-by: Steve Macenski <[email protected]> * Change TruncatePath from decorator to action node Signed-off-by: Francisco Martin Rico <[email protected]> * Update nav2_bt_navigator/README.md Co-authored-by: Steve Macenski <[email protected]> Co-authored-by: Steve Macenski <[email protected]> * Remove Deprecated Declaration (#1884) * Remove deprecated rclcpp::executor::FutureReturnCode::SUCCESS in favor of rclcpp::FutureReturnCode::SUCCESS Signed-off-by: Hunter L. Allen <[email protected]> * Update nav2_util/include/nav2_util/service_client.hpp Co-authored-by: Sarthak Mittal <[email protected]> Co-authored-by: Sarthak Mittal <[email protected]> * Added new costmap buffer to resize map safely (#1837) * Added new costmap buffer to resize map safely Signed-off-by: Aitor Miguel Blanco <[email protected]> * Update map if the layer is not being processed. Signed-off-by: Aitor Miguel Blanco <[email protected]> * Updated bool name and added buffer initialization Signed-off-by: Aitor Miguel Blanco <[email protected]> * Fix dump params tests (#1886) Signed-off-by: Sarthak Mittal <[email protected]> * Move definitions in tf_help to separate src cpp file (#1890) * Move definitions of functions in tf_help to separate src cpp file to avoid multiple definition error * Fix linting issues * Make uncrustify happier * More format fixing * resolved the simulated motion into its x & y components (#1887) Signed-off-by: Marwan Taher <[email protected]> * Fix nav2_bt_navigator cleanup (#1901) Signed-off-by: Sarthak Mittal <[email protected]> * Adding some more test coverage (#1903) * more tests * removing old cmake * remove on_errors in specific servers in favor of a general lifecycle warning (#1904) * remove on_errors in favor of a general lifecycle warning * adding removed thing * simply nodes to remove lines (#1907) * Bunches of random new tests (#1909) * trying to get A* to work again * make flake 8 happy * adding cancel and preempt test * planner tests use A* * adding A* note * test with topic * Adding failure to navigate test (#1912) * failures tests * adding copyrights * cancel test in recoveries * Costmap lock while copying data in navfn planner (#1913) * acquire the costmap lock while copying data in navfn planner Signed-off-by: Daisuke Sato <[email protected]> * add costmap lock to dwb local plannger Signed-off-by: Daisuke Sato <[email protected]> * Added map_topic parameters to static layer and amcl (#1910) * see if spin some in cancel will allow result callback (#1914) * Adding near-complete voxel grid test coverage and more to controller server (#1915) * remove erraneous handling done by prior * adding a bunch of voxel unit tests * retrigger * adding waypoint follower failure test, voxel layer integration tests, etc (#1916) * adding waypoint follower failure test * adding voxel, more logging * reset -> clear * minor changes to lower redundent warnings (#1918) * Costmap plugins declare if not declared for reset capabilities (#1919) * fixing #1917 on declare if not declared * fix API * adding CLI test (#1920) * More coverage in map server tests (#1921) * adding CLI test * adding a bunch of new coverages for map_server * Add in range sensor costmap layer (#1888) * range costmap building * range sensor layer working * nav2 costmap pass linter and uncrustify tests * Added back semicolon to range class * Added docs * Added angles dependency * Added BSD license * Added BSD license * Made functions inline * revmoed get_clock * added input_sensor_type to docs * Made defualt topic name empty to cause error * using chorno literal to denote time units * Added small initial test * Fixed linter error, line breaks, enum, logger level, and transform_tolerance issue * fixed segmentation fault in test and added transfrom tolerances to tf_->transform * Got test to pass * Added more tests * removed incorrect parameter declaration * Improved marking while moving tests and added clearing tests * removed general clearing test * changed testing helper import in test * [Test sprint] push nav2_map_server over 90% (#1922) * adding CLI test * adding tests for more lines to map_server * fix last test * adding out of bounds and higher bounds checks * adding planner tests for plugins working * add cleanup * working * ping * [testing sprint] final test coverage and debug logging in planner/controller servers (#1924) * adding CLI test * adding tests for more lines to map_server * fix last test * adding out of bounds and higher bounds checks * adding planner tests for plugins working * add cleanup * working * ping * adding more testing and debug info messages * [testing sprint] remove dead code not used in 10 years from navfn (#1926) * remove dead code not used in 10 years from navfn * ping * inverting period to rate * removing debug statement that could never be triggered by a single non-looping action server * type change * adding removed files * bump to 0.4.2 * add another missing file * add missing files * remove some tests * lint * removing nav2_bringup from binaries Co-authored-by: Michael Equi <[email protected]> Co-authored-by: Sarthak Mittal <[email protected]> Co-authored-by: Daisuke Sato <[email protected]> Co-authored-by: Ruffin <[email protected]> Co-authored-by: Siddarth Gore <[email protected]> Co-authored-by: Francisco Martín Rico <[email protected]> Co-authored-by: Hunter L. Allen <[email protected]> Co-authored-by: Aitor Miguel Blanco <[email protected]> Co-authored-by: Joe Smallman <[email protected]> Co-authored-by: Marwan Taher <[email protected]>
1 parent aa9394a commit 671dde6

File tree

168 files changed

+5823
-937
lines changed

Some content is hidden

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

168 files changed

+5823
-937
lines changed

.circleci/config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ references:
7575
rosdep install -q -y \
7676
--from-paths src \
7777
--ignore-src \
78+
--skip-keys " \
79+
slam_toolbox \
80+
" \
7881
--verbose | \
7982
awk '$1 ~ /^resolution\:/' | \
8083
awk -F'[][]' '{print $2}' | \

.github/ISSUE_TEMPLATE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ For Bug report or feature requests, please fill out the relevant category below
1111

1212
- Operating System:
1313
- <!-- OS and version (e.g. Windows 10, Ubuntu 16.04...) -->
14+
- ROS2 Version:
15+
- <!-- ROS2 distribution and install method (e.g. Foxy binaries, Dashing source...) -->
1416
- Version or commit hash:
1517
- <!-- from source: output of `git -C navigation2 rev-parse HEAD
1618
apt binaries: output of: dpkg-query --show "ros-$ROS_DISTRO-navigation2"

Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ COPY --from=cacher /tmp/$UNDERLAY_WS ./
5050
RUN . /opt/ros/$ROS_DISTRO/setup.sh && \
5151
apt-get update && rosdep install -q -y \
5252
--from-paths src \
53+
--skip-keys " \
54+
slam_toolbox \
55+
" \
5356
--ignore-src \
5457
&& rm -rf /var/lib/apt/lists/*
5558

@@ -75,6 +78,9 @@ RUN . $UNDERLAY_WS/install/setup.sh && \
7578
apt-get update && rosdep install -q -y \
7679
--from-paths src \
7780
$UNDERLAY_WS/src \
81+
--skip-keys " \
82+
slam_toolbox \
83+
"\
7884
--ignore-src \
7985
&& rm -rf /var/lib/apt/lists/*
8086

README.md

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

doc/parameters/param_list.md

Lines changed: 69 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,13 @@ For example:
5151
```yaml
5252
local_costmap:
5353
ros__parameters:
54-
plugins: ["obstacle_layer", "voxel_layer", "inflation_layer"]
54+
plugins: ["obstacle_layer", "voxel_layer", "sonar_layer", "inflation_layer"]
5555
obstacle_layer:
5656
plugin: "nav2_costmap_2d::ObstacleLayer"
5757
voxel_layer:
5858
plugin: "nav2_costmap_2d::VoxelLayer"
59+
sonar_layer:
60+
plugin: "nav2_costmap_2d::RangeSensorLayer"
5961
inflation_layer:
6062
plugin: "nav2_costmap_2d::InflationLayer"
6163
```
@@ -78,6 +80,7 @@ When `plugins` parameter is not overridden, the following default plugins are lo
7880
| `<static layer>`.subscribe_to_updates | false | Subscribe to static map updates after receiving first |
7981
| `<static layer>`.map_subscribe_transient_local | true | QoS settings for map topic |
8082
| `<static layer>`.transform_tolerance | 0.0 | TF tolerance |
83+
| `<static layer>`.map_topic | "" | Name of the map topic to subscribe to (empty means use the map_topic defined by `costmap_2d_ros`) |
8184

8285
## inflation_layer plugin
8386

@@ -114,7 +117,23 @@ When `plugins` parameter is not overridden, the following default plugins are lo
114117
| `<data source>`.marking | true | Whether source should mark in costmap |
115118
| `<data source>`.clearing | false | Whether source should raytrace clear in costmap |
116119
| `<data source>`.obstacle_range | 2.5 | Maximum range to mark obstacles in costmap |
117-
| `<data source>`.raytrace_range | 3.0 | Maximum range to raytrace clear obstacles from costmap |
120+
| `<data source>`.raytrace_range | 3.0 | Maximum range to raytrace clear obstacles from costmap |
121+
122+
## range_sensor_layer plugin
123+
124+
* `<range layer>`: Name corresponding to the `nav2_costmap_2d::RangeSensorLayer` plugin. This name gets defined in `plugin_names`.
125+
126+
| Parameter | Default | Description |
127+
| ----------| --------| ------------|
128+
| `<range layer>`.enabled | true | Whether it is enabled |
129+
| `<range layer>`.topics | [""] | Range topics to subscribe to |
130+
| `<range layer>`.phi | 1.2 | Phi value |
131+
| `<range layer>`.inflate_cone | 1.0 | Inflate the triangular area covered by the sensor (percentage) |
132+
| `<range layer>`.no_readings_timeout | 0.0 | No Readings Timeout |
133+
| `<range layer>`.clear_threshold | 0.2 | Probability below which cells are marked as free |
134+
| `<range layer>`.mark_threshold | 0.8 | Probability above which cells are marked as occupied |
135+
| `<range layer>`.clear_on_max_reading | false | Clear on max reading |
136+
| `<range layer>`.input_sensor_type | ALL | Input sensor type either ALL (automatic selection), VARIABLE (min range != max range), or FIXED (min range == max range) |
118137

119138
## voxel_layer plugin
120139

@@ -154,12 +173,15 @@ When `plugins` parameter is not overridden, the following default plugins are lo
154173
| Parameter | Default | Description |
155174
| ----------| --------| ------------|
156175
| controller_frequency | 20.0 | Frequency to run controller |
176+
| progress_checker_plugin | "progress_checker" | Plugin used by the controller to check whether the robot has at least covered a set distance/displacement in a set amount of time, thus checking the progress of the robot. |
177+
| `<progress_checker_plugin>.plugin` | "nav2_controller::SimpleProgressChecker" | Default plugin |
178+
| goal_checker_plugin | "goal_checker" | Check if the goal has been reached |
179+
| `<goal_checker_plugin>.plugin` | "nav2_controller::SimpleGoalChecker" | Default plugin |
157180
| controller_plugins | ["FollowPath"] | List of mapped names for controller plugins for processing requests and parameters |
181+
| `<controller_plugins>.plugin` | "dwb_core::DWBLocalPlanner" | Default plugin |
158182
| min_x_velocity_threshold | 0.0001 | Minimum X velocity to use (m/s) |
159183
| min_y_velocity_threshold | 0.0001 | Minimum Y velocity to use (m/s) |
160184
| min_theta_velocity_threshold | 0.0001 | Minimum angular velocity to use (rad/s) |
161-
| required_movement_radius | 0.5 | Minimum amount a robot must move to be progressing to goal (m) |
162-
| movement_time_allowance | 10.0 | Maximum amount of time a robot has to move the minimum radius (s) |
163185

164186
**NOTE:** When `controller_plugins` parameter is overridden, each plugin namespace defined in the list needs to have a `plugin` parameter defining the type of plugin to be loaded in the namespace.
165187

@@ -173,11 +195,36 @@ controller_server:
173195
plugin: "dwb_core::DWBLocalPlanner"
174196
```
175197

176-
When `controller_plugins` parameter is not overridden, the following default plugins are loaded:
198+
When `controller_plugins`\`progress_checker_plugin`\`goal_checker_plugin` parameters are not overridden, the following default plugins are loaded:
177199

178200
| Namespace | Plugin |
179201
| ----------| --------|
180202
| "FollowPath" | "dwb_core::DWBLocalPlanner" |
203+
| "progress_checker" | "nav2_controller::SimpleProgressChecker" |
204+
| "goal_checker" | "nav2_controller::SimpleGoalChecker" |
205+
206+
## simple_progress_checker plugin
207+
208+
| Parameter | Default | Description |
209+
| ----------| --------| ------------|
210+
| `<nav2_controller plugin>`.required_movement_radius | 0.5 | Minimum distance to count as progress (m) |
211+
| `<nav2_controller plugin>`.movement_time_allowance | 10.0 | Maximum time allowence for progress to happen (s) |
212+
213+
214+
## simple_goal_checker plugin
215+
216+
| Parameter | Default | Description |
217+
| ----------| --------| ------------|
218+
| `<nav2_controller plugin>`.xy_goal_tolerance | 0.25 | Tolerance to meet goal completion criteria (m) |
219+
| `<nav2_controller plugin>`.yaw_goal_tolerance | 0.25 | Tolerance to meet goal completion criteria (rad) |
220+
| `<nav2_controller plugin>`.stateful | true | Whether to check for XY position tolerance after rotating to goal orientation in case of minor localization changes |
221+
222+
## stopped_goal_checker plugin
223+
224+
| Parameter | Default | Description |
225+
| ----------| --------| ------------|
226+
| `<nav2_controller plugin>`.rot_stopped_velocity | 0.25 | Velocity below is considered to be stopped at tolerance met (rad/s) |
227+
| `<nav2_controller plugin>`.trans_stopped_velocity | 0.25 | Velocity below is considered to be stopped at tolerance met (m/s) |
181228

182229
# dwb_controller
183230

@@ -193,7 +240,6 @@ When `controller_plugins` parameter is not overridden, the following default plu
193240
| `<dwb plugin>`.prune_distance | 1.0 | Distance (m) to prune backward until |
194241
| `<dwb plugin>`.debug_trajectory_details | false | Publish debug information |
195242
| `<dwb plugin>`.trajectory_generator_name | "dwb_plugins::StandardTrajectoryGenerator" | Trajectory generator plugin name |
196-
| `<dwb plugin>`.goal_checker_name | "dwb_plugins::SimpleGoalChecker" | Goal checker plugin name |
197243
| `<dwb plugin>`.transform_tolerance | 0.1 | TF transform tolerance |
198244
| `<dwb plugin>`.short_circuit_trajectory_evaluation | true | Stop evaluating scores after best score is found |
199245
| `<dwb plugin>`.path_distance_bias | N/A | Old version of `PathAlign.scale`, use that instead |
@@ -350,14 +396,6 @@ When `controller_plugins` parameter is not overridden, the following default plu
350396
| `<dwb plugin>`.lookahead_time | -1 | If > 0, amount of time to look forward for a collision for. |
351397
| `<dwb plugin>`.`<name>`.scale | 1.0 | Weight scale |
352398

353-
## simple_goal_checker plugin
354-
355-
| Parameter | Default | Description |
356-
| ----------| --------| ------------|
357-
| `<dwb plugin>`.xy_goal_tolerance | 0.25 | Tolerance to meet goal completion criteria (m) |
358-
| `<dwb plugin>`.yaw_goal_tolerance | 0.25 | Tolerance to meet goal completion criteria (rad) |
359-
| `<dwb plugin>`.stateful | true | Whether to check for XY position tolerance after rotating to goal orientation in case of minor localization changes |
360-
361399
## standard_traj_generator plugin
362400

363401
| Parameter | Default | Description |
@@ -375,13 +413,6 @@ When `controller_plugins` parameter is not overridden, the following default plu
375413
| ----------| --------| ------------|
376414
| `<dwb plugin>`.sim_time | N/A | Time to simulate ahead by (s) |
377415

378-
## stopped_goal_checker plugin
379-
380-
| Parameter | Default | Description |
381-
| ----------| --------| ------------|
382-
| `<dwb plugin>`.rot_stopped_velocity | 0.25 | Velocity below is considered to be stopped at tolerance met (rad/s) |
383-
| `<dwb plugin>`.trans_stopped_velocity | 0.25 | Velocity below is considered to be stopped at tolerance met (m/s) |
384-
385416
# lifecycle_manager
386417

387418
| Parameter | Default | Description |
@@ -547,6 +578,8 @@ When `recovery_plugins` parameter is not overridden, the following default plugi
547578
| z_rand | 0.5 | Mixture weight for z_rand part of model, sum of all used z weight must be 1. Beam uses all 4, likelihood model uses z_hit and z_rand. |
548579
| z_short | 0.05 | Mixture weight for z_short part of model, sum of all used z weight must be 1. Beam uses all 4, likelihood model uses z_hit and z_rand. |
549580
| always_reset_initial_pose | false | Requires that AMCL is provided an initial pose either via topic or initial_pose* parameter (with parameter set_initial_pose: true) when reset. Otherwise, by default AMCL will use the last known pose to initialize |
581+
| scan_topic | scan | Topic to subscribe to in order to receive the laser scan for localization |
582+
| map_topic | map | Topic to subscribe to in order to receive the map for localization |
550583

551584
---
552585

@@ -624,6 +657,14 @@ When `recovery_plugins` parameter is not overridden, the following default plugi
624657
| server_name | N/A | Action server name |
625658
| server_timeout | 10 | Action server timeout (ms) |
626659

660+
### BT Node TruncatePath
661+
662+
| Input Port | Default | Description |
663+
| ---------- | ------- | ----------- |
664+
| input_path | N/A | Path to be truncated |
665+
| output_path | N/A | Path truncated |
666+
| distance | 1.0 | Distance (m) to cut from last pose |
667+
627668
## Conditions
628669

629670
### BT Node GoalReached
@@ -674,3 +715,10 @@ When `recovery_plugins` parameter is not overridden, the following default plugi
674715
| min_speed | 0.0 | Minimum speed (m/s) |
675716
| max_speed | 0.5 | Maximum speed (m/s) |
676717
| filter_duration | 0.3 | Duration (secs) for velocity smoothing filter |
718+
719+
### BT Node GoalUpdater
720+
721+
| Input Port | Default | Description |
722+
| ---------- | ------- | ----------- |
723+
| input_goal | N/A | The reference goal |
724+
| output_goal | N/A | The reference goal, or a newer goal received by subscription |

nav2_amcl/include/nav2_amcl/amcl_node.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ class AmclNode : public nav2_util::LifecycleNode
6666
nav2_util::CallbackReturn on_deactivate(const rclcpp_lifecycle::State & state) override;
6767
nav2_util::CallbackReturn on_cleanup(const rclcpp_lifecycle::State & state) override;
6868
nav2_util::CallbackReturn on_shutdown(const rclcpp_lifecycle::State & state) override;
69-
nav2_util::CallbackReturn on_error(const rclcpp_lifecycle::State & state) override;
7069

7170
// Since the sensor data from gazebo or the robot is not lifecycle enabled, we won't
7271
// respond until we're in the active state
@@ -167,7 +166,6 @@ class AmclNode : public nav2_util::LifecycleNode
167166

168167
// Laser scan related
169168
void initLaserScan();
170-
const char * scan_topic_{"scan"};
171169
nav2_amcl::Laser * createLaserObject();
172170
int scan_error_count_{0};
173171
std::vector<nav2_amcl::Laser *> lasers_;
@@ -250,6 +248,8 @@ class AmclNode : public nav2_util::LifecycleNode
250248
double z_max_;
251249
double z_short_;
252250
double z_rand_;
251+
std::string scan_topic_{"scan"};
252+
std::string map_topic_{"map"};
253253
};
254254

255255
} // namespace nav2_amcl

nav2_amcl/package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
33
<package format="3">
44
<name>nav2_amcl</name>
5-
<version>0.4.1</version>
5+
<version>0.4.2</version>
66
<description>
77
<p>
88
amcl is a probabilistic localization system for a robot moving in

nav2_amcl/src/amcl_node.cpp

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,14 @@ AmclNode::AmclNode()
213213
"Requires that AMCL is provided an initial pose either via topic or initial_pose* parameter "
214214
"(with parameter set_initial_pose: true) when reset. Otherwise, by default AMCL will use the"
215215
"last known pose to initialize");
216+
217+
add_parameter(
218+
"scan_topic", rclcpp::ParameterValue("scan"),
219+
"Topic to subscribe to in order to receive the laser scan for localization");
220+
221+
add_parameter(
222+
"map_topic", rclcpp::ParameterValue("map"),
223+
"Topic to subscribe to in order to receive the map to localize on");
216224
}
217225

218226
AmclNode::~AmclNode()
@@ -379,13 +387,6 @@ AmclNode::on_cleanup(const rclcpp_lifecycle::State & /*state*/)
379387
return nav2_util::CallbackReturn::SUCCESS;
380388
}
381389

382-
nav2_util::CallbackReturn
383-
AmclNode::on_error(const rclcpp_lifecycle::State & /*state*/)
384-
{
385-
RCLCPP_FATAL(get_logger(), "Lifecycle node entered error state");
386-
return nav2_util::CallbackReturn::SUCCESS;
387-
}
388-
389390
nav2_util::CallbackReturn
390391
AmclNode::on_shutdown(const rclcpp_lifecycle::State & /*state*/)
391392
{
@@ -1098,6 +1099,8 @@ AmclNode::initParameters()
10981099
get_parameter("z_short", z_short_);
10991100
get_parameter("first_map_only_", first_map_only_);
11001101
get_parameter("always_reset_initial_pose", always_reset_initial_pose_);
1102+
get_parameter("scan_topic", scan_topic_);
1103+
get_parameter("map_topic", map_topic_);
11011104

11021105
save_pose_period_ = tf2::durationFromSec(1.0 / save_pose_rate);
11031106
transform_tolerance_ = tf2::durationFromSec(tmp_tol);
@@ -1273,7 +1276,7 @@ AmclNode::initPubSub()
12731276
std::bind(&AmclNode::initialPoseReceived, this, std::placeholders::_1));
12741277

12751278
map_sub_ = create_subscription<nav_msgs::msg::OccupancyGrid>(
1276-
"map", rclcpp::QoS(rclcpp::KeepLast(1)).transient_local().reliable(),
1279+
map_topic_, rclcpp::QoS(rclcpp::KeepLast(1)).transient_local().reliable(),
12771280
std::bind(&AmclNode::mapReceived, this, std::placeholders::_1));
12781281

12791282
RCLCPP_INFO(get_logger(), "Subscribed to map topic.");

nav2_behavior_tree/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,12 @@ list(APPEND plugin_libs nav2_distance_controller_bt_node)
101101
add_library(nav2_speed_controller_bt_node SHARED plugins/decorator/speed_controller.cpp)
102102
list(APPEND plugin_libs nav2_speed_controller_bt_node)
103103

104+
add_library(nav2_truncate_path_action_bt_node SHARED plugins/action/truncate_path_action.cpp)
105+
list(APPEND plugin_libs nav2_truncate_path_action_bt_node)
106+
107+
add_library(nav2_goal_updater_node_bt_node SHARED plugins/decorator/goal_updater_node.cpp)
108+
list(APPEND plugin_libs nav2_goal_updater_node_bt_node)
109+
104110
add_library(nav2_recovery_node_bt_node SHARED plugins/control/recovery_node.cpp)
105111
list(APPEND plugin_libs nav2_recovery_node_bt_node)
106112

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// Copyright (c) 2018 Intel Corporation
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
#ifndef NAV2_BEHAVIOR_TREE__PLUGINS__ACTION__BACK_UP_ACTION_HPP_
16+
#define NAV2_BEHAVIOR_TREE__PLUGINS__ACTION__BACK_UP_ACTION_HPP_
17+
18+
#include <string>
19+
20+
#include "nav2_behavior_tree/bt_action_node.hpp"
21+
#include "nav2_msgs/action/back_up.hpp"
22+
23+
namespace nav2_behavior_tree
24+
{
25+
26+
class BackUpAction : public BtActionNode<nav2_msgs::action::BackUp>
27+
{
28+
public:
29+
BackUpAction(
30+
const std::string & xml_tag_name,
31+
const std::string & action_name,
32+
const BT::NodeConfiguration & conf);
33+
34+
void on_tick() override;
35+
36+
static BT::PortsList providedPorts()
37+
{
38+
return providedBasicPorts(
39+
{
40+
BT::InputPort<double>("backup_dist", 0.15, "Distance to backup"),
41+
BT::InputPort<double>("backup_speed", 0.025, "Speed at which to backup")
42+
});
43+
}
44+
};
45+
46+
} // namespace nav2_behavior_tree
47+
48+
#endif // NAV2_BEHAVIOR_TREE__PLUGINS__ACTION__BACK_UP_ACTION_HPP_

0 commit comments

Comments
 (0)