Explorar o código

change for apollo. now control command is ok. next test drive.

yuchuli hai 3 días
pai
achega
844e7d5016

+ 4 - 0
src/apollo/change3/sim_perfect_control.cc

@@ -447,6 +447,10 @@ void SimPerfectControl::PublishChassis(double cur_speed,
   if (gear_position == canbus::Chassis::GEAR_REVERSE) {
     chassis->set_speed_mps(-chassis->speed_mps());
   }
+  
+  if( (receiveadcloc)){
+	chassis->set_speed_mps(static_cast<float>(fNowVel));
+  }
 
   chassis->set_throttle_percentage(0.0);
   chassis->set_brake_percentage(0.0);

+ 4 - 1
src/apollo/code/apollodriver_hcp2/apollodriver_hcp2.pro

@@ -26,7 +26,8 @@ SOURCES += \
         /apollo_workspace/bazel-bin/external/apollo_src/modules/common_msgs/basic_msgs/header.pb.cc  \
         /apollo_workspace/bazel-bin/external/apollo_src/modules/common_msgs/basic_msgs/pnc_point.pb.cc  \ 
         /apollo_workspace/bazel-bin/external/apollo_src/modules/common_msgs/basic_msgs/geometry.pb.cc  \
-        /apollo_workspace/bazel-bin/external/apollo_src/modules/common_msgs/basic_msgs/error_code.pb.cc
+        /apollo_workspace/bazel-bin/external/apollo_src/modules/common_msgs/basic_msgs/error_code.pb.cc  \
+        /apollo_workspace/bazel-bin/external/apollo_src/modules/common_msgs/transform_msgs/transform.pb.cc
 
 # Default rules for deployment.
 qnx: target.path = /tmp/$${TARGET}/bin
@@ -64,6 +65,8 @@ LIBS += /opt/apollo/neo/lib/cyber/croutine/*.so
 LIBS += /opt/apollo/neo/lib/cyber/event/*.so
 LIBS += /opt/apollo/neo/lib/cyber/time/*.so
 
+LIBS += /opt/apollo/neo/lib/modules/transform/*.so
+
 LIBS += -L/opt/apollo/neo/lib/3rd-fastdds-wrap -lfastrtps
 
 LIBS += -L/lib/aarch64-linux-gnu -lgflags -lglog

+ 1 - 1
src/apollo/code/apollodriver_hcp2/main.cpp

@@ -131,7 +131,7 @@ int main(int argc, char *argv[])
     localization_writer_ = pilot_node->CreateWriter<apollo::localization::LocalizationEstimate>("/apollo/localization/adcpose");
     mtf_broadcaster_ = new apollo::transform::TransformBroadcaster(pilot_node);
 
-    std::string strgpsport =  "/dev/ttyUSB0";
+    std::string strgpsport =  "/dev/ttyUART_232_C";
     hcp2fun funcall = std::bind(&hcp2callback,std::placeholders::_1);
     hcp2 xhcp2(strgpsport,funcall);