forked from tier4/autoware.universe
-
Notifications
You must be signed in to change notification settings - Fork 1
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 <takumi.kozaka@tier4.jp> * (editting) add intersection coordination to stop reasons Signed-off-by: TakumiKozaka-T4 <takumi.kozaka@tier4.jp> * (Editting) add v2x to stop reason Signed-off-by: TakumiKozaka-T4 <takumi.kozaka@tier4.jp> * (editting) add stop reason2 publisher Signed-off-by: TakumiKozaka-T4 <takumi.kozaka@tier4.jp> * (editting) add stop reason2 to scene modules Signed-off-by: TakumiKozaka-T4 <takumi.kozaka@tier4.jp> * add stop reason2 to obstacle stop planner and surround obstacle checker Signed-off-by: TakumiKozaka-T4 <takumi.kozaka@tier4.jp> * Modify files including unintended change by rebase Signed-off-by: TakumiKozaka-T4 <takumi.kozaka@tier4.jp> * 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 <takumi.kozaka@tier4.jp> * fix error Signed-off-by: TakumiKozaka-T4 <takumi.kozaka@tier4.jp> * ci(pre-commit): autofix * modification for renaming stop_reason2 to motion_factor Signed-off-by: TakumiKozaka-T4 <takumi.kozaka@tier4.jp> * (Editting) rename variables Signed-off-by: TakumiKozaka-T4 <takumi.kozaka@tier4.jp> * bug fix Signed-off-by: TakumiKozaka-T4 <takumi.kozaka@tier4.jp> * (WIP) Add motion factor message. Modify scene modules due to new motion factor. Moving motion factor aggregator. Signed-off-by: TakumiKozaka-T4 <takumi.kozaka@tier4.jp> * (WIP) Save current work. Modify aggregator, CMakeList. Add launcher Signed-off-by: TakumiKozaka-T4 <takumi.kozaka@tier4.jp> * (WIP) Solved build error, but not launched Signed-off-by: TakumiKozaka-T4 <takumi.kozaka@tier4.jp> * (WIP) fixing error in launch Signed-off-by: TakumiKozaka-T4 <takumi.kozaka@tier4.jp> * (WIP) fixing error in launch Signed-off-by: TakumiKozaka-T4 <takumi.kozaka@tier4.jp> * (WIP) fixing launch error Signed-off-by: TakumiKozaka-T4 <takumi.kozaka@tier4.jp> * Fix error in launching motion factor aggregator Signed-off-by: TakumiKozaka-T4 <takumi.kozaka@tier4.jp> * Delete unnecessary comment-out in CMakelists. Change remapping in launcher. Signed-off-by: TakumiKozaka-T4 <takumi.kozaka@tier4.jp> * ci(pre-commit): autofix * pull the latest foundation/main Signed-off-by: TakumiKozaka-T4 <takumi.kozaka@tier4.jp> * (fix for pre-commit.ci) Add <memory> to motion_factor_aggregator.hpp Signed-off-by: TakumiKozaka-T4 <takumi.kozaka@tier4.jp> * ci(pre-commit): autofix * feat: add velocity factor interface Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * fix: fix build error Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * feat: stop sign Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * WIP Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * feat: update visualizer Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * feat: modify traffic light manager Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * feat: update velocity factors Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * feat: update api Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * feat: move adapi msgs Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * feat: remove old aggregator Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * feat: move api Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * feat: rename message Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * feat: add using Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * feat: add distance Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * feat: fix build error Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * feat: use nan as default distance Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * fix: set virtual traffic light detail Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * fix: remove debug code Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * fix: copyright Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> Signed-off-by: TakumiKozaka-T4 <takumi.kozaka@tier4.jp> Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> Co-authored-by: TakumiKozaka-T4 <takumi.kozaka@tier4.jp> 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.