提交 addf962f 编写于 作者: A Aaron Xiao 提交者: Calvin Miao

Robot: Code clean.

上级 0222fa1d
......@@ -71,7 +71,7 @@ void AsyncLogger::Stop() {
void AsyncLogger::Write(bool force_flush, time_t timestamp, const char* message,
int message_len) {
// drop message when acitve buffer full
// drop message when active buffer full
if (unlikely(BufferFull(*active_buf_))) {
return;
}
......
......@@ -28,7 +28,7 @@ namespace mainboard {
void ModuleArgument::DisplayUsage() {
AINFO << "Usage: \n " << binary_name_ << " [OPTION]...\n"
<< "Description: \n"
<< " -h, --help : help infomation \n"
<< " -h, --help : help information \n"
<< " -d, --dag_conf=CONFIG_FILE : module dag config file\n"
<< " -p, --process_group=process_group: the process "
"namespace for running this module, default in manager process\n"
......
......@@ -619,9 +619,10 @@ PyObject *cyber_PyChannelUtils_get_debugstring_by_msgtype_rawmsgdata(
static PyObject *cyber_PyChannelUtils_get_active_channels(PyObject *self,
PyObject *args) {
unsigned char sleep_s = 0;
if (!PyArg_ParseTuple(args, const_cast<char *>(
"B:cyber_PyChannelUtils_get_active_channels"),
&sleep_s)) {
if (!PyArg_ParseTuple(
args,
const_cast<char *>("B:cyber_PyChannelUtils_get_active_channels"),
&sleep_s)) {
AERROR << "cyber_PyChannelUtils_get_active_channels failed!";
Py_INCREF(Py_None);
return Py_None;
......
......@@ -394,8 +394,9 @@ PyObject *cyber_PyRecordWriter_SetSizeOfFileSegmentation(PyObject *self,
uint64_t size_kilobytes = 0;
if (!PyArg_ParseTuple(
args, const_cast<char *>(
"OK:cyber_PyRecordWriter_SetSizeOfFileSegmentation"),
args,
const_cast<char *>(
"OK:cyber_PyRecordWriter_SetSizeOfFileSegmentation"),
&pyobj_rec_writer, &size_kilobytes)) {
AERROR
<< "cyber_PyRecordWriter_SetSizeOfFileSegmentation parsetuple failed!";
......@@ -424,8 +425,9 @@ PyObject *cyber_PyRecordWriter_SetIntervalOfFileSegmentation(PyObject *self,
uint64_t time_sec = 0;
if (!PyArg_ParseTuple(
args, const_cast<char *>(
"OK:cyber_PyRecordWriter_SetIntervalOfFileSegmentation"),
args,
const_cast<char *>(
"OK:cyber_PyRecordWriter_SetIntervalOfFileSegmentation"),
&pyobj_rec_writer, &time_sec)) {
AERROR << "cyber_PyRecordWriter_SetIntervalOfFileSegmentation parsetuple "
"failed!";
......
......@@ -74,7 +74,7 @@ class PyWriter {
message::ProtobufFactory::Instance()->GetDescriptorString(type,
&proto_desc);
if (proto_desc.empty()) {
AWARN << "cpp cann't find proto_desc msgtyp->" << data_type_;
AWARN << "cpp can't find proto_desc msgtyp->" << data_type_;
return;
}
proto::RoleAttributes role_attr;
......
......@@ -55,7 +55,7 @@ void DisplayUsage(const std::string& binary, const std::string& command,
void DisplayUsage(const std::string& binary) {
std::cout << "usage: " << binary << " <command> [<args>]\n"
<< "The " << binary << " commands are:\n"
<< "\tinfo\tShow infomation of an exist record.\n"
<< "\tinfo\tShow information of an exist record.\n"
<< "\tplay\tPlay an exist record.\n"
<< "\trecord\tRecord same topic.\n"
<< "\tsplit\tSplit an exist record.\n"
......
......@@ -72,7 +72,7 @@ void TrackedObject::AttachObject(base::ObjectPtr obj_ptr,
for (size_t i = 0; i < cloud.size(); ++i) {
cloud_world.SetPointHeight(i, cloud.points_height(i));
}
// other belief infomation keep as Reset()
// other belief information keep as Reset()
selected_measured_velocity = Eigen::Vector3d::Zero();
selected_measured_acceleration = Eigen::Vector3d::Zero();
belief_anchor_point = barycenter;
......
......@@ -57,7 +57,7 @@ struct TrackedObject {
void ToObject(base::ObjectPtr obj_ptr) const;
// ***************************************************
// self infomation from match
// self information from match
// ***************************************************
std::vector<float> shape_features;
std::vector<float> shape_features_full;
......@@ -67,19 +67,19 @@ struct TrackedObject {
float association_score = 0.0f;
// ***************************************************
// self infomation from track
// self information from track
// ***************************************************
bool is_fake = false;
int track_id = -1;
double tracking_time = 0.0;
// ***************************************************
// infomation from main car
// information from main car
// ***************************************************
Eigen::Affine3d sensor_to_local_pose;
// ***************************************************
// measurement correlative infomation from object_ptr
// measurement correlative information from object_ptr
// ***************************************************
base::ObjectPtr object_ptr;
// corners always store follow const order based on object direction
......@@ -97,7 +97,7 @@ struct TrackedObject {
bool is_background = false;
// ***************************************************
// measurement correlative infomation from measurement computer
// measurement correlative information from measurement computer
// ***************************************************
Eigen::Vector3d measured_barycenter_velocity;
Eigen::Vector3d measured_center_velocity;
......@@ -105,7 +105,7 @@ struct TrackedObject {
Eigen::Vector3d measured_corners_velocity[4];
// ***************************************************
// filter correlative infomation
// filter correlative information
// ***************************************************
// states
int boostup_need_history_size = 0;
......@@ -138,7 +138,7 @@ struct TrackedObject {
Eigen::Vector3d motion_score;
// ***************************************************
// postprocess correlative infomation
// postprocess correlative information
// ***************************************************
Eigen::Vector3d output_velocity;
Eigen::Matrix3d output_velocity_uncertainty;
......
......@@ -323,7 +323,6 @@ ScenarioConfig::ScenarioType ScenarioManager::SelectTrafficLightScenario(
}
}
switch (current_scenario_->scenario_type()) {
case ScenarioConfig::LANE_FOLLOW:
case ScenarioConfig::CHANGE_LANE:
......
......@@ -38,9 +38,9 @@ namespace planning {
using common::ErrorCode;
using common::Status;
using common::time::Clock;
using common::VehicleConfigHelper;
using common::math::Vec2d;
using common::time::Clock;
using perception::PerceptionObstacle;
SpeedDecider::SpeedDecider(const TaskConfig& config) : Task(config) {
......@@ -544,14 +544,14 @@ bool SpeedDecider::CheckStopForPedestrian(
pedestrian_stop_times->end()) {
// add timestamp
(*pedestrian_stop_times)[obstacle_id] = Clock::NowInSeconds();
ADEBUG << "add timestamp: obstacle_id[" << obstacle_id
<< "] timestamp[" << Clock::NowInSeconds() << "]";
ADEBUG << "add timestamp: obstacle_id[" << obstacle_id << "] timestamp["
<< Clock::NowInSeconds() << "]";
} else {
// check timeout
double stop_time = Clock::NowInSeconds() -
(*pedestrian_stop_times)[obstacle_id];
ADEBUG << "stop_time: obstacle_id[" << obstacle_id
<< "] stop_time[" << stop_time << "]";
double stop_time =
Clock::NowInSeconds() - (*pedestrian_stop_times)[obstacle_id];
ADEBUG << "stop_time: obstacle_id[" << obstacle_id << "] stop_time["
<< stop_time << "]";
if (stop_time >= kPedestrianStopTimeout) {
return false;
}
......
......@@ -45,9 +45,10 @@ void SemanticMap::RunCurrFrame(const FrameEnv& curr_frame_env) {
curr_timestamp_ = curr_frame_env.timestamp();
curr_base_x_ = curr_frame_env.ego_history().feature(0).position().x() - 100.0;
curr_base_y_ = curr_frame_env.ego_history().feature(0).position().y() - 100.0;
cv::Rect rect(static_cast<int>((curr_base_x_ - 585950.0) / 0.1),
static_cast<int>(18000 - (curr_base_y_ - 4140000.0) / 0.1) - 2000,
2000, 2000);
cv::Rect rect(
static_cast<int>((curr_base_x_ - 585950.0) / 0.1),
static_cast<int>(18000 - (curr_base_y_ - 4140000.0) / 0.1) - 2000, 2000,
2000);
base_img_(rect).copyTo(curr_img_);
// Draw ego_vehicle_history
......
......@@ -16,8 +16,8 @@
#pragma once
#include "opencv2/opencv.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/opencv.hpp"
#include "cyber/common/macros.h"
#include "modules/prediction/proto/feature.pb.h"
......
......@@ -48,8 +48,8 @@ void PedestrianInteractionEvaluator::Evaluate(Obstacle* obstacle_ptr) {
std::vector<double> feature_values;
ExtractFeatures(obstacle_ptr, &feature_values);
if (FLAGS_prediction_offline_mode == 2) {
FeatureOutput::InsertDataForLearning(
*latest_feature_ptr, feature_values, "pedestrian", nullptr);
FeatureOutput::InsertDataForLearning(*latest_feature_ptr, feature_values,
"pedestrian", nullptr);
ADEBUG << "Saving extracted features for learning locally.";
return;
}
......
......@@ -98,7 +98,7 @@ def extract_dbc_meta(dbc_file, out_file, car_type, black_list, sender_list,
if len(items) > 3 and items[0] == "SG_":
if items[2] == ":":
var_info = extract_var_info(items)
# current we cann't process than 4 byte value
# current we can't process than 4 byte value
if var_info["len"] <= 32:
protocol["vars"].append(var_info)
else:
......
......@@ -487,7 +487,7 @@ void DistanceGetResult(ResultContainer* result_ptr,
size_t size = result_ptr->GetX()->size();
size_t size_by_distance = result_ptr->PrepareStateResult()->cols();
AERROR_IF(size != size_by_distance)
<< "sizes by hybrid A and distance approach not consistent";
<< "sizes by hybrid A and distance approach not consistent";
for (size_t i = 0; i < size; i++) {
x[i] = result_ptr->GetX()->at(i);
y[i] = result_ptr->GetY()->at(i);
......
......@@ -51,7 +51,7 @@ def plot_region(region, color):
def plot_lane_change(lane_change, passage_regions):
"""Plot lane change infomation"""
"""Plot lane change information"""
st_idx = lane_change.start_passage_region_index
ed_idx = lane_change.end_passage_region_index
from_pt = get_center_of_passage_region(passage_regions[st_idx])
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册