|
@@ -30,6 +30,7 @@
|
|
#include "modules/common_msgs/planning_msgs/planning_command.pb.h"
|
|
#include "modules/common_msgs/planning_msgs/planning_command.pb.h"
|
|
#include "modules/common_msgs/prediction_msgs/prediction_obstacle.pb.h"
|
|
#include "modules/common_msgs/prediction_msgs/prediction_obstacle.pb.h"
|
|
#include "modules/common_msgs/routing_msgs/routing.pb.h"
|
|
#include "modules/common_msgs/routing_msgs/routing.pb.h"
|
|
|
|
+#include "modules/common_msgs/control_msgs/control_cmd.pb.h"
|
|
|
|
|
|
#include "cyber/cyber.h"
|
|
#include "cyber/cyber.h"
|
|
#include "modules/dreamview/backend/common/dreamview_gflags.h"
|
|
#include "modules/dreamview/backend/common/dreamview_gflags.h"
|
|
@@ -101,6 +102,9 @@ class SimPerfectControl final : public SimControlBase {
|
|
&obstacles);
|
|
&obstacles);
|
|
|
|
|
|
void onADCLoc(const std::shared_ptr<apollo::localization::LocalizationEstimate> &xloc);
|
|
void onADCLoc(const std::shared_ptr<apollo::localization::LocalizationEstimate> &xloc);
|
|
|
|
+
|
|
|
|
+ void onControl(
|
|
|
|
+ const std::shared_ptr<apollo::control::ControlCommand> &xCmd);
|
|
|
|
|
|
/**
|
|
/**
|
|
* @brief Predict the next trajectory point using perfect control model
|
|
* @brief Predict the next trajectory point using perfect control model
|
|
@@ -163,6 +167,9 @@ class SimPerfectControl final : public SimControlBase {
|
|
|
|
|
|
std::shared_ptr<cyber::Reader<apollo::localization::LocalizationEstimate>>
|
|
std::shared_ptr<cyber::Reader<apollo::localization::LocalizationEstimate>>
|
|
localization_adc_reader_;
|
|
localization_adc_reader_;
|
|
|
|
+
|
|
|
|
+ std::shared_ptr<apollo::cyber::Reader<apollo::control::ControlCommand>>
|
|
|
|
+ control_command_reader_;
|
|
|
|
|
|
// The timer to publish simulated localization and chassis messages.
|
|
// The timer to publish simulated localization and chassis messages.
|
|
std::unique_ptr<cyber::Timer> sim_control_timer_;
|
|
std::unique_ptr<cyber::Timer> sim_control_timer_;
|
|
@@ -205,6 +212,10 @@ class SimPerfectControl final : public SimControlBase {
|
|
std::mutex mutex_;
|
|
std::mutex mutex_;
|
|
// Locks related to timer.
|
|
// Locks related to timer.
|
|
std::mutex timer_mutex_;
|
|
std::mutex timer_mutex_;
|
|
|
|
+
|
|
|
|
+ double fcmdsteer_ = 0.0;
|
|
|
|
+ double fcmdbrake_ = 0.0;
|
|
|
|
+ double fcmdacc_ = 0.0;
|
|
|
|
|
|
FRIEND_TEST(SimControlTest, Test);
|
|
FRIEND_TEST(SimControlTest, Test);
|
|
FRIEND_TEST(SimControlTest, TestDummyPrediction);
|
|
FRIEND_TEST(SimControlTest, TestDummyPrediction);
|