Skip to content

Commit a07358a

Browse files
feat(autoware_ad_api_specs): define operation mode interface (autowarefoundation#1570)
* feat(autoware_ad_api_msgs): define operation mode interface Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * fix: add message Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * Update common/autoware_ad_api_msgs/operation_mode/msg/OperationModeState.msg Co-authored-by: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com> * Update common/autoware_ad_api_msgs/operation_mode/msg/OperationModeState.msg Co-authored-by: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com> * feat: move adapi message Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> * feat: change message type Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp> Co-authored-by: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com>
1 parent 84a66fe commit a07358a

File tree

2 files changed

+123
-0
lines changed
  • common

2 files changed

+123
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
// Copyright 2022 TIER IV, Inc.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
#ifndef AUTOWARE_AD_API_SPECS__OPERATION_MODE_HPP_
16+
#define AUTOWARE_AD_API_SPECS__OPERATION_MODE_HPP_
17+
18+
#include <rclcpp/qos.hpp>
19+
20+
#include <autoware_adapi_v1_msgs/msg/operation_mode_state.hpp>
21+
#include <autoware_adapi_v1_msgs/srv/change_operation_mode.hpp>
22+
23+
namespace autoware_ad_api::operation_mode
24+
{
25+
26+
struct ChangeToStop
27+
{
28+
using Service = autoware_adapi_v1_msgs::srv::ChangeOperationMode;
29+
static constexpr char name[] = "/api/operation_mode/change_to_stop";
30+
};
31+
32+
struct ChangeToAutonomous
33+
{
34+
using Service = autoware_adapi_v1_msgs::srv::ChangeOperationMode;
35+
static constexpr char name[] = "/api/operation_mode/change_to_autonomous";
36+
};
37+
38+
struct ChangeToLocal
39+
{
40+
using Service = autoware_adapi_v1_msgs::srv::ChangeOperationMode;
41+
static constexpr char name[] = "/api/operation_mode/change_to_local";
42+
};
43+
44+
struct ChangeToRemote
45+
{
46+
using Service = autoware_adapi_v1_msgs::srv::ChangeOperationMode;
47+
static constexpr char name[] = "/api/operation_mode/change_to_remote";
48+
};
49+
50+
struct EnableAutowareControl
51+
{
52+
using Service = autoware_adapi_v1_msgs::srv::ChangeOperationMode;
53+
static constexpr char name[] = "/api/operation_mode/enable_autoware_control";
54+
};
55+
56+
struct DisableAutowareControl
57+
{
58+
using Service = autoware_adapi_v1_msgs::srv::ChangeOperationMode;
59+
static constexpr char name[] = "/api/operation_mode/disable_autoware_control";
60+
};
61+
62+
struct OperationModeState
63+
{
64+
using Message = autoware_adapi_v1_msgs::msg::OperationModeState;
65+
static constexpr char name[] = "/api/operation_mode/state";
66+
static constexpr size_t depth = 1;
67+
static constexpr auto reliability = RMW_QOS_POLICY_RELIABILITY_RELIABLE;
68+
static constexpr auto durability = RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL;
69+
};
70+
71+
} // namespace autoware_ad_api::operation_mode
72+
73+
#endif // AUTOWARE_AD_API_SPECS__OPERATION_MODE_HPP_
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// Copyright 2022 TIER IV, Inc.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
#ifndef COMPONENT_INTERFACE_SPECS__SYSTEM_HPP_
16+
#define COMPONENT_INTERFACE_SPECS__SYSTEM_HPP_
17+
18+
#include <rclcpp/qos.hpp>
19+
20+
#include <autoware_adapi_v1_msgs/msg/operation_mode_state.hpp>
21+
#include <tier4_system_msgs/srv/change_autoware_control.hpp>
22+
#include <tier4_system_msgs/srv/change_operation_mode.hpp>
23+
24+
namespace system_interface
25+
{
26+
27+
struct ChangeAutowareControl
28+
{
29+
using Service = tier4_system_msgs::srv::ChangeAutowareControl;
30+
static constexpr char name[] = "/system/operation_mode/change_autoware_control";
31+
};
32+
33+
struct ChangeOperationMode
34+
{
35+
using Service = tier4_system_msgs::srv::ChangeOperationMode;
36+
static constexpr char name[] = "/system/operation_mode/change_operation_mode";
37+
};
38+
39+
struct OperationModeState
40+
{
41+
using Message = autoware_adapi_v1_msgs::msg::OperationModeState;
42+
static constexpr char name[] = "/system/operation_mode/state";
43+
static constexpr size_t depth = 1;
44+
static constexpr auto reliability = RMW_QOS_POLICY_RELIABILITY_RELIABLE;
45+
static constexpr auto durability = RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL;
46+
};
47+
48+
} // namespace system_interface
49+
50+
#endif // COMPONENT_INTERFACE_SPECS__SYSTEM_HPP_

0 commit comments

Comments
 (0)