The message is correct. Look at your code:
if (vehicle_speed < 59)
if vehicle_speed < 59 && (steering_torque == 0 & steering_torque < 2)
It is impossible to reach the second "if" unless vehicle_speed < 59 from the first "if", so the test vehicle_speed < 59 on the second "if" is redundant, but will not otherwise cause a problem.
f_assisted = steering_torque*1.2;
flag =1
if vehicle_speed < 59 && (steering_torque > 2.1 & steering_torque < 4)
Notice this is still inside the vehicle_speed < 59 && (steering_torque == 0 & steering_torque < 2), so you cannot get to this third "if" unless steering_torque is in the range 0 to less than 2, so (steering_torque > 2.1 & steering_torque < 4) can never be true at that point. The flip side of this is that the combination of conditions tested there vehicle_speed < 59 && (steering_torque > 2.1 & steering_torque < 4) is not otherwise tested, so if steering_torque > 2.1 then nothing will be assigned to f_assisted
You also have problems with 2 <= steering_torque <= 2.1 .
Best Answer