Skip to content

Commit 8d6c30c

Browse files
SteveMacenskiFiIipeRyanf55nlamprianBriceRenaudeau
authored andcommitted
Humble sync 7 August 4 1.1.9 (ros-navigation#3739)
* Fix map not showing on rviz when navigation is launched with namespace (ros-navigation#3620) * updating mppi's path angle critic for optional bidirectionality (ros-navigation#3624) * updating mppi's path angle critic for optional bidirectionality * Update README.md * fixing path angle critic's non-directional bias (ros-navigation#3632) * fixing path angle critic's non-directional bias * adding reformat * adapting goal critic for speed to goal (ros-navigation#3641) * adapting goal critic for speed to goal * retuning goal critic * add readme entries * Update critics_tests.cpp * Fix uninitialized value (ros-navigation#3651) * In NAV2, this warning is treated as an error Signed-off-by: Ryan Friedman <[email protected]> * Fix rviz panel node arguments (ros-navigation#3655) Signed-off-by: Nick Lamprianidis <[email protected]> * Reduce out-of-range log to DEBUG (ros-navigation#3656) * Adding nan twist rejection for velocity smoother and collision monitor (ros-navigation#3658) * adding nan twist rejection for velocity smoother and collision monitor * deref * MPPI: Support Exact Path Following For Feasible Plans (ros-navigation#3659) * alternative to path align critic for inversion control * fix default behavior (enforce_path_inversion: false) (ros-navigation#3643) Co-authored-by: Guillaume Doisy <[email protected]> * adding dyaw option for path alignment to incentivize following the path's intent where necessary * add docs for use path orientations * fix typo --------- Co-authored-by: Guillaume Doisy <[email protected]> Co-authored-by: Guillaume Doisy <[email protected]> * Fix smoother server tests (ros-navigation#3663) * Fix smoother server tests * Update test_smoother_server.cpp * nav2_bt_navigator: log current location on navigate_to_pose action initialization (ros-navigation#3720) It is very useful to know the current location considered by the bt_navigator for debug purposes. * nav2_behaviors: export all available plugins (ros-navigation#3716) It allows external packages to include those headers and create child classes through inheritance. * changing costmap layers private to protected (ros-navigation#3722) * adding error warnings around incorrect inflation layer setups in MPPI and Smac which impact performance substantially (ros-navigation#3728) * adding error warnings around incorrect inflation layer setups in MPPI and Smac which impact performance substantially * fix test failures * Update RewrittenYaml to support list rewrites (ros-navigation#3727) * allowing leaf key rewrites that aren't dcits (ros-navigation#3730) * adding checks on config and dynamic parameters for proper velocity and acceleration limits (ros-navigation#3731) * Fix Goal updater QoS (ros-navigation#3719) * Fix GoalUpdater QoS * Fixes * bumping Humble to 1.1.9 for release * fix merge conflict resolution in collision monitor node --------- Signed-off-by: Ryan Friedman <[email protected]> Signed-off-by: Nick Lamprianidis <[email protected]> Co-authored-by: Filipe Cerveira <[email protected]> Co-authored-by: Ryan <[email protected]> Co-authored-by: Nick Lamprianidis <[email protected]> Co-authored-by: BriceRenaudeau <[email protected]> Co-authored-by: Guillaume Doisy <[email protected]> Co-authored-by: Guillaume Doisy <[email protected]> Co-authored-by: DylanDeCoeyer-Quimesis <[email protected]> Co-authored-by: gyaanantia <[email protected]> Co-authored-by: Tony Najjar <[email protected]>
1 parent b09bb1b commit 8d6c30c

File tree

99 files changed

+766
-191
lines changed

Some content is hidden

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

99 files changed

+766
-191
lines changed

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>1.1.8</version>
5+
<version>1.1.9</version>
66
<description>
77
<p>
88
amcl is a probabilistic localization system for a robot moving in

nav2_behavior_tree/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_behavior_tree</name>
5-
<version>1.1.8</version>
5+
<version>1.1.9</version>
66
<description>TODO</description>
77
<maintainer email="[email protected]">Michael Jeronimo</maintainer>
88
<maintainer email="[email protected]">Carlos Orduno</maintainer>

nav2_behavior_tree/plugins/decorator/goal_updater_node.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ GoalUpdater::GoalUpdater(
4646
sub_option.callback_group = callback_group_;
4747
goal_sub_ = node_->create_subscription<geometry_msgs::msg::PoseStamped>(
4848
goal_updater_topic,
49-
10,
49+
rclcpp::SystemDefaultsQoS(),
5050
std::bind(&GoalUpdater::callback_updated_goal, this, _1),
5151
sub_option);
5252
}
@@ -59,8 +59,17 @@ inline BT::NodeStatus GoalUpdater::tick()
5959

6060
callback_group_executor_.spin_some();
6161

62-
if (rclcpp::Time(last_goal_received_.header.stamp) > rclcpp::Time(goal.header.stamp)) {
63-
goal = last_goal_received_;
62+
if (last_goal_received_.header.stamp != rclcpp::Time(0)) {
63+
auto last_goal_received_time = rclcpp::Time(last_goal_received_.header.stamp);
64+
auto goal_time = rclcpp::Time(goal.header.stamp);
65+
if (last_goal_received_time > goal_time) {
66+
goal = last_goal_received_;
67+
} else {
68+
RCLCPP_WARN(
69+
node_->get_logger(), "The timestamp of the received goal (%f) is older than the "
70+
"current goal (%f). Ignoring the received goal.",
71+
last_goal_received_time.seconds(), goal_time.seconds());
72+
}
6473
}
6574

6675
setOutput("output_goal", goal);

nav2_behavior_tree/test/plugins/decorator/test_goal_updater_node.cpp

Lines changed: 74 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -95,42 +95,101 @@ TEST_F(GoalUpdaterTestFixture, test_tick)
9595
</root>)";
9696

9797
tree_ = std::make_shared<BT::Tree>(factory_->createTreeFromText(xml_txt, config_->blackboard));
98+
auto goal_updater_pub =
99+
node_->create_publisher<geometry_msgs::msg::PoseStamped>("goal_update", 10);
98100

99101
// create new goal and set it on blackboard
100102
geometry_msgs::msg::PoseStamped goal;
101103
goal.header.stamp = node_->now();
102104
goal.pose.position.x = 1.0;
103105
config_->blackboard->set("goal", goal);
104106

105-
// tick until node succeeds
106-
while (tree_->rootNode()->status() != BT::NodeStatus::SUCCESS) {
107-
tree_->rootNode()->executeTick();
108-
}
109-
107+
// tick tree without publishing updated goal and get updated_goal
108+
tree_->rootNode()->executeTick();
110109
geometry_msgs::msg::PoseStamped updated_goal;
111110
config_->blackboard->get("updated_goal", updated_goal);
111+
}
112112

113-
EXPECT_EQ(updated_goal, goal);
113+
TEST_F(GoalUpdaterTestFixture, test_older_goal_update)
114+
{
115+
// create tree
116+
std::string xml_txt =
117+
R"(
118+
<root main_tree_to_execute = "MainTree" >
119+
<BehaviorTree ID="MainTree">
120+
<GoalUpdater input_goal="{goal}" output_goal="{updated_goal}">
121+
<AlwaysSuccess/>
122+
</GoalUpdater>
123+
</BehaviorTree>
124+
</root>)";
125+
126+
tree_ = std::make_shared<BT::Tree>(factory_->createTreeFromText(xml_txt, config_->blackboard));
127+
auto goal_updater_pub =
128+
node_->create_publisher<geometry_msgs::msg::PoseStamped>("goal_update", 10);
129+
130+
// create new goal and set it on blackboard
131+
geometry_msgs::msg::PoseStamped goal;
132+
goal.header.stamp = node_->now();
133+
goal.pose.position.x = 1.0;
134+
config_->blackboard->set("goal", goal);
114135

136+
// publish updated_goal older than goal
115137
geometry_msgs::msg::PoseStamped goal_to_update;
116-
goal_to_update.header.stamp = node_->now();
138+
goal_to_update.header.stamp = rclcpp::Time(goal.header.stamp) - rclcpp::Duration(1, 0);
117139
goal_to_update.pose.position.x = 2.0;
118140

141+
goal_updater_pub->publish(goal_to_update);
142+
tree_->rootNode()->executeTick();
143+
geometry_msgs::msg::PoseStamped updated_goal;
144+
config_->blackboard->get("updated_goal", updated_goal);
145+
146+
// expect to succeed and not update goal
147+
EXPECT_EQ(tree_->rootNode()->status(), BT::NodeStatus::SUCCESS);
148+
EXPECT_EQ(updated_goal, goal);
149+
}
150+
151+
TEST_F(GoalUpdaterTestFixture, test_get_latest_goal_update)
152+
{
153+
// create tree
154+
std::string xml_txt =
155+
R"(
156+
<root main_tree_to_execute = "MainTree" >
157+
<BehaviorTree ID="MainTree">
158+
<GoalUpdater input_goal="{goal}" output_goal="{updated_goal}">
159+
<AlwaysSuccess/>
160+
</GoalUpdater>
161+
</BehaviorTree>
162+
</root>)";
163+
164+
tree_ = std::make_shared<BT::Tree>(factory_->createTreeFromText(xml_txt, config_->blackboard));
119165
auto goal_updater_pub =
120166
node_->create_publisher<geometry_msgs::msg::PoseStamped>("goal_update", 10);
121167

