-
Notifications
You must be signed in to change notification settings - Fork 691
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into mau/refactor/sensing/vehicle_velocity_converter
- Loading branch information
Showing
273 changed files
with
5,706 additions
and
1,857 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
51 changes: 51 additions & 0 deletions
51
.../autoware_motion_utils/include/autoware/motion_utils/factor/steering_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,51 @@ | ||
// 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 AUTOWARE__MOTION_UTILS__FACTOR__STEERING_FACTOR_INTERFACE_HPP_ | ||
#define AUTOWARE__MOTION_UTILS__FACTOR__STEERING_FACTOR_INTERFACE_HPP_ | ||
|
||
#include <autoware_adapi_v1_msgs/msg/planning_behavior.hpp> | ||
#include <autoware_adapi_v1_msgs/msg/steering_factor.hpp> | ||
#include <geometry_msgs/msg/pose.hpp> | ||
|
||
#include <string> | ||
|
||
namespace autoware::motion_utils | ||
{ | ||
|
||
using autoware_adapi_v1_msgs::msg::PlanningBehavior; | ||
using autoware_adapi_v1_msgs::msg::SteeringFactor; | ||
using SteeringFactorBehavior = SteeringFactor::_behavior_type; | ||
using SteeringFactorStatus = SteeringFactor::_status_type; | ||
using geometry_msgs::msg::Pose; | ||
|
||
class SteeringFactorInterface | ||
{ | ||
public: | ||
[[nodiscard]] SteeringFactor get() const { return steering_factor_; } | ||
void init(const SteeringFactorBehavior & behavior) { behavior_ = behavior; } | ||
void reset() { steering_factor_.behavior = PlanningBehavior::UNKNOWN; } | ||
|
||
void set( | ||
const std::array<Pose, 2> & pose, const std::array<double, 2> distance, | ||
const uint16_t direction, const uint16_t status, const std::string & detail = ""); | ||
|
||
private: | ||
SteeringFactorBehavior behavior_{SteeringFactor::UNKNOWN}; | ||
SteeringFactor steering_factor_{}; | ||
}; | ||
|
||
} // namespace autoware::motion_utils | ||
|
||
#endif // AUTOWARE__MOTION_UTILS__FACTOR__STEERING_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
32 changes: 32 additions & 0 deletions
32
common/autoware_motion_utils/src/factor/steering_factor_interface.cpp
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,32 @@ | ||
// 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. | ||
|
||
#include <autoware/motion_utils/factor/steering_factor_interface.hpp> | ||
|
||
namespace autoware::motion_utils | ||
{ | ||
void SteeringFactorInterface::set( | ||
const std::array<Pose, 2> & pose, const std::array<double, 2> distance, const uint16_t direction, | ||
const uint16_t status, const std::string & detail) | ||
{ | ||
steering_factor_.pose = pose; | ||
std::array<float, 2> converted_distance{0.0, 0.0}; | ||
for (int i = 0; i < 2; ++i) converted_distance[i] = static_cast<float>(distance[i]); | ||
steering_factor_.distance = converted_distance; | ||
steering_factor_.behavior = behavior_; | ||
steering_factor_.direction = direction; | ||
steering_factor_.status = status; | ||
steering_factor_.detail = detail; | ||
} | ||
} // namespace autoware::motion_utils |
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.