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: enable vehicle engage on manual driving #1051

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
23f96c0
Merge pull request #1 from autowarefoundation/tier4/proposal
kenji-miyake Jan 24, 2022
a0fe549
Merge pull request #3 from autowarefoundation/tier4/proposal
kenji-miyake Jan 26, 2022
33549de
ci: add sync-upstream.yaml (#4)
kenji-miyake Jan 29, 2022
355609b
Merge pull request #5 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Feb 8, 2022
b6beeec
Merge pull request #11 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Feb 15, 2022
f371839
Merge pull request #13 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Feb 28, 2022
acf26ea
ci(sync-upstream): update settings (#19)
kenji-miyake Mar 3, 2022
f92e938
Merge pull request #17 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Mar 4, 2022
26c6541
Merge pull request #20 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Mar 18, 2022
8082bea
Merge pull request #27 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Mar 18, 2022
d065ddd
Merge pull request #29 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Apr 4, 2022
4c1d0cb
Merge pull request #30 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Apr 5, 2022
4a3e529
chore: sync files (#629)
awf-autoware-bot[bot] Apr 5, 2022
3dea07d
chore: sync files (#637)
awf-autoware-bot[bot] Apr 6, 2022
f037c18
fix(dummy_diag_publisher): use anon to make unique node name instead …
h-ohta Apr 6, 2022
0c2022a
Merge pull request #32 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Apr 6, 2022
a4e7e2f
Merge branch 'tier4/main' into sync-upstream
yn-mrse Apr 8, 2022
b9fb070
Merge pull request #33 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Apr 8, 2022
840d3e9
Merge pull request #35 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Apr 8, 2022
3a37242
chore: sync files (#648)
awf-autoware-bot[bot] Apr 9, 2022
a827200
fix(autoware_state_panel): fix message type for /api/autoware/get/eng…
h-ohta Apr 11, 2022
cc39553
Merge pull request #36 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Apr 11, 2022
75b9e2d
Merge pull request #37 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Apr 18, 2022
8278cce
Merge pull request #39 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Apr 26, 2022
e0ad67a
Merge pull request #41 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Apr 26, 2022
6174d32
Merge pull request #42 from tier4/sync-upstream
tier4-autoware-public-bot[bot] May 8, 2022
65e6d7b
Merge pull request #43 from tier4/sync-upstream
tier4-autoware-public-bot[bot] May 9, 2022
9f5837f
fix(behavior_velocity): avoid insert same point on trajectory utils (…
taikitanaka3 May 9, 2022
69fc674
refactor(behavior_velocity_planner): simplify CMakeLists.txt (#855)
kenji-miyake May 9, 2022
063a95d
fix(system_monitor): fix build error on tegra platform (#869)
Sharrrrk May 9, 2022
35a1f0a
feat(ad_service_state_monitor): limit odometry buffer size (#514)
takayuki5168 May 9, 2022
82c6ad8
docs: fix 404 error caused by typo in url (#871)
Shin-kyoto May 9, 2022
a7118b6
fix(image_projection_based_fusion): set imagebuffersize (#820)
storrrrrrrrm May 9, 2022
8809673
chore(avoidance_module): fix spell check (#732)
zulfaqar-azmi-t4 May 9, 2022
cc43203
feat: isolate gtests in all packages (#693)
maxime-clem May 9, 2022
0786fa1
docs(virtual traffic light): add documentation (#245)
taikitanaka3 May 9, 2022
4f4644f
feat(surround_obstacle_checker): separate surround_obstacle_checker f…
satoshi-ota May 9, 2022
1f5ade6
feat: remove deprecated package in prediction launch (#875)
yukkysaito May 10, 2022
399c133
fix(surround_obstacle_checker): fix ego footprint polygon (#877)
satoshi-ota May 10, 2022
eca2944
fix: update nvinfer api (#863)
wep21 May 10, 2022
3e5e6db
fix(avoidance_module): ignore object instead of creating zero shift (…
zulfaqar-azmi-t4 May 10, 2022
7b81507
fix(motion_velocity_smoother): curve deceleration not working with a …
TakaHoribe May 10, 2022
6668873
test(autoware_testing): fix smoke_test (#479)
KeisukeShima May 10, 2022
31147a2
feat(rviz_plugins): add velocity limit to autoware state panel (#879)
taikitanaka3 May 11, 2022
da41a37
fix(dummy_perception_publisher): publish multiple layers of pointclou…
HiroIshida May 11, 2022
e2e557d
feat(vehicle_info_util): add max_steer_angle (#740)
takayuki5168 May 11, 2022
952510b
ci(deploy-docs): remove mdx_unimoji (#883)
shmpwk May 11, 2022
b2727f0
chore: sync files (#884)
awf-autoware-bot[bot] May 11, 2022
ae80db9
fix(lidar_centerpoint): fix google drive url to avoid 404 (#889)
h-ohta May 12, 2022
c396b9d
chore: fix typos (#886)
badai-nguyen May 12, 2022
ffb0553
feat(state_rviz_plugin): add GateMode and PathChangeApproval Button (…
h-ohta May 13, 2022
80f3f1c
feat(map_tf_generator): accelerate the 'viewer' coordinate calculatio…
IshitaTakeshi May 13, 2022
ef37953
docs(obstacle_stop_planner): update documentation (#880)
satoshi-ota May 13, 2022
9470442
docs(tier4_traffic_light_rviz_plugin): update documentation (#905)
satoshi-ota May 16, 2022
e1e81b3
fix(accel_brake_map_calibrator): rviz panel type (#895)
soblin May 16, 2022
55d807e
fix(behavior velocity planner): skipping emplace back stop reason if …
TakumiKozaka-T4 May 17, 2022
f1d2b9e
feat(behavior_path_planner): weakened noise filtering of drivable are…
takayuki5168 May 17, 2022
0621852
Merge pull request #44 from tier4/sync-upstream
tier4-autoware-public-bot[bot] May 18, 2022
db25a76
Merge branch 'tier4/main' into sync-upstream
YoheiMishina May 24, 2022
fefdd4d
Merge pull request #47 from tier4/sync-upstream
tier4-autoware-public-bot[bot] May 24, 2022
ef98592
Merge pull request #49 from tier4/sync-upstream
tier4-autoware-public-bot[bot] May 25, 2022
e79a765
Merge branch 'tier4/main' into sync-upstream
naokimatsunawa May 27, 2022
fe49f69
Merge pull request #50 from tier4/sync-upstream
tier4-autoware-public-bot[bot] May 27, 2022
b4bea5a
Merge pull request #51 from tier4/sync-upstream
tier4-autoware-public-bot[bot] May 30, 2022
7fe260b
Merge pull request #52 from tier4/sync-upstream
tier4-autoware-public-bot[bot] May 31, 2022
8f41322
Merge pull request #54 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Jun 1, 2022
8de82e6
Merge pull request #55 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Jun 8, 2022
5a19f03
add control-mode in simulator
TakaHoribe Jun 8, 2022
feb5017
precommit
TakaHoribe Jun 8, 2022
6565ff1
update
TakaHoribe Jun 9, 2022
a7c5a03
Merge branch 'tier4/main' into sync-upstream
yn-mrse Jun 10, 2022
79f8f88
Merge pull request #61 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Jun 10, 2022
266adbc
Merge pull request #63 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Jun 10, 2022
c8021d4
Merge pull request #64 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Jun 13, 2022
41f2d18
update readme
TakaHoribe Jun 14, 2022
4645a80
Merge pull request #65 from tier4/sync-upstream
tier4-autoware-public-bot[bot] Jun 17, 2022
2eb38c6
[vehicle_cmd_gate] add transition filter
TakaHoribe Jun 9, 2022
71cf46c
[engage_transition_manager] add pkg
TakaHoribe Jun 9, 2022
a87fae9
update
TakaHoribe Jun 9, 2022
31d2a3f
fix gate
TakaHoribe Jun 14, 2022
bbf0f58
[vehicle_cmd_filter] minor refactor
TakaHoribe Jun 14, 2022
6550a2c
tmp
TakaHoribe Jun 20, 2022
d42eba1
change name
TakaHoribe Jun 20, 2022
c217bc8
Merge remote-tracking branch 'origin/feature/simulator-control-mode' …
TakaHoribe Jun 20, 2022
a01af41
update state_transition_manager
TakaHoribe Jun 20, 2022
a1e7e56
[TMP] update simple_planning_simulator
TakaHoribe Jun 20, 2022
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
28 changes: 28 additions & 0 deletions .github/workflows/sync-upstream.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: sync-upstream

on:
schedule:
- cron: 0 0 * * *
workflow_dispatch:

jobs:
sync-upstream:
runs-on: ubuntu-latest
steps:
- name: Generate token
id: generate-token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}

- name: Run sync-branches
uses: autowarefoundation/autoware-github-actions/sync-branches@v1
with:
token: ${{ steps.generate-token.outputs.token }}
base-branch: tier4/main
sync-pr-branch: sync-upstream
sync-target-repository: https://github.com/autowarefoundation/autoware.universe.git
sync-target-branch: main
pr-title: "chore: sync upstream"
auto-merge-method: merge
43 changes: 43 additions & 0 deletions control/engage_transition_manager/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
cmake_minimum_required(VERSION 3.14)
project(engage_transition_manager)

find_package(autoware_cmake REQUIRED)
autoware_package()

ament_auto_add_library(engage_transition_manager_node SHARED
src/engage_transition_manager.cpp
src/state.cpp
src/data.cpp
)

rclcpp_components_register_node(engage_transition_manager_node
PLUGIN "engage_transition_manager::EngageTransitionManager"
EXECUTABLE engage_transition_manager_exe
)

rosidl_generate_interfaces(
${PROJECT_NAME}
"msg/EngageTransitionManagerDebug.msg"
DEPENDENCIES builtin_interfaces
)

if(${rosidl_cmake_VERSION} VERSION_LESS 2.5.0)
rosidl_target_interfaces(engage_transition_manager_node
${PROJECT_NAME} "rosidl_typesupport_cpp")
else()
rosidl_get_typesupport_target(
cpp_typesupport_target ${PROJECT_NAME} "rosidl_typesupport_cpp")
target_link_libraries(engage_transition_manager_node "${cpp_typesupport_target}")
endif()


if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()

ament_auto_package(
INSTALL_TO_SHARE
launch
config
)
1 change: 1 addition & 0 deletions control/engage_transition_manager/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# engage_transition_manager
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**:
ros__parameters:
frequency_hz: 10.0
engage_acceptable_limits:
dist_threshold: 2.0
yaw_threshold: 0.785
speed_threshold: 10.0
stable_check:
duration: 3.0
dist_threshold: 0.5
speed_threshold: 3.0
yaw_threshold: 0.314
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
// Copyright 2022 Autoware Foundation
//
// 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 ENGAGE_TRANSITION_MANAGER__DATA_HPP_
#define ENGAGE_TRANSITION_MANAGER__DATA_HPP_

#include "engage_transition_manager/msg/engage_transition_manager_debug.hpp"

#include <rclcpp/rclcpp.hpp>

#include <autoware_auto_planning_msgs/msg/trajectory.hpp>
#include <autoware_auto_control_msgs/msg/ackermann_control_command.hpp>
#include <autoware_auto_vehicle_msgs/msg/control_mode_report.hpp>
#include <autoware_auto_vehicle_msgs/srv/autonomy_mode_change.hpp>
#include <nav_msgs/msg/odometry.hpp>
#include <tier4_system_msgs/msg/operation_mode.hpp>
#include <tier4_system_msgs/srv/operation_mode_request.hpp>
#include <tier4_vehicle_msgs/msg/control_mode.hpp>
#include <tier4_vehicle_msgs/srv/control_mode_request.hpp>
#include <tier4_vehicle_msgs/msg/is_autonomous_available.hpp>

namespace engage_transition_manager
{

using nav_msgs::msg::Odometry;

using autoware_auto_planning_msgs::msg::Trajectory;
using autoware_auto_control_msgs::msg::AckermannControlCommand;
using autoware_auto_vehicle_msgs::msg::ControlModeReport;
using tier4_system_msgs::msg::OperationMode;
using tier4_system_msgs::srv::OperationModeRequest;
using tier4_vehicle_msgs::msg::ControlMode;
using tier4_vehicle_msgs::srv::ControlModeRequest;
using tier4_vehicle_msgs::msg::IsAutonomousAvailable;
using engage_transition_manager::msg::EngageTransitionManagerDebug;

enum class State {
STOP = 0,
MANUAL_DIRECT,
REMOTE_OPERATOR,
LOCAL_OPERATOR,
TRANSITION_TO_AUTO,
AUTONOMOUS,
};

struct Data
{
bool is_auto_available;
State requested_state;
Odometry kinematics;
Trajectory trajectory;
AckermannControlCommand control_cmd;
ControlModeReport current_control_mode;
};

struct EngageAcceptableParam
{
double dist_threshold = 2.0;
double speed_threshold = 10.0;
double yaw_threshold = 0.785;
double large_acc_threshold = 2.0;
};

struct StableCheckParam
{
double duration = 3.0;
double dist_threshold = 0.5;
double speed_threshold = 3.0;
double yaw_threshold = M_PI / 10.0;
};

uint8_t toMsg(const State s);
State toEnum(const OperationMode s);
std::string toStr(const State s);
bool isManual(const State s);
bool isAuto(const State s);

} // namespace engage_transition_manager

#endif // ENGAGE_TRANSITION_MANAGER__DATA_HPP_
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
// Copyright 2022 Autoware Foundation
//
// 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 ENGAGE_TRANSITION_MANAGER__ENGAGE_TRANSITION_MANAGER_HPP_
#define ENGAGE_TRANSITION_MANAGER__ENGAGE_TRANSITION_MANAGER_HPP_

#include "engage_transition_manager/msg/engage_transition_manager_debug.hpp"

#include <engage_transition_manager/data.hpp>
#include <engage_transition_manager/state.hpp>
#include <rclcpp/rclcpp.hpp>

#include <autoware_auto_control_msgs/msg/ackermann_control_command.hpp>
#include <autoware_auto_planning_msgs/msg/trajectory.hpp>
#include <nav_msgs/msg/odometry.hpp>
#include <tier4_system_msgs/msg/operation_mode.hpp>
#include <tier4_system_msgs/srv/operation_mode_request.hpp>
#include <tier4_vehicle_msgs/msg/control_mode.hpp>
#include <tier4_vehicle_msgs/srv/control_mode_request.hpp>
#include <tier4_vehicle_msgs/msg/is_autonomous_available.hpp>

namespace engage_transition_manager
{

// using nav_msgs::msg::Odometry;

// using autoware_auto_planning_msgs::msg::Trajectory;
// using autoware_auto_control_msgs::msg::AckermannControlCommand;
// using autoware_auto_vehicle_msgs::msg::ControlModeReport;
// using tier4_system_msgs::msg::OperationMode;
// using tier4_system_msgs::srv::OperationModeRequest;
// using tier4_vehicle_msgs::msg::IsAutonomousAvailable;
// using engage_transition_manager::msg::EngageTransitionManagerDebug;

class EngageTransitionManager : public rclcpp::Node
{
public:
explicit EngageTransitionManager(const rclcpp::NodeOptions & options);
~EngageTransitionManager() = default;

private:
rclcpp::Publisher<OperationMode>::SharedPtr pub_operation_mode_;
rclcpp::Publisher<IsAutonomousAvailable>::SharedPtr pub_auto_available_;
rclcpp::Publisher<EngageTransitionManagerDebug>::SharedPtr pub_debug_info_;
rclcpp::Subscription<Odometry>::SharedPtr sub_vehicle_kinematics_;
rclcpp::Subscription<Trajectory>::SharedPtr sub_trajectory_;
rclcpp::Subscription<AckermannControlCommand>::SharedPtr sub_control_cmd_;
rclcpp::Subscription<ControlModeReport>::SharedPtr sub_control_mode_;
rclcpp::Service<OperationModeRequest>::SharedPtr srv_mode_change_server_;
rclcpp::Client<OperationModeRequest>::SharedPtr srv_mode_change_client_;
rclcpp::TimerBase::SharedPtr timer_;

std::unique_ptr<EngageStateBase> engage_transition_manager_;

Data data_;

State updateState(const Data & data);
State getCurrentState() { return engage_transition_manager_->getCurrentState(); };

EngageAcceptableParam engage_acceptable_param_;
StableCheckParam stable_check_param_;

bool checkEngageAvailable();

void publishData();

// update information
void onTimer();

void onOperationModeRequest(
const OperationModeRequest::Request::SharedPtr request,
const OperationModeRequest::Response::SharedPtr response);

mutable EngageTransitionManagerDebug debug_info_;
};

} // namespace engage_transition_manager

#endif // ENGAGE_TRANSITION_MANAGER__ENGAGE_TRANSITION_MANAGER_HPP_
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
// Copyright 2022 Autoware Foundation
//
// 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 ENGAGE_TRANSITION_MANAGER__STATE_HPP_
#define ENGAGE_TRANSITION_MANAGER__STATE_HPP_

#include <engage_transition_manager/data.hpp>
#include <rclcpp/rclcpp.hpp>

#include <autoware_auto_planning_msgs/msg/trajectory.hpp>
#include <nav_msgs/msg/odometry.hpp>
#include <tier4_system_msgs/msg/operation_mode.hpp>
#include <tier4_system_msgs/srv/operation_mode_request.hpp>
#include <tier4_vehicle_msgs/srv/control_mode_request.hpp>

namespace engage_transition_manager
{
class EngageStateBase
{
public:
EngageStateBase(const State state, rclcpp::Node * node);
~EngageStateBase() = default;

virtual State update() = 0;

State getCurrentState() { return state_; };
void setData(const Data & data) { data_ = data; };
void setParam(const StableCheckParam & param) { stable_check_param_ = param; };

protected:
rclcpp::Client<ControlModeRequest>::SharedPtr srv_mode_change_client_;

rclcpp::Logger logger_;
rclcpp::Clock::SharedPtr clock_;

State state_;
Data data_;
StableCheckParam stable_check_param_;

State defaultUpdateOnManual();
bool sendAutonomousModeRequest();
bool sendManualModeRequest();
};

class NoneState : public EngageStateBase
{
public:
NoneState(rclcpp::Node * node) : EngageStateBase(State::STOP, node){};
State update() override { return defaultUpdateOnManual(); };
};

class RemoteState : public EngageStateBase
{
public:
RemoteState(rclcpp::Node * node) : EngageStateBase(State::REMOTE_OPERATOR, node){};
State update() override { return defaultUpdateOnManual(); };
};

class DirectState : public EngageStateBase
{
public:
DirectState(rclcpp::Node * node) : EngageStateBase(State::MANUAL_DIRECT, node){};
State update() override { return defaultUpdateOnManual(); };
};

class LocalState : public EngageStateBase
{
public:
LocalState(rclcpp::Node * node) : EngageStateBase(State::LOCAL_OPERATOR, node){};
State update() override { return defaultUpdateOnManual(); };
};

class TransitionState : public EngageStateBase
{
public:
TransitionState(rclcpp::Node * node) : EngageStateBase(State::TRANSITION_TO_AUTO, node){};
State update() override;

private:
std::unique_ptr<rclcpp::Time> stable_start_time_;
bool checkSystemStable();
};

class AutonomousState : public EngageStateBase
{
public:
AutonomousState(rclcpp::Node * node) : EngageStateBase(State::AUTONOMOUS, node){};
State update() override;
};

} // namespace engage_transition_manager

#endif // ENGAGE_TRANSITION_MANAGER__STATE_HPP_
Loading