122-
auto start = node_->now();
123-
while ((node_->now() - start).seconds() < 0.5) {
124-
tree_->rootNode()->executeTick();
125-
goal_updater_pub->publish(goal_to_update);
168+
// create new goal and set it on blackboard
169+
geometry_msgs::msg::PoseStamped goal;
170+
goal.header.stamp = node_->now();
171+
goal.pose.position.x = 1.0;
172+
config_->blackboard->set("goal", goal);
126173

127-
rclcpp::spin_some(node_);
128-
}
174+
// publish updated_goal older than goal
175+
geometry_msgs::msg::PoseStamped goal_to_update_1;
176+
goal_to_update_1.header.stamp = node_->now();
177+
goal_to_update_1.pose.position.x = 2.0;
178+
179+
geometry_msgs::msg::PoseStamped goal_to_update_2;
180+
goal_to_update_2.header.stamp = node_->now();
181+
goal_to_update_2.pose.position.x = 3.0;
129182

183+
goal_updater_pub->publish(goal_to_update_1);
184+
goal_updater_pub->publish(goal_to_update_2);
185+
tree_->rootNode()->executeTick();
186+
geometry_msgs::msg::PoseStamped updated_goal;
130187
config_->blackboard->get("updated_goal", updated_goal);
131188

132-
EXPECT_NE(updated_goal, goal);
133-
EXPECT_EQ(updated_goal, goal_to_update);
189+
// expect to succeed
190+
EXPECT_EQ(tree_->rootNode()->status(), BT::NodeStatus::SUCCESS);
191+
// expect to update goal with latest goal update
192+
EXPECT_EQ(updated_goal, goal_to_update_2);
134193
}
135194

136195
int main(int argc, char ** argv)

nav2_behaviors/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_behaviors</name>
5-
<version>1.1.8</version>
5+
<version>1.1.9</version>
66
<description>TODO</description>
77
<maintainer email="[email protected]">Carlos Orduno</maintainer>
88
<maintainer email="[email protected]">Steve Macenski</maintainer>

0 commit comments

Comments
 (0)