|
@@ -13,6 +13,7 @@
|
|
|
#include "canmsg.pb.h"
|
|
|
#include "modules/common_msgs/control_msgs/control_cmd.pb.h"
|
|
|
#include "modules/common_msgs/chassis_msgs/chassis.pb.h"
|
|
|
+#include "modules/common_msgs/planning_msgs/planning.pb.h"
|
|
|
|
|
|
#include "gflags/gflags.h"
|
|
|
|
|
@@ -36,7 +37,8 @@ static std::shared_ptr<apollo::cyber::Reader<iv::chassis>>
|
|
|
chassis_reader_;
|
|
|
static std::shared_ptr<apollo::cyber::Reader<apollo::control::ControlCommand>>
|
|
|
controller_reader_;
|
|
|
-std::shared_ptr<apollo::cyber::Writer<apollo::canbus::Chassis>> apollochassis_writer_;
|
|
|
+static std::shared_ptr<apollo::cyber::Writer<apollo::canbus::Chassis>> apollochassis_writer_;
|
|
|
+static std::shared_ptr<apollo::cyber::Reader<apollo::planning::ADCTrajectory>> planning_reader_;
|
|
|
|
|
|
static void ExecSend()
|
|
|
{
|
|
@@ -61,7 +63,7 @@ static void ExecSend()
|
|
|
xmsg.set_index(gnIndex);
|
|
|
|
|
|
unsigned char byte_24E[64];
|
|
|
- gpShenlanfd->Get24E(byte_24E);
|
|
|
+ gpShenlanfd->Get1C4(byte_24E);
|
|
|
xraw.set_id(0x24E);
|
|
|
xraw.set_data(byte_24E,64);
|
|
|
xraw.set_bext(false);
|
|
@@ -74,9 +76,10 @@ static void ExecSend()
|
|
|
}
|
|
|
xmsg.set_channel(0);
|
|
|
xmsg.set_index(gnIndex);
|
|
|
+
|
|
|
|
|
|
unsigned char byte_25E[32];
|
|
|
- gpShenlanfd->Get25E(byte_25E);
|
|
|
+ gpShenlanfd->Get1C4(byte_25E);
|
|
|
xraw.set_id(0x25E);
|
|
|
xraw.set_data(byte_25E,32);
|
|
|
xraw.set_bext(false);
|
|
@@ -119,6 +122,11 @@ void RecvCANMsg(const std::shared_ptr<iv::can::canmsg> &xmsg)
|
|
|
|
|
|
}
|
|
|
|
|
|
+void RecvPlanning(const std::shared_ptr<apollo::planning::ADCTrajectory> & xplanning)
|
|
|
+{
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
void RecvChassis(const std::shared_ptr<iv::chassis> &xchassis)
|
|
|
{
|
|
|
|
|
@@ -235,6 +243,13 @@ int main(int argc, char *argv[])
|
|
|
}
|
|
|
);
|
|
|
|
|
|
+ planning_reader_ = pilot_node->CreateReader<apollo::planning::ADCTrajectory>(
|
|
|
+ "/apollo/planning",
|
|
|
+ [](const std::shared_ptr<apollo::planning::ADCTrajectory> & xplanning){
|
|
|
+ RecvPlanning(xplanning);
|
|
|
+ }
|
|
|
+ );
|
|
|
+
|
|
|
|
|
|
|
|
|
gpShenlanfd = new Shenlanfd();
|
|
@@ -244,12 +259,12 @@ int main(int argc, char *argv[])
|
|
|
|
|
|
apollo::cyber::WaitForShutdown();
|
|
|
|
|
|
- delete gpShenlanfd;
|
|
|
gbthreadrun = false;
|
|
|
gpthreadsend->join();
|
|
|
// ptestthread->join();
|
|
|
-
|
|
|
+ delete gpShenlanfd;
|
|
|
std::cout<<" Shut Down."<<std::endl;
|
|
|
|
|
|
+
|
|
|
return 0;
|
|
|
}
|