-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MPPI] Reworked Path Align Critic; 70% faster + Tracks Paths Better! …
…Edit: strike that, now 80% (#3872) * adding regenerate noise param + adding docs * fix tests * remove unnecessary normalization * Update optimizer.cpp * adding refactored path alignment critic * fix visualization bug * speed up another 30% * remove a little jitter * a few more small optimizaitons * fixing unit tests * retain legacy critic * adding tests for legacy
- Loading branch information
1 parent
461a7ba
commit 7009ffb
Showing
11 changed files
with
380 additions
and
47 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
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
2 changes: 1 addition & 1 deletion
2
nav2_mppi_controller/include/nav2_mppi_controller/critics/path_align_critic.hpp
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
60 changes: 60 additions & 0 deletions
60
nav2_mppi_controller/include/nav2_mppi_controller/critics/path_align_legacy_critic.hpp
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,60 @@ | ||
// Copyright (c) 2022 Samsung Research America, @artofnothingness Alexey Budyakov | ||
// | ||
// 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. | ||
|
||
#ifndef NAV2_MPPI_CONTROLLER__CRITICS__PATH_ALIGN_LEGACY_CRITIC_HPP_ | ||
#define NAV2_MPPI_CONTROLLER__CRITICS__PATH_ALIGN_LEGACY_CRITIC_HPP_ | ||
|
||
#include "nav2_mppi_controller/critic_function.hpp" | ||
#include "nav2_mppi_controller/models/state.hpp" | ||
#include "nav2_mppi_controller/tools/utils.hpp" | ||
|
||
namespace mppi::critics | ||
{ | ||
|
||
/** | ||
* @class mppi::critics::PathAlignLegacyCritic | ||
* @brief Critic objective function for aligning to the path. Note: | ||
* High settings of this will follow the path more precisely, but also makes it | ||
* difficult (or impossible) to deviate in the presence of dynamic obstacles. | ||
* This is an important critic to tune and consider in tandem with Obstacle. | ||
* This is the initial 'Legacy' implementation before replacement Oct 2023. | ||
*/ | ||
class PathAlignLegacyCritic : public CriticFunction | ||
{ | ||
public: | ||
/** | ||
* @brief Initialize critic | ||
*/ | ||
void initialize() override; | ||
|
||
/** | ||
* @brief Evaluate cost related to trajectories path alignment | ||
* | ||
* @param costs [out] add reference cost values to this tensor | ||
*/ | ||
void score(CriticData & data) override; | ||
|
||
protected: | ||
size_t offset_from_furthest_{0}; | ||
int trajectory_point_step_{0}; | ||
float threshold_to_consider_{0}; | ||
float max_path_occupancy_ratio_{0}; | ||
bool use_path_orientations_{false}; | ||
unsigned int power_{0}; | ||
float weight_{0}; | ||
}; | ||
|
||
} // namespace mppi::critics | ||
|
||
#endif // NAV2_MPPI_CONTROLLER__CRITICS__PATH_ALIGN_LEGACY_CRITIC_HPP_ |
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
Oops, something went wrong.