get_code_config.m

来自「多智能体工具包」· M 代码 · 共 25 行

M
25
字号
function Robot_Config=get_code_config(Robot_Code)% GET_CODE_CONFIG	Convert the binary representation to real configuration.%     Copyright (c) 1997-2000 Jiming Liu and Jianbing Wuglobal Class_Change_Dist Red_White_Distance;global RadiusCode_Len AngleCode_Len Single_Code_Width;Max_Radius_Int=2^RadiusCode_Len;Max_Angle_Int=2^AngleCode_Len;Current_Radius_Code=Robot_Code(1:RadiusCode_Len);  Current_Angle_Code=Robot_Code(RadiusCode_Len+1:Single_Code_Width); Current_Radius_Bin=gray2bin(Current_Radius_Code);Radius_Int=bin2int(Current_Radius_Bin);Real_Radius=Red_White_Distance+Radius_Int*Class_Change_Dist/Max_Radius_Int;Current_Angle_Bin=gray2bin(Current_Angle_Code);Angle_Int=bin2int(Current_Angle_Bin);Real_Angle=Angle_Int*2*pi/Max_Angle_Int;Robot_Config=config_from_ra(Real_Radius,Real_Angle);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?