diff --git a/sw/tools/generators/gen_airframe.ml b/sw/tools/generators/gen_airframe.ml index ccca9f3212..cea04221e3 100644 --- a/sw/tools/generators/gen_airframe.ml +++ b/sw/tools/generators/gen_airframe.ml @@ -83,6 +83,8 @@ let convert_value_with_code_unit_coef_of_xml = function xml -> (* if unit attribute is not specified don't even attempt to convert the units *) let u = try Xml.attrib xml "unit" with _ -> failwith "Unit conversion error" in let cu = ExtXml.attrib_or_default xml "code_unit" "" in + (* if unit equals code unit, don't convert as that would always result in a float *) + if u = cu then failwith "Not converting"; (* default value for code_unit is rad[/s] when unit is deg[/s] *) let conv = try (Pprz.scale_of_units u cu) with | Pprz.Unit_conversion_error s -> prerr_endline (sprintf "Unit conversion error: %s" s); flush stderr; exit 1