فهرست منبع

add some vscode param for compile in code.

yuchuli 2 هفته پیش
والد
کامیت
0d8570cc8c

+ 17 - 0
src/apollo/modules/adc/other/vscodeparam/c_cpp_properties.json

@@ -0,0 +1,17 @@
+{
+    "configurations": [
+        {
+            "name": "Linux",
+            "includePath": [
+                "${workspaceFolder}/**",
+                "/apollo/**"
+            ],
+            "defines": [],
+            "compilerPath": "/usr/bin/gcc",
+            "cStandard": "c17",
+            "cppStandard": "c++14",
+            "intelliSenseMode": "linux-gcc-x64"
+        }
+    ],
+    "version": 4
+}

+ 29 - 0
src/apollo/modules/adc/other/vscodeparam/launch.json

@@ -0,0 +1,29 @@
+{
+    // 使用 IntelliSense 了解相关属性。 
+    // 悬停以查看现有属性的描述。
+    // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
+    "version": "0.2.0",
+    "configurations": [
+        {
+            "name": "C/C++: g++ build and debug active file",
+            "type": "cppdbg",
+            "request": "launch",
+            "program": "/apollo/bazel-bin/modules/adc/pilot_apollo_bridge/pilot_apollo_bridge",  
+            "args": [],
+            "stopAtEntry": false,
+            "cwd": "${workspaceFolder}",
+            "environment": [],
+            "externalConsole": false,
+            "MIMode": "gdb",
+            "miDebuggerPath": "/usr/bin/gdb",
+            "setupCommands": [
+                {
+                    "description": "Enable pretty-printing for gdb",
+                    "text": "-enable-pretty-printing",
+                    "ignoreFailures": true
+                }
+            ],
+   //         "preLaunchTask": "bazel build"
+        }
+    ]
+}

+ 5 - 0
src/apollo/modules/adc/other/vscodeparam/settings.json

@@ -0,0 +1,5 @@
+{
+    "files.associations": {
+        "iostream": "cpp"
+    }
+}

+ 24 - 0
src/apollo/modules/adc/other/vscodeparam/tasks.json

@@ -0,0 +1,24 @@
+{
+	"version": "2.0.0",
+	"tasks": [
+		{
+			"type": "cppbuild",
+			"label": "bazel build",
+			"command": "bazel",
+			"args": [
+				"build",
+				"//modules/adc/pilot_apollo_bridge:pilot_apollo_bridge",
+				"-c",
+                "dbg"
+			],
+			"options": {
+				"cwd": "${fileDirname}"
+			},
+			"problemMatcher": [
+				"$gcc"
+			],
+			"group": "build",
+			"detail": "compiler: bazel"
+		}
+	]
+}

+ 9 - 8
src/apollo/modules/adc/pilot_apollo_bridge/pilot_apollo_bridge.cc

@@ -1,15 +1,15 @@
 #include "modules/adc/pilot_apollo_bridge/proto/gpsimu.pb.h"
 #include "modules/adc/pilot_apollo_bridge/proto/apolloctrlcmd.pb.h"
- #include "cyber/cyber.h"
- #include "cyber/time/rate.h"
- #include "cyber/time/time.h"
- #include "modules/common/math/math_utils.h"
+#include "cyber/cyber.h"
+#include "cyber/time/rate.h"
+#include "cyber/time/time.h"
+#include "modules/common/math/math_utils.h"
 #include "modules/common/math/quaternion.h"
  
- #include "modules/common/adapters/adapter_gflags.h"
+#include "modules/common/adapters/adapter_gflags.h"
  
- #include "modules/common_msgs/localization_msgs/gps.pb.h"
- #include "modules/common_msgs/sensor_msgs/ins.pb.h"
+#include "modules/common_msgs/localization_msgs/gps.pb.h"
+#include "modules/common_msgs/sensor_msgs/ins.pb.h"
 
 #include "modules/common_msgs/localization_msgs/imu.pb.h"
 
@@ -316,7 +316,7 @@ void ListenGPSIMU(const char * strdata,const unsigned int nSize,const unsigned i
     double flon = xgpsimu.lon();
     double flat = xgpsimu.lat();
     
-    double utm_x,utm_y;
+    double utm_x,utm_y; 
     int zone{};
     bool is_north{};
     GeographicLib::UTMUPS::Forward(flat, flon, zone, is_north, utm_x,utm_y);
@@ -462,6 +462,7 @@ void InitIns(){
    std::cout<<" enter talker."<<std::endl;
    //设置初始速度为0,然后速度每秒增加5km/h
    uint64_t speed = 0;
+
    while (apollo::cyber::OK()) {
 //       auto msg = std::make_shared<Car>();
 //       msg->set_speed(speed);

+ 11 - 0
src/apollo/modules/adc/pilot_apollo_bridge/proto/apolloctrlcmd.proto

@@ -0,0 +1,11 @@
+syntax = "proto2";
+
+package iv.apollo;
+
+message apolloctrlcmd
+{
+  required double steering_target = 1;
+  required double acceleration =2 ;//#m/s^2
+  required double brake = 3;
+ 
+};