-
Notifications
You must be signed in to change notification settings - Fork 664
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(raw_vehicle_cmd_converter): add vehicle adaptor (#8782)
* feat(raw_vehicle_cmd_converter): add vehicle adaptor Signed-off-by: kosuke55 <[email protected]> sub operation status Signed-off-by: kosuke55 <[email protected]> * feat(raw_vehicle_cmd_converter): publish vehicle adaptor output Signed-off-by: kosuke55 <[email protected]> * use control horizon Signed-off-by: kosuke55 <[email protected]> * revert carla Signed-off-by: kosuke55 <[email protected]> * update docs Signed-off-by: kosuke55 <[email protected]> --------- Signed-off-by: kosuke55 <[email protected]>
- Loading branch information
Showing
9 changed files
with
169 additions
and
22 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
50 changes: 50 additions & 0 deletions
50
..._converter/include/autoware_raw_vehicle_cmd_converter/vehicle_adaptor/vehicle_adaptor.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,50 @@ | ||
// Copyright 2024 Tier IV, Inc. All rights reserved. | ||
// | ||
// 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_RAW_VEHICLE_CMD_CONVERTER__VEHICLE_ADAPTOR__VEHICLE_ADAPTOR_HPP_ | ||
#define AUTOWARE_RAW_VEHICLE_CMD_CONVERTER__VEHICLE_ADAPTOR__VEHICLE_ADAPTOR_HPP_ | ||
|
||
#include <autoware_adapi_v1_msgs/msg/operation_mode_state.hpp> | ||
#include <autoware_control_msgs/msg/control.hpp> | ||
#include <autoware_control_msgs/msg/control_horizon.hpp> | ||
#include <autoware_vehicle_msgs/msg/steering_report.hpp> | ||
#include <geometry_msgs/msg/accel_with_covariance_stamped.hpp> | ||
#include <nav_msgs/msg/odometry.hpp> | ||
|
||
namespace autoware::raw_vehicle_cmd_converter | ||
{ | ||
|
||
using autoware_adapi_v1_msgs::msg::OperationModeState; | ||
using autoware_control_msgs::msg::Control; | ||
using autoware_control_msgs::msg::ControlHorizon; | ||
using autoware_vehicle_msgs::msg::SteeringReport; | ||
using geometry_msgs::msg::AccelWithCovarianceStamped; | ||
using nav_msgs::msg::Odometry; | ||
|
||
class VehicleAdaptor | ||
{ | ||
public: | ||
VehicleAdaptor() = default; | ||
Control compensate( | ||
const Control & input_control_cmd, [[maybe_unused]] const Odometry & odometry, | ||
[[maybe_unused]] const AccelWithCovarianceStamped & accel, | ||
[[maybe_unused]] const double steering, | ||
[[maybe_unused]] const OperationModeState & operation_mode, | ||
[[maybe_unused]] const ControlHorizon & control_horizon); | ||
|
||
private: | ||
}; | ||
} // namespace autoware::raw_vehicle_cmd_converter | ||
|
||
#endif // AUTOWARE_RAW_VEHICLE_CMD_CONVERTER__VEHICLE_ADAPTOR__VEHICLE_ADAPTOR_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
32 changes: 32 additions & 0 deletions
32
vehicle/autoware_raw_vehicle_cmd_converter/src/vehicle_adaptor/vehicle_adaptor.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 2024 Tier IV, Inc. All rights reserved. | ||
// | ||
// 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_raw_vehicle_cmd_converter/vehicle_adaptor/vehicle_adaptor.hpp" | ||
|
||
#include <iostream> | ||
|
||
namespace autoware::raw_vehicle_cmd_converter | ||
{ | ||
Control VehicleAdaptor::compensate( | ||
const Control & input_control_cmd, [[maybe_unused]] const Odometry & odometry, | ||
[[maybe_unused]] const AccelWithCovarianceStamped & accel, [[maybe_unused]] const double steering, | ||
[[maybe_unused]] const OperationModeState & operation_mode, | ||
[[maybe_unused]] const ControlHorizon & control_horizon) | ||
{ | ||
// TODO(someone): implement the control command compensation | ||
Control output_control_cmd = input_control_cmd; | ||
std::cerr << "vehicle adaptor: compensate control command" << std::endl; | ||
return output_control_cmd; | ||
} | ||
} // namespace autoware::raw_vehicle_cmd_converter |