修改WDT以及增加转台
This commit is contained in:
40
interface.c
40
interface.c
@@ -41,13 +41,16 @@ UnUltrasonicOutput un_ultrasonic_output1 ;//超声波传感
|
||||
|
||||
|
||||
|
||||
//UnSdoOutput un_sdo_output1 ;//设定转向电机位置
|
||||
//UnSdoOutput un_sdo_output2 ;//设定转向电机速度
|
||||
//UnSdoOutput un_sdo_output3 ;//使能向下一个点
|
||||
//UnSdoOutput un_sdo_output4 ;//设定电机使能
|
||||
//UnSdoOutput un_sdo_output5 ;//设置电机模式
|
||||
//UnSdoOutput un_sdo_output6 ;//接收数据
|
||||
//UnSdoOutput un_sdo_output7 ;//发送使能数据
|
||||
StrTxCanFrame un_sdo_output1 ;//电机1输出
|
||||
StrTxCanFrame un_sdo_output2 ;//电机2输出
|
||||
StrTxCanFrame un_sdo_output3 ;//电机3输出
|
||||
StrTxCanFrame un_sdo_output4 ;//电机3速度输出
|
||||
|
||||
StrTxCanFrame un_sdo_output5 ;//电机使能输出
|
||||
|
||||
StrRxCanFrame un_pitch_intput ;//电机输入
|
||||
StrRxCanFrame un_right_intput ;//电机输入
|
||||
StrRxCanFrame un_turn_intput ;//电机输入
|
||||
|
||||
|
||||
//IO口
|
||||
@@ -59,7 +62,13 @@ UnAutoComputerInput un_auto_computer_input ;//自主计算机
|
||||
UnManualComputerInput un_manual_computer_input ;//自主计算机手动数据
|
||||
UnRequestFrame un_request_frame ;//请求帧
|
||||
|
||||
UnComputerTurnableInput un_computer_turnable_Input ;//转台以太网输入
|
||||
|
||||
|
||||
UnComputerOutput un_computer_output ;//输出给自主计算机
|
||||
|
||||
|
||||
|
||||
|
||||
//输出给上位机
|
||||
UnVehicleInfoOutput un_vehicle_Info_output ;// 车辆信息,输出给上位机
|
||||
@@ -77,5 +86,20 @@ UnCanDebugOutput un_can_debug_output;//调试输出
|
||||
|
||||
|
||||
|
||||
|
||||
// 限制值在最小值和最大值之间
|
||||
float constrain(float value, float min_val, float max_val)
|
||||
{
|
||||
if (value < min_val)
|
||||
{
|
||||
return min_val;
|
||||
}
|
||||
else if (value > max_val)
|
||||
{
|
||||
return max_val;
|
||||
}
|
||||
else
|
||||
{
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user