Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion modules/control/common/base_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/

#ifndef MODULES_CONTROL_COMMON_BASE_TYPES_H_
#define MODULES_CONTROL_COMMON_BASE_TYPES_H_

Expand Down Expand Up @@ -58,4 +59,4 @@ struct TrajectoryPoint : public PathPoint {
} // namespace control
} // namespace apollo

#endif /* MODULES_CONTROL_COMMON_BASE_TYPES_H_ */
#endif // MODULES_CONTROL_COMMON_BASE_TYPES_H_
1 change: 1 addition & 0 deletions modules/control/common/definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#define MODULES_CONTROL_COMMON_DEFINITIONS_H_

#include "modules/common/proto/error_code.pb.h"

#include "modules/common/status/status.h"

/**
Expand Down
1 change: 1 addition & 0 deletions modules/control/common/hysteresis_filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

/**
* @file
* @brief hysteresis filter
*/

#ifndef MODULES_CONTROL_COMMON_HYSTERESIS_FILTER_H_
Expand Down
1 change: 1 addition & 0 deletions modules/control/common/interpolation_2d.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/

#include "modules/control/common/interpolation_2d.h"

#include <cmath>
Expand Down
5 changes: 3 additions & 2 deletions modules/control/common/trajectory_analyzer.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@

#include <vector>

#include "modules/planning/proto/planning.pb.h"

#include "modules/common/vehicle_state/vehicle_state.h"
#include "modules/control/common/base_types.h"
#include "modules/planning/proto/planning.pb.h"

/**
* @namespace apollo::control
Expand Down Expand Up @@ -138,4 +139,4 @@ class TrajectoryAnalyzer {
} // namespace control
} // namespace apollo

#endif /* MODULES_CONTROL_COMMON_TRAJECTORY_ANALYZER_H_ */
#endif // MODULES_CONTROL_COMMON_TRAJECTORY_ANALYZER_H_
6 changes: 4 additions & 2 deletions modules/control/control.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@

#include <string>

#include "ros/include/std_msgs/String.h"

#include "modules/localization/proto/localization.pb.h"

#include "modules/common/adapters/adapter_gflags.h"
#include "modules/common/adapters/adapter_manager.h"
#include "modules/common/log.h"
#include "modules/common/time/time.h"
#include "modules/control/common/control_gflags.h"
#include "modules/localization/proto/localization.pb.h"
#include "ros/include/std_msgs/String.h"

