Apollo 11.0
自动驾驶开放平台
apollo::task_manager::CycleRoutingManager类 参考

#include <cycle_routing_manager.h>

apollo::task_manager::CycleRoutingManager 的协作图:

Public 成员函数

 CycleRoutingManager ()=default
 
common::Status Init (const localization::Pose &pose, const task_manager::CycleRoutingTask &cycle_routing_task)
 module initialization function
 
bool GetNewRouting (const localization::Pose &pose, external_command::LaneFollowCommand *lane_follow_command)
 Get new routing if the vehicle reaches the begin/end point
 
int GetCycle () const
 get remaining cycle number
 
virtual ~CycleRoutingManager ()=default
 destructor
 

详细描述

在文件 cycle_routing_manager.h37 行定义.

构造及析构函数说明

◆ CycleRoutingManager()

apollo::task_manager::CycleRoutingManager::CycleRoutingManager ( )
default

◆ ~CycleRoutingManager()

virtual apollo::task_manager::CycleRoutingManager::~CycleRoutingManager ( )
virtualdefault

destructor

成员函数说明

◆ GetCycle()

int apollo::task_manager::CycleRoutingManager::GetCycle ( ) const
inline

get remaining cycle number

返回
remaining cycle number

在文件 cycle_routing_manager.h58 行定义.

58{ return cycle_; }

◆ GetNewRouting()

bool apollo::task_manager::CycleRoutingManager::GetNewRouting ( const localization::Pose pose,
external_command::LaneFollowCommand lane_follow_command 
)

Get new routing if the vehicle reaches the begin/end point

返回
false/true

在文件 cycle_routing_manager.cc54 行定义.

56 {
57 AINFO << "GetNewRouting: localization_pose: " << pose.position().x() << " "
58 << pose.position().y() << ", begin point " << begin_point_.x() << " "
59 << begin_point_.y() << ", end point " << end_point_.x() << " "
60 << end_point_.y() << ", threshold "
61 << FLAGS_task_manager_threshold_for_destination_check
62 << ", allowed_to_send_routing_request " << is_allowed_to_route_;
63
64 if (is_allowed_to_route_) {
66 begin_point_, pose.position(),
67 FLAGS_task_manager_threshold_for_destination_check)) {
68 AINFO << "GetNewRouting: reach begin point."
69 << "Remaining cycles: " << cycle_;
70 lane_follow_command->CopyFrom(original_lane_follow_command_);
71 auto cur_point = lane_follow_command->mutable_way_point(0);
72 is_allowed_to_route_ = false;
73 return true;
74 }
75 } else {
77 end_point_, pose.position(),
78 FLAGS_task_manager_threshold_for_destination_check)) {
79 AINFO << "GetNewRouting: reach end point. "
80 << "Remaining cycles: " << cycle_;
81 lane_follow_command->clear_way_point();
82 auto cur_point = lane_follow_command->add_way_point();
83 cur_point->Clear();
84 cur_point->set_x(pose.position().x());
85 cur_point->set_y(pose.position().y());
86 cur_point->set_heading(pose.heading());
87 auto end_pose = lane_follow_command->mutable_end_pose();
88 end_pose->CopyFrom(begin_point_);
89 --cycle_;
90 is_allowed_to_route_ = true;
91 return true;
92 }
93 }
94
95 return false;
96}
#define AINFO
Definition log.h:42
bool CheckPointDistanceInThreshold(external_command::Pose target, common::PointENU ego, double distance)

◆ Init()

common::Status apollo::task_manager::CycleRoutingManager::Init ( const localization::Pose pose,
const task_manager::CycleRoutingTask cycle_routing_task 
)

module initialization function

返回
initialization status

在文件 cycle_routing_manager.cc34 行定义.

36 {
37 cycle_ = cycle_routing_task.cycle_num();
38 auto waypoints = cycle_routing_task.lane_follow_command().way_point();
39 begin_point_.set_x(pose.position().x());
40 begin_point_.set_y(pose.position().y());
41 begin_point_.set_heading(pose.heading());
42 end_point_ = cycle_routing_task.lane_follow_command().end_pose();
43 is_allowed_to_route_ = true;
44 original_lane_follow_command_ = cycle_routing_task.lane_follow_command();
45 map_service_.reset(new apollo::dreamview::MapService());
46
47 AINFO << "New cycle routing task: cycle " << cycle_ << ", begin point "
48 << begin_point_.x() << " " << begin_point_.y() << ", end point "
49 << end_point_.x() << " " << end_point_.y();
50
51 return common::Status::OK();
52}
static Status OK()
generate a success status.
Definition status.h:60

该类的文档由以下文件生成: