问题:
以前驾驶舱给vehicle发送上强电命令,但是自动驾驶工控机没有上电(风扇没动),多次发送也不管用。
分析:
分析vehicle代码,里面的逻辑存在问题,原来的逻辑就没有接管的状态下给自动驾驶工控机上电的功能,原来的逻辑是先判断下底盘的上电状体,再根据相应的状态执行相应的命令,因为原来就是上强电的状态,所以无论如何也进入不了工控机上电状态(0x03)
ret = json_object_object_get_ex(m_object , "requestPowerState" , &temp_object);
if(ret && (NULL != temp_object)){
pduControlPowerCmd = json_object_get_double(temp_object);
print_log("requestPowerState = %d\r\n", pduControlPowerCmd);
if(poweroffIndicate == 0){
CanOperateSwitch = CAN_SEND_ENABLE;
if((pduControlPowerCmd == IG_ON) || (pduControlPowerCmd == POWER_ON) || (pduControlPowerCmd == AUTO_ON)){
if(poweroffIndicate == 0){
//add 20190713
print_log("last time poweroff procedure completed, now do IG_ON, POWER_ON or AUTO_ON\r\n");
if(vcuPowerRelayState == IG_OFF){
print_log("+++0 vehicle current powerState is IG_OFF, now IG_ON\r\n");
mPowerCmd = IG_ON;
powerOnFlag = 1;
if(currentControlMode == PARALLEL_CONTROL_MODE){
print_log("+++1 vehicle is in pdu control mode, now AUTO_ON\r\n");
mPowerCmd = AUTO_ON;//POWER_ON;
}
}else if(vcuPowerRelayState == POWER_ON){
print_log("+++2 vehicle current powerState is POWER_ON, now POWER_ON\r\n");
mPowerCmd = AUTO_ON;//2020.5.21 POWER_ON;
}else if(vcuPowerRelayState == AUTO_ON){
print_log("+++3 vehicle current powerState is AUTO_ON, now AUTO_ON\r\n");
mPowerCmd = AUTO_ON;
}else if(vcuPowerRelayState == IG_ON){
print_log("+++4 vehicle current powerState is IG_ON, now POWER_ON\r\n");
mPowerCmd = AUTO_ON;//2020.5.21 old is POWER_ON;
}
后来把POWR_ON相关的地方都改成AUTO_ON,就把问题解决啦。