哪家公司网站建设好,用dw6做网站首页,网站设计建网站,平面设计培训平台ardrone是rotors仿真框架提供的一款机型#xff0c;因为该机型与我们实际使用的机型参数相近#xff0c;所以这里对它的参数做特别整理和记录。
一、模型参数总结
ardrone的gazebo模型如下图所示#xff1a;
根据ardrone.yaml#xff0c;其关键参数如下所示#xff1a…ardrone是rotors仿真框架提供的一款机型因为该机型与我们实际使用的机型参数相近所以这里对它的参数做特别整理和记录。
一、模型参数总结
ardrone的gazebo模型如下图所示
根据ardrone.yaml其关键参数如下所示
# Ardrone vehicle parameters
mass: 1.52
inertia: {xx: 0.0347563, xy: 0.0, xz: 0.0, yy: 0.0458929, yz: 0.0, zz: 0.0977}# angle should be expressed in rad
# direction 1 means counter clockwise, -1 clockwise
# The order of the rotors matters for the calculation of the allocation matrix.
rotor_configuration:0: {angle: -0.78539, arm_length: 0.18, rotor_force_constant: 8.54858e-06, rotor_moment_constant: 1.6e-2, direction: 1.0}1: {angle: 2.35619, arm_length: 0.18, rotor_force_constant: 8.54858e-06, rotor_moment_constant: 1.6e-2, direction: 1.0}2: {angle: 0.78539, arm_length: 0.18, rotor_force_constant: 8.54858e-06, rotor_moment_constant: 1.6e-2, direction: -1.0}3: {angle: -2.35619, arm_length: 0.18, rotor_force_constant: 8.54858e-06, rotor_moment_constant: 1.6e-2, direction: -1.0}更详细的参数可以参见ardrone.xacro文件。 其电机标号convention与PX4一致如下图所示
下图是PX4的电机标号和旋向
control allocation matrix如下 [ τ x τ y τ z F ] [ c f d ⋅ sin θ 0 c f d ⋅ sin θ 1 c f d ⋅ sin θ 2 c f d ⋅ sin θ 3 − c f d ⋅ cos θ 0 − c f d ⋅ cos θ 1 − c f d ⋅ cos θ 2 − c f d ⋅ cos θ 3 n ⋅ c f c m n ⋅ c f c m n ⋅ c f c m n ⋅ c f c m c f c f c f c f ] [ ω 0 2 ω 1 2 ω 2 2 ω 3 2 ] \begin{bmatrix} \tau_x\\ \tau_y\\ \tau_z \\ F \end{bmatrix} \begin{bmatrix} c_fd\cdot\text{sin}\theta_0 c_fd\cdot\text{sin}\theta_1 c_fd\cdot\text{sin}\theta_2 c_fd\cdot\text{sin}\theta_3 \\ -c_fd\cdot\text{cos}\theta_0 -c_fd\cdot\text{cos}\theta_1 -c_fd\cdot\text{cos}\theta_2 -c_fd\cdot\text{cos}\theta_3 \\ n\cdot c_f c_m n\cdot c_f c_m n\cdot c_f c_m n\cdot c_f c_m \\ c_f c_f c_f c_f \end{bmatrix} \begin{bmatrix} {\omega_0}^2 \\ {\omega_1}^2 \\ {\omega_2}^2 \\ {\omega_3}^2 \end{bmatrix} τxτyτzF cfd⋅sinθ0−cfd⋅cosθ0n⋅cfcmcfcfd⋅sinθ1−cfd⋅cosθ1n⋅cfcmcfcfd⋅sinθ2−cfd⋅cosθ2n⋅cfcmcfcfd⋅sinθ3−cfd⋅cosθ3n⋅cfcmcf ω02ω12ω22ω32 其中 n n n表示旋向逆时针为1顺时针为-1 c f c_f cf是拉力系数 c m c_m cm是力矩系数。这里力矩系数与其他文献或某些书籍可能不一致但是在代码里是与其他参数一起配套使用是没有问题的。下面全权老师的课件矩阵的第4行用的是 c M c_M cM这里 c M c f c m c_Mc_fc_m cMcfcm。因此以后要注意自己用的参数对应的是什么公式。
二、存在的问题
注意原始的ardrone.xacro和ardrone.yaml文件中arm_length参数是有问题的github上有网友也提出来了Ardrone Arm Length And Stability #488。修改方式有两种以下二选一即可
ardrone.yaml的arm_length改为0.18比如我上面的代码片ardrone.yaml的arm_length改为0.18且ardrone.xacro中的arm_length改为0.18sqrt21.4142135623730951 2 \sqrt{2} 2 全部替换为sqrt2_inv0.70710678119 1 2 \frac{1}{\sqrt{2}} 2 1