namespace apollo {
namespace control {
Expand Down
16 changes: 8 additions & 8 deletions modules/control/control.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,25 @@
* limitations under the License.
*****************************************************************************/

#ifndef CONTROL_CONTROL_H_
#define CONTROL_CONTROL_H_
#ifndef MODULES_CONTROL_CONTROL_H_
#define MODULES_CONTROL_CONTROL_H_

#include <cstdio>
#include <memory>
#include <mutex>
#include <string>

#include "modules/canbus/proto/chassis.pb.h"
#include "modules/common/apollo_app.h"
#include "modules/common/monitor/monitor.h"
#include "modules/common/monitor/proto/monitor.pb.h"
#include "modules/common/util/util.h"
#include "modules/control/controller/controller_agent.h"
#include "modules/control/proto/control_cmd.pb.h"
#include "modules/control/proto/control_conf.pb.h"
#include "modules/control/proto/pad_msg.pb.h"
#include "modules/planning/proto/planning.pb.h"
#include "std_msgs/String.h"

#include "modules/common/apollo_app.h"
#include "modules/common/monitor/monitor.h"
#include "modules/common/util/util.h"
#include "modules/control/controller/controller_agent.h"

/**
* @namespace apollo::control
Expand Down Expand Up @@ -126,4 +126,4 @@ class Control : public apollo::common::ApolloApp {
} // namespace control
} // namespace apollo

#endif // CONTROL_CONTROL_H_
#endif // MODULES_CONTROL_CONTROL_H_
3 changes: 1 addition & 2 deletions modules/control/controller/controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,12 @@
#include <cmath>
#include <string>

#include "modules/canbus/proto/chassis.pb.h"
#include "modules/control/proto/control_cmd.pb.h"
#include "modules/control/proto/control_conf.pb.h"
#include "modules/localization/proto/localization.pb.h"
#include "modules/planning/proto/planning.pb.h"

#include "modules/control/common/definitions.h"
#include "modules/control/proto/control_conf.pb.h"

/**
* @namespace apollo::control
Expand Down
8 changes: 5 additions & 3 deletions modules/control/controller/controller_agent.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@
#include <memory>
#include <vector>

#include "modules/common/util/factory.h"
#include "modules/control/controller/controller.h"
#include "ros/include/ros/ros.h"

#include "modules/control/proto/control_cmd.pb.h"
#include "modules/control/proto/control_conf.pb.h"
#include "modules/planning/proto/planning.pb.h"
#include "ros/include/ros/ros.h"

#include "modules/common/util/factory.h"
#include "modules/control/controller/controller.h"

/**
* @namespace apollo::control
Expand Down
23 changes: 11 additions & 12 deletions modules/control/controller/lon_controller_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
#include "gmock/gmock.h"
#include "google/protobuf/text_format.h"
#include "gtest/gtest.h"
#include "modules/common/log.h"

#include "modules/control/proto/control_conf.pb.h"
#include "modules/planning/proto/planning.pb.h"

#include "modules/common/log.h"
#include "modules/common/time/time.h"
#include "modules/common/util/file.h"
#include "modules/common/vehicle_state/vehicle_state.h"
#include "modules/control/common/control_gflags.h"
#include "modules/control/proto/control_conf.pb.h"
#include "modules/planning/proto/planning.pb.h"

#include "modules/localization/common/localization_gflags.h"

namespace apollo {
Expand All @@ -56,7 +56,7 @@ class LonControllerTest : public ::testing::Test, LonController {
"modules/control/testdata/conf/lincoln.pb.txt";

CHECK(apollo::common::util::GetProtoFromFile(control_conf_file,
&control_conf));
&control_conf));
longitudinal_conf_ = control_conf.lon_controller_conf();

timestamp_ = apollo::common::time::ToSecond(Clock::Now());
Expand All @@ -77,26 +77,25 @@ class LonControllerTest : public ::testing::Test, LonController {
}

protected:
LocalizationPb LoadLocalizationPb(const std::string& filename) {
LocalizationPb LoadLocalizationPb(const std::string &filename) {
LocalizationPb localization;
CHECK(apollo::common::util::GetProtoFromFile(filename, &localization))
<< "Failed to open file " << filename;
localization.mutable_header()->set_timestamp_sec(timestamp_);
return std::move(localization);
}

ChassisPb LoadChassisPb(const std::string& filename) {
ChassisPb LoadChassisPb(const std::string &filename) {
ChassisPb chassis_pb;
CHECK(apollo::common::util::GetProtoFromFile(filename, &chassis_pb))
<< "Failed to open file " << filename;
chassis_pb.mutable_header()->set_timestamp_sec(timestamp_);
return std::move(chassis_pb);
}

TrajectoryPb LoadPlanningTrajectoryPb(const std::string& filename) {
TrajectoryPb LoadPlanningTrajectoryPb(const std::string &filename) {
TrajectoryPb trajectory_pb;
CHECK(
apollo::common::util::GetProtoFromFile(filename, &trajectory_pb))
CHECK(apollo::common::util::GetProtoFromFile(filename, &trajectory_pb))
<< "Failed to open file " << filename;

trajectory_pb.mutable_header()->set_timestamp_sec(timestamp_);
Expand Down Expand Up @@ -127,8 +126,8 @@ TEST_F(LonControllerTest, ComputeLongitudinalErrors) {
double preview_time = longitudinal_conf_.preview_window() * ts;

SimpleLongitudinalDebug debug;
ComputeLongitudinalErrors(vehicle_state, &trajectory_analyzer,
preview_time, &debug);
ComputeLongitudinalErrors(vehicle_state, &trajectory_analyzer, preview_time,
&debug);

double station_reference_expected = 0.16716666937000002;
double speed_reference_expected = 1.70833337307;
Expand Down
2 changes: 1 addition & 1 deletion modules/control/filters/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ cc_test(
":digital_filter",
":digital_filter_coefficients",
"//modules/common",
"//third_party/ros:ros_common",
"@ros//:ros_common",
"@gtest//:main",
],
)
Expand Down
5 changes: 3 additions & 2 deletions modules/control/tools/control_tester.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@
#include "ros/ros.h"
#include "std_msgs/String.h"

#include "modules/localization/proto/localization.pb.h"
#include "modules/planning/proto/planning.pb.h"

#include "modules/canbus/proto/chassis.pb.h"
#include "modules/common/adapters/adapter_manager.h"
#include "modules/common/log.h"
#include "modules/control/common/control_gflags.h"
#include "modules/localization/proto/localization.pb.h"
#include "modules/planning/proto/planning.pb.h"

DEFINE_string(
chassis_test_file, "modules/control/testdata/control_tester/chassis.pb.txt",
Expand Down
7 changes: 5 additions & 2 deletions modules/control/tools/enter_auto_mode.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,17 @@
* limitations under the License.
*****************************************************************************/

#include <glog/logging.h>
#include <chrono>
#include <mutex>
#include <thread>

#include <glog/logging.h>

#include "modules/canbus/proto/chassis.pb.h"
#include "modules/control/proto/pad_msg.pb.h"

#include "modules/common/adapters/adapter_manager.h"
#include "modules/control/common/control_gflags.h"
#include "modules/control/proto/pad_msg.pb.h"

using apollo::common::adapter::AdapterConfig;
using apollo::common::adapter::AdapterManager;
Expand Down
9 changes: 6 additions & 3 deletions modules/control/tools/terminal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@
*****************************************************************************/

#include <iostream>

#include "ros/include/ros/ros.h"
#include "std_msgs/String.h"

#include "modules/canbus/proto/chassis.pb.h"
#include "modules/control/proto/pad_msg.pb.h"

#include "modules/common/adapters/adapter_manager.h"
#include "modules/common/log.h"
#include "modules/common/time/time.h"
#include "modules/control/common/control_gflags.h"
#include "modules/control/proto/pad_msg.pb.h"
#include "std_msgs/String.h"
#include "ros/include/ros/ros.h"

namespace {

Expand Down
3 changes: 2 additions & 1 deletion modules/localization/rtk/rtk_localization_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@

#include "google/protobuf/text_format.h"
#include "gtest/gtest.h"
#include "ros/include/ros/ros.h"

#include "modules/common/adapters/adapter_manager.h"
#include "modules/common/log.h"
#include "modules/common/util/util.h"
#include "modules/localization/common/localization_gflags.h"
#include "third_party/ros/include/ros/ros.h"

using apollo::common::adapter::AdapterConfig;
using apollo::common::adapter::AdapterManager;
Expand Down