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

#include <cycle_routing_manager.h>

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

Public 成员函数

 CycleRoutingManager ()=default
 
common::Status Init (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.cc46 行定义.

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

◆ Init()

common::Status apollo::task_manager::CycleRoutingManager::Init ( const task_manager::CycleRoutingTask cycle_routing_task)

module initialization function

返回
initialization status

在文件 cycle_routing_manager.cc29 行定义.

30 {
31 cycle_ = cycle_routing_task.cycle_num();
32 auto waypoints = cycle_routing_task.lane_follow_command().way_point();
33 begin_point_ = waypoints[0];
34 end_point_ = cycle_routing_task.lane_follow_command().end_pose();
35 is_allowed_to_route_ = true;
36 original_lane_follow_command_ = cycle_routing_task.lane_follow_command();
37 map_service_.reset(new apollo::dreamview::MapService());
38
39 AINFO << "New cycle routing task: cycle " << cycle_ << ", begin point "
40 << begin_point_.x() << " " << begin_point_.y() << ", end point "
41 << end_point_.x() << " " << end_point_.y();
42
43 return common::Status::OK();
44}
static Status OK()
generate a success status.
Definition status.h:60

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