提交 9da6455d 编写于 作者: A Aaron Xiao 提交者: siyangy

HMI: Remove RoutingRequest sending function which has been moved to DreamView. (#1441)

上级 58a5d0aa
config {
type: LOCALIZATION
mode: RECEIVE_ONLY
message_history_limit: 1
}
config {
type: CHASSIS
mode: RECEIVE_ONLY
......@@ -17,8 +12,4 @@ config {
type: PAD
mode: PUBLISH_ONLY
}
config {
type: ROUTING_REQUEST
mode: PUBLISH_ONLY
}
is_ros: true
......@@ -22,6 +22,4 @@ message HMICommand {
optional bool reset_first = 2;
}
optional ChangeDrivingMode change_driving_mode = 2;
optional bool new_routing_request = 3;
}
......@@ -13,7 +13,6 @@ cc_binary(
"//modules/common/adapters:adapter_manager",
"//modules/control/common",
"//modules/control/proto:control_proto",
"//modules/map/hdmap:hdmap_util",
"@ros//:ros_common",
],
)
......
......@@ -25,7 +25,6 @@
#include "modules/common/util/file.h"
#include "modules/control/common/control_gflags.h"
#include "modules/control/proto/pad_msg.pb.h"
#include "modules/map/hdmap/hdmap_util.h"
DEFINE_string(adapter_config_file,
......@@ -36,7 +35,6 @@ using apollo::common::adapter::AdapterManager;
using apollo::common::adapter::AdapterManagerConfig;
using apollo::control::DrivingAction;
using apollo::canbus::Chassis;
using apollo::hdmap::HDMapUtil;
namespace apollo {
namespace hmi {
......@@ -53,13 +51,6 @@ class RosBridge {
&adapter_conf));
AdapterManager::Init(adapter_conf);
AdapterManager::AddHMICommandCallback(OnHMICommand);
// Init RoutingRequest template.
CHECK(apollo::common::util::GetProtoFromASCIIFile(
apollo::hdmap::EndWayPointFile(),
routing_request_template.mutable_end()));
// Init HDMap.
CHECK(HDMapUtil::BaseMapPtr());
}
private:
......@@ -71,10 +62,6 @@ class RosBridge {
}
ChangeDrivingModeTo(cmd.target_mode());
}
if (command.new_routing_request()) {
instance()->SendRoutingRequest();
}
}
static bool ChangeDrivingModeTo(const Chassis::DrivingMode target_mode) {
......@@ -118,43 +105,7 @@ class RosBridge {
AINFO << "Sent PadMessage";
}
void SendRoutingRequest() {
// Observe position from Localization.
auto* localization = AdapterManager::GetLocalization();
localization->Observe();
if (localization->Empty()) {
AERROR << "No Localization message received!";
return;
}
const auto& pos = localization->GetLatestObserved().pose().position();
// Look up lane info from map.
apollo::hdmap::LaneInfoConstPtr lane = nullptr;
double s, l;
HDMapUtil::BaseMap().GetNearestLane(pos, &lane, &s, &l);
if (lane == nullptr) {
AERROR << "Cannot get nearest lane from current position.";
return;
}
// Populate message and send.
routing::RoutingRequest routing_request = routing_request_template;
auto* start_point = routing_request.mutable_start();
start_point->set_id(lane->id().id());
start_point->set_s(s);
auto* pose = start_point->mutable_pose();
pose->set_x(pos.x());
pose->set_y(pos.y());
pose->set_z(pos.z());
AdapterManager::FillRoutingRequestHeader(kHMIRosBridgeName,
&routing_request);
AdapterManager::PublishRoutingRequest(routing_request);
}
private:
routing::RoutingRequest routing_request_template;
DECLARE_SINGLETON(RosBridge);
};
......
......@@ -27,7 +27,6 @@ class RosBridgeApi(object):
"""
HMI ros API:
change_driving_mode [manual | auto]
new_routing_request
"""
ros_command_pub = None
ros_command_seq_num = 0
......@@ -62,15 +61,6 @@ class RosBridgeApi(object):
Config.log.debug('Publishing message: %s', str(cmd_msg))
cls.ros_command_pub.publish(cmd_msg)
@classmethod
def new_routing_request(cls):
"""SocketIO Api: new_routing_request()"""
Config.log.info('RosBridgeApi new_routing_request')
cmd_msg = cls.__new_command_message()
cmd_msg.new_routing_request = True
Config.log.debug('Publishing message: %s', str(cmd_msg))
cls.ros_command_pub.publish(cmd_msg)
@classmethod
def __new_command_message(cls):
"""Create a new HMICommand message with header filled."""
......
......@@ -135,12 +135,6 @@
>Start Auto</button>
<span class="glyphicon"></span>
</div>
<div class="col-xs-4 quick_start_col3">
<button type="button" class="btn hmi_large_btn"
onclick="io_request('ros_bridge_api', 'new_routing_request')"
>RoutingReq</button>
<span class="glyphicon"></span>
</div>
</div>
</div>
</div>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册