Ver Fonte

add debug angle printf and change torque limit value

chenxiaowei há 1 ano atrás
pai
commit
20d870eacf

+ 5 - 0
src/decition/common/common/car_status.h

@@ -264,6 +264,11 @@ namespace iv {
         double camera_x_adjust; //camera2vehicle coordinate adjust at x-dim
         double camera_y_adjust; //camera2vehicle coordinate adjust at y-dim
         double laneline_speed; // laneline driver speed
+
+        //debug cheliang juece
+        double ang_debug=0.0;
+        double torque_or_acc=0.0;
+        double brake=0.0;
     };
     typedef boost::serialization::singleton<iv::CarStatus> CarStatusSingleton;//非线程安全,注意多线程加锁,单例模式
 }

+ 8 - 1
src/decition/decition_brain_sf_changan_shenlan/decition/adc_adapter/changan_shenlan_adapter.cpp

@@ -183,7 +183,14 @@ float iv::decition::ChanganShenlanAdapter::limitSpeed(float realSpeed, float con
     }
 
     if(realSpeed<10){
-        controlSpeed=min((float)400.0,controlSpeed);
+        if(realSpeed<5)
+        {
+           controlSpeed=min((float)1000.0,controlSpeed);  //20230425,低速扭矩加大,保证让车辆动起来,解决上坡问题
+        }
+        else
+        {
+            controlSpeed=min((float)400.0,controlSpeed);
+        }
     }else if(realSpeed<30){
         controlSpeed =min((float)600.0,controlSpeed);
     }

+ 13 - 1
src/decition/decition_brain_sf_changan_shenlan/decition/brain.cpp

@@ -366,6 +366,17 @@ void iv::decition::BrainDecition::run() {
     ServiceCarStatus.aocfDis = atof(aocfDis.data());
     ServiceCarStatus.aocfTimes = atof(aocfTimes.data());
 
+
+    std::string angdebug = xp.GetParam("angDebug","0.0");
+    std::string tordebug = xp.GetParam("torqueDebug","0.0");
+    std::string brkdebug = xp.GetParam("brakeDebug","3");
+
+
+    ServiceCarStatus.ang_debug = atof(angdebug.data());
+    ServiceCarStatus.torque_or_acc = atof(tordebug.data());
+    ServiceCarStatus.brake = atof(brkdebug.data());
+
+
     mstrmemmap_index = xp.GetParam("msg_mapindex","map_index");
 
 
@@ -436,7 +447,7 @@ void iv::decition::BrainDecition::run() {
                 decition_gps->angle_active = 0;//横向控制激活模式
                 decition_gps->angle_mode = 0; //横向控制激活,和上一条同时满足才执行横向请求角度
                 decition_gps->auto_mode = 0; //3为自动控制模式
-                decition_gps->wheel_angle = 0;
+                decition_gps->wheel_angle = ServiceCarStatus.ang_debug;//0;
             }
             else
             {
@@ -858,6 +869,7 @@ void iv::decition::BrainDecition::ShareDecition(iv::decition::Decition decition)
         std::cout<<"===================shareDecition========================"<<std::endl;
         std::cout<<"  torque_st:"<<ServiceCarStatus.torque_st
                 <<"  decideTorque:"<<decition->torque <<"  decideBrake:"<<decition->brake
+                <<"  decideAngle:"<<decition->wheel_angle
                 <<"  decideAngActive:"<<decition->angle_active
                 <<"  decideAutoMode:"<<decition->auto_mode
                 <<std::endl;

+ 24 - 0
src/decition/decition_brain_sf_changan_shenlan_vedio/mainwindow.ui

@@ -0,0 +1,24 @@
+<ui version="4.0" >
+ <author></author>
+ <comment></comment>
+ <exportmacro></exportmacro>
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>800</width>
+    <height>600</height>
+   </rect>
+  </property>
+  <property name="windowTitle" >
+   <string>MainWindow</string>
+  </property>
+  <widget class="QMenuBar" name="menubar" />
+  <widget class="QWidget" name="centralwidget" />
+  <widget class="QStatusBar" name="statusbar" />
+ </widget>
+ <pixmapfunction></pixmapfunction>
+ <connections/>
+</ui>

+ 34 - 0
src/decition/decition_test/decition_test/decition_test.pro

@@ -0,0 +1,34 @@
+#-------------------------------------------------
+#
+# Project created by QtCreator 2023-04-23T15:52:35
+#
+#-------------------------------------------------
+
+QT       += core gui
+
+greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
+
+TARGET = decition_test
+TEMPLATE = app
+
+# The following define makes your compiler emit warnings if you use
+# any feature of Qt which has been marked as deprecated (the exact warnings
+# depend on your compiler). Please consult the documentation of the
+# deprecated API in order to know how to port your code away from it.
+DEFINES += QT_DEPRECATED_WARNINGS
+
+# You can also make your code fail to compile if you use deprecated APIs.
+# In order to do so, uncomment the following line.
+# You can also select to disable deprecated APIs only up to a certain version of Qt.
+#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
+
+
+SOURCES += \
+        main.cpp \
+        mainwindow.cpp
+
+HEADERS += \
+        mainwindow.h
+
+FORMS += \
+        mainwindow.ui

+ 11 - 0
src/decition/decition_test/decition_test/main.cpp

@@ -0,0 +1,11 @@
+#include "mainwindow.h"
+#include <QApplication>
+
+int main(int argc, char *argv[])
+{
+    QApplication a(argc, argv);
+    MainWindow w;
+    w.show();
+
+    return a.exec();
+}

+ 14 - 0
src/decition/decition_test/decition_test/mainwindow.cpp

@@ -0,0 +1,14 @@
+#include "mainwindow.h"
+#include "ui_mainwindow.h"
+
+MainWindow::MainWindow(QWidget *parent) :
+    QMainWindow(parent),
+    ui(new Ui::MainWindow)
+{
+    ui->setupUi(this);
+}
+
+MainWindow::~MainWindow()
+{
+    delete ui;
+}

+ 22 - 0
src/decition/decition_test/decition_test/mainwindow.h

@@ -0,0 +1,22 @@
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <QMainWindow>
+
+namespace Ui {
+class MainWindow;
+}
+
+class MainWindow : public QMainWindow
+{
+    Q_OBJECT
+
+public:
+    explicit MainWindow(QWidget *parent = 0);
+    ~MainWindow();
+
+private:
+    Ui::MainWindow *ui;
+};
+
+#endif // MAINWINDOW_H

+ 24 - 0
src/decition/decition_test/decition_test/mainwindow.ui

@@ -0,0 +1,24 @@
+<ui version="4.0">
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>400</width>
+    <height>300</height>
+   </rect>
+  </property>
+  <property name="windowTitle" >
+   <string>MainWindow</string>
+  </property>
+  <widget class="QMenuBar" name="menuBar" />
+  <widget class="QToolBar" name="mainToolBar" />
+  <widget class="QWidget" name="centralWidget" />
+  <widget class="QStatusBar" name="statusBar" />
+ </widget>
+ <layoutDefault spacing="6" margin="11" />
+ <pixmapfunction></pixmapfunction>
+ <resources/>
+ <connections/>
+</ui>