给vehicle发送给自动驾驶工控机上电不成功问题

问题:

以前驾驶舱给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,就把问题解决啦。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值