Browse Source

去掉一个全局

master
Lizongdi 5 days ago
parent
commit
e424bd04ca
  1. 2
      project_old/paint_robot_old/FSM/Inc/fsm_state_control.h
  2. 2
      project_old/paint_robot_old/FSM/Inc/robot_move_actions.h
  3. 8
      project_old/paint_robot_old/FSM/Src/fsm_state_control.c
  4. 5
      project_old/paint_robot_old/FSM/Src/robot_move_actions.c

2
project_old/paint_robot_old/FSM/Inc/fsm_state_control.h

@ -18,7 +18,7 @@ void GF_Dispatch();
void IV_control(); void IV_control();
void MoveControl(); void MoveControl();
int32_t GetVehicleSpeed( );
extern int32_t speed_selection; extern int32_t speed_selection;
extern char is_upper_computer_take_over_control; extern char is_upper_computer_take_over_control;
#endif /* FSM_INC_FSM_STATE_CONTROL_H_ */ #endif /* FSM_INC_FSM_STATE_CONTROL_H_ */

2
project_old/paint_robot_old/FSM/Inc/robot_move_actions.h

@ -36,7 +36,7 @@ extern void Move_Head_To_Right_Do(transition_t *p_this);
extern void HALT_State_Enter(transition_t *p_this); extern void HALT_State_Enter(transition_t *p_this);
extern void HALT_State_Exit(transition_t *p_this); extern void HALT_State_Exit(transition_t *p_this);
extern int32_t GetVehicleSpeed(int speed_selection); extern int32_t GetVehicleSpeed();
extern int32_t* DHRoughening_Speed[10]; extern int32_t* DHRoughening_Speed[10];

8
project_old/paint_robot_old/FSM/Src/fsm_state_control.c

@ -35,7 +35,6 @@ void paint_joysticker_manual_control();
int AbnormalDetect();//异常检测); int AbnormalDetect();//异常检测);
char is_upper_computer_take_over_control=0; char is_upper_computer_take_over_control=0;
int CH13_S2_Value ; int CH13_S2_Value ;
int32_t speed_selection=0; //旋钮速度0-30
int paintOffCount=0; //5° 计数 超过1s 关枪 int paintOffCount=0; //5° 计数 超过1s 关枪
uint8_t angle_protect_lock=0; //作业时角度偏差过5°,停车标记位 uint8_t angle_protect_lock=0; //作业时角度偏差过5°,停车标记位
int32_t power_on_lock = 0; /*上电锁*/ int32_t power_on_lock = 0; /*上电锁*/
@ -169,9 +168,8 @@ void MoveControl()
} }
/* 速度选择索引 0-30 */ /* 速度选择索引 0-30 */
speed_selection = 3 * (P_MK32->CH11_RD1 + 1000) / 200; GV.Robot_Move_Speed = speed_M_min_toE01_M_min( GetVehicleSpeed() );/*获取旋钮速度*/
GV.Robot_Move_Speed = speed_M_min_toE01_M_min( GetVehicleSpeed(speed_selection) );/*获取旋钮速度*/ IV.RobotMoveSpeed= GetVehicleSpeed();
IV.RobotMoveSpeed= GetVehicleSpeed(speed_selection);
//换道优先级优于普通的运行; //换道优先级优于普通的运行;
if (LaneChangeControl_Paint() == 1) if (LaneChangeControl_Paint() == 1)
@ -367,7 +365,7 @@ void IV_control()
/* 返回值是脉冲/s P*60/10000/70/(Πd)=V */ /* 返回值是脉冲/s P*60/10000/70/(Πd)=V */
IV.CurrentSpeed=GV.LeftMotor.Real_Velcity*60.0/CV.pulse_Per_Circle/CV.wheel_Reduction_Ratio*M_PI*CV.wheel_Diameter_m; IV.CurrentSpeed=GV.LeftMotor.Real_Velcity*60.0/CV.pulse_Per_Circle/CV.wheel_Reduction_Ratio*M_PI*CV.wheel_Diameter_m;
IV.RobotMoveSpeed=GetVehicleSpeed(speed_selection); IV.RobotMoveSpeed=GetVehicleSpeed();
IV.CurrentAngle = GV.Robot_Angle; IV.CurrentAngle = GV.Robot_Angle;
IV.SBUS_State=GV.P_MK32.IsOnline; IV.SBUS_State=GV.P_MK32.IsOnline;
IV.SystemError = GV.SystemErrorData.Com_Error_Code; /* SystemErrorCode = &GV.SystemErrorData.Com_Error_Code; */ IV.SystemError = GV.SystemErrorData.Com_Error_Code; /* SystemErrorCode = &GV.SystemErrorData.Com_Error_Code; */

5
project_old/paint_robot_old/FSM/Src/robot_move_actions.c

@ -89,7 +89,7 @@ void HALT_State_Do(transition_t *p_this)
} }
if (CompareTimer( if (CompareTimer(
600 * CV.Paint_Gun_Shutdown_Distance / GetVehicleSpeed( speed_selection), 600 * CV.Paint_Gun_Shutdown_Distance / GetVehicleSpeed(),
&timer_handler_3)) //喷枪开 计时停 关 直接停 &timer_handler_3)) //喷枪开 计时停 关 直接停
{ {
IsRobotHaltSateChangedFlag = 0; IsRobotHaltSateChangedFlag = 0;
@ -302,8 +302,9 @@ void Calbrate_Robot_Positon(int Target_Angle)
/* 车体速度选择 具体车速在配置结构体CV 0.01m/min */ /* 车体速度选择 具体车速在配置结构体CV 0.01m/min */
int32_t GetVehicleSpeed(int speed_selection) int32_t GetVehicleSpeed(void)
{ {
int speed_selection = 3 * (P_MK32->CH11_RD1 + 1000) / 200;
if(speed_selection==0) if(speed_selection==0)
{ {
return 1; return 1;

Loading…
Cancel
Save