forked from autowarefoundation/autoware.universe
-
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.
feat(behavior_velocity_planner): add velocity factors (autowarefounda…
…tion#1985) * (editting) add intersection_coordination to stop reason Signed-off-by: TakumiKozaka-T4 <[email protected]> * (editting) add intersection coordination to stop reasons Signed-off-by: TakumiKozaka-T4 <[email protected]> * (Editting) add v2x to stop reason Signed-off-by: TakumiKozaka-T4 <[email protected]> * (editting) add stop reason2 publisher Signed-off-by: TakumiKozaka-T4 <[email protected]> * (editting) add stop reason2 to scene modules Signed-off-by: TakumiKozaka-T4 <[email protected]> * add stop reason2 to obstacle stop planner and surround obstacle checker Signed-off-by: TakumiKozaka-T4 <[email protected]> * Modify files including unintended change by rebase Signed-off-by: TakumiKozaka-T4 <[email protected]> * ci(pre-commit): autofix * Modification 1: not to publsh vacant stop reason, 2: change default status in obstacle stop and surround obstacle checker Signed-off-by: TakumiKozaka-T4 <[email protected]> * fix error Signed-off-by: TakumiKozaka-T4 <[email protected]> * ci(pre-commit): autofix * modification for renaming stop_reason2 to motion_factor Signed-off-by: TakumiKozaka-T4 <[email protected]> * (Editting) rename variables Signed-off-by: TakumiKozaka-T4 <[email protected]> * bug fix Signed-off-by: TakumiKozaka-T4 <[email protected]> * (WIP) Add motion factor message. Modify scene modules due to new motion factor. Moving motion factor aggregator. Signed-off-by: TakumiKozaka-T4 <[email protected]> * (WIP) Save current work. Modify aggregator, CMakeList. Add launcher Signed-off-by: TakumiKozaka-T4 <[email protected]> * (WIP) Solved build error, but not launched Signed-off-by: TakumiKozaka-T4 <[email protected]> * (WIP) fixing error in launch Signed-off-by: TakumiKozaka-T4 <[email protected]> * (WIP) fixing error in launch Signed-off-by: TakumiKozaka-T4 <[email protected]> * (WIP) fixing launch error Signed-off-by: TakumiKozaka-T4 <[email protected]> * Fix error in launching motion factor aggregator Signed-off-by: TakumiKozaka-T4 <[email protected]> * Delete unnecessary comment-out in CMakelists. Change remapping in launcher. Signed-off-by: TakumiKozaka-T4 <[email protected]> * ci(pre-commit): autofix * pull the latest foundation/main Signed-off-by: TakumiKozaka-T4 <[email protected]> * (fix for pre-commit.ci) Add <memory> to motion_factor_aggregator.hpp Signed-off-by: TakumiKozaka-T4 <[email protected]> * ci(pre-commit): autofix * feat: add velocity factor interface Signed-off-by: Takagi, Isamu <[email protected]> * fix: fix build error Signed-off-by: Takagi, Isamu <[email protected]> * feat: stop sign Signed-off-by: Takagi, Isamu <[email protected]> * WIP Signed-off-by: Takagi, Isamu <[email protected]> * feat: update visualizer Signed-off-by: Takagi, Isamu <[email protected]> * feat: modify traffic light manager Signed-off-by: Takagi, Isamu <[email protected]> * feat: update velocity factors Signed-off-by: Takagi, Isamu <[email protected]> * feat: update api Signed-off-by: Takagi, Isamu <[email protected]> * feat: move adapi msgs Signed-off-by: Takagi, Isamu <[email protected]> * feat: remove old aggregator Signed-off-by: Takagi, Isamu <[email protected]> * feat: move api Signed-off-by: Takagi, Isamu <[email protected]> * feat: rename message Signed-off-by: Takagi, Isamu <[email protected]> * feat: add using Signed-off-by: Takagi, Isamu <[email protected]> * feat: add distance Signed-off-by: Takagi, Isamu <[email protected]> * feat: fix build error Signed-off-by: Takagi, Isamu <[email protected]> * feat: use nan as default distance Signed-off-by: Takagi, Isamu <[email protected]> * fix: set virtual traffic light detail Signed-off-by: Takagi, Isamu <[email protected]> * fix: remove debug code Signed-off-by: Takagi, Isamu <[email protected]> * fix: copyright Signed-off-by: Takagi, Isamu <[email protected]> Signed-off-by: TakumiKozaka-T4 <[email protected]> Signed-off-by: Takagi, Isamu <[email protected]> Co-authored-by: TakumiKozaka-T4 <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
9a5057e
commit 2dde073
Showing
26 changed files
with
253 additions
and
8 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
68 changes: 68 additions & 0 deletions
68
planning/behavior_velocity_planner/include/scene_module/velocity_factor_interface.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,68 @@ | ||
|
||
// Copyright 2022 TIER IV, Inc. | ||
// | ||
// 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 SCENE_MODULE__VELOCITY_FACTOR_INTERFACE_HPP_ | ||
#define SCENE_MODULE__VELOCITY_FACTOR_INTERFACE_HPP_ | ||
|
||
#include <rclcpp/rclcpp.hpp> | ||
|
||
#include <autoware_adapi_v1_msgs/msg/velocity_factor.hpp> | ||
#include <autoware_adapi_v1_msgs/msg/velocity_factor_array.hpp> | ||
#include <geometry_msgs/msg/pose.hpp> | ||
|
||
#include <mutex> | ||
#include <string> | ||
#include <vector> | ||
|
||
namespace behavior_velocity_planner | ||
{ | ||
|
||
using autoware_adapi_v1_msgs::msg::VelocityFactor; | ||
using autoware_adapi_v1_msgs::msg::VelocityFactorArray; | ||
using geometry_msgs::msg::Pose; | ||
using VelocityFactorType = VelocityFactor::_type_type; | ||
using VelocityFactorStatus = VelocityFactor::_status_type; | ||
|
||
class VelocityFactorInterface | ||
{ | ||
public: | ||
VelocityFactorInterface() { type_ = VelocityFactor::UNKNOWN; } | ||
|
||
VelocityFactor get() const { return velocity_factor_; } | ||
void init(const VelocityFactorType type) { type_ = type; } | ||
void reset() { velocity_factor_.type = VelocityFactor::UNKNOWN; } | ||
|
||
template <class T> | ||
void set( | ||
const T & points, const Pose & curr_pose, const Pose & stop_pose, | ||
const VelocityFactorStatus status, const std::string detail = "") | ||
{ | ||
const auto & curr_point = curr_pose.position; | ||
const auto & stop_point = stop_pose.position; | ||
velocity_factor_.type = type_; | ||
velocity_factor_.pose = stop_pose; | ||
velocity_factor_.distance = motion_utils::calcSignedArcLength(points, curr_point, stop_point); | ||
velocity_factor_.status = status; | ||
velocity_factor_.detail = detail; | ||
} | ||
|
||
private: | ||
VelocityFactorType type_; | ||
VelocityFactor velocity_factor_; | ||
}; | ||
|
||
} // namespace behavior_velocity_planner | ||
|
||
#endif // SCENE_MODULE__VELOCITY_FACTOR_INTERFACE_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
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
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
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.