Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(autoware_ad_api_specs): define operation mode interface #1570

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
// 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_AD_API_SPECS__OPERATION_MODE_HPP_
#define AUTOWARE_AD_API_SPECS__OPERATION_MODE_HPP_

#include <rclcpp/qos.hpp>

#include <autoware_adapi_v1_msgs/msg/operation_mode_state.hpp>
#include <autoware_adapi_v1_msgs/srv/change_operation_mode.hpp>

namespace autoware_ad_api::operation_mode
{

struct ChangeToStop
{
using Service = autoware_adapi_v1_msgs::srv::ChangeOperationMode;
static constexpr char name[] = "/api/operation_mode/change_to_stop";
};

struct ChangeToAutonomous
{
using Service = autoware_adapi_v1_msgs::srv::ChangeOperationMode;
static constexpr char name[] = "/api/operation_mode/change_to_autonomous";
};

struct ChangeToLocal
{
using Service = autoware_adapi_v1_msgs::srv::ChangeOperationMode;
static constexpr char name[] = "/api/operation_mode/change_to_local";
};

struct ChangeToRemote
{
using Service = autoware_adapi_v1_msgs::srv::ChangeOperationMode;
static constexpr char name[] = "/api/operation_mode/change_to_remote";
};

struct EnableAutowareControl
{
using Service = autoware_adapi_v1_msgs::srv::ChangeOperationMode;
static constexpr char name[] = "/api/operation_mode/enable_autoware_control";
};

struct DisableAutowareControl
{
using Service = autoware_adapi_v1_msgs::srv::ChangeOperationMode;
static constexpr char name[] = "/api/operation_mode/disable_autoware_control";
};

struct OperationModeState
{
using Message = autoware_adapi_v1_msgs::msg::OperationModeState;
static constexpr char name[] = "/api/operation_mode/state";
static constexpr size_t depth = 1;
static constexpr auto reliability = RMW_QOS_POLICY_RELIABILITY_RELIABLE;
static constexpr auto durability = RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL;
};

} // namespace autoware_ad_api::operation_mode

#endif // AUTOWARE_AD_API_SPECS__OPERATION_MODE_HPP_
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// 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 COMPONENT_INTERFACE_SPECS__SYSTEM_HPP_
#define COMPONENT_INTERFACE_SPECS__SYSTEM_HPP_

#include <rclcpp/qos.hpp>

#include <autoware_adapi_v1_msgs/msg/operation_mode_state.hpp>
#include <tier4_system_msgs/srv/change_autoware_control.hpp>
#include <tier4_system_msgs/srv/change_operation_mode.hpp>

namespace system_interface
{

struct ChangeAutowareControl
{
using Service = tier4_system_msgs::srv::ChangeAutowareControl;
static constexpr char name[] = "/system/operation_mode/change_autoware_control";
};

struct ChangeOperationMode
{
using Service = tier4_system_msgs::srv::ChangeOperationMode;
static constexpr char name[] = "/system/operation_mode/change_operation_mode";
};

struct OperationModeState
{
using Message = autoware_adapi_v1_msgs::msg::OperationModeState;
static constexpr char name[] = "/system/operation_mode/state";
static constexpr size_t depth = 1;
static constexpr auto reliability = RMW_QOS_POLICY_RELIABILITY_RELIABLE;
static constexpr auto durability = RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL;
};

} // namespace system_interface

#endif // COMPONENT_INTERFACE_SPECS__SYSTEM_HPP_
isamu-takagi marked this conversation as resolved.
Show resolved Hide resolved