Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions crazyflow/control/mellinger/params.toml
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,43 @@ kw = [20000.0, 20000.0, 12000.0]
ki_m = [0.0, 0.0, 500.0]
kd_omega = [200.0, 200.0, 0.0]
int_err_max = [1.0, 1.0, 1500.0]

[hb_x500]
[hb_x500.core]
gravity_vec = [0.0, 0.0, -9.81]
mass = 2.28
L = 0.17678 # Distance from axis to rotor, i.e., arm / sqrt(2)
rpm2thrust = [0.0, 1e-6, 1e-9] # Unknown
rpm2torque = [0.0, 1e-9, 1e-12] # Unknown
thrust2torque = 0.01 # Unknown
mixing_matrix = [
[-1.0, -1.0, 1.0, 1.0],
[-1.0, 1.0, 1.0, -1.0],
[-1.0, 1.0, -1.0, 1.0]
]
pwm_min = 0
pwm_max = 1
thrust_min = 1 # in N per motor
thrust_max = 12.13 # in N per motor
mass_thrust = 0.02061006
torque_pwm_max = [0.4882887, 0.4882887, 0.4882887]

[hb_x500.state2attitude]
kp = [12.0, 12.0, 35.0]
kd = [6.0, 6.0, 8.0]
ki = [1.0, 1.0, 1.0]
int_err_max = [4.0, 4.0, 2.0]

[hb_x500.attitude2force_torque]
kR = [1.068132, 1.068132, 0.9155413]
kw = [0.3051804, 0.3051804, 0.1831083]
ki_m = [0.0, 0.0, 0.007629511]
kd_omega = [0.003051804, 0.003051804, 0.0]
int_err_max = [1.0, 1.0, 1500.0]

[hb_x500.body_rate2force_torque]
kR = [1.068132, 1.068132, 0.9155413]
kw = [0.3051804, 0.3051804, 0.1831083]
ki_m = [0.0, 0.0, 0.007629511]
kd_omega = [0.003051804, 0.003051804, 0.0]
int_err_max = [1.0, 1.0, 1500.0]
1 change: 1 addition & 0 deletions crazyflow/drones/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class Drone(StrEnum):
cf2x_L250 = "cf2x_L250"
cf2x_P250 = "cf2x_P250"
cf2x_T350 = "cf2x_T350"
hb_x500 = "hb_x500"


# Sanity check at startup
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
186 changes: 186 additions & 0 deletions crazyflow/drones/hb_x500.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
<mujoco model="hb_x500">
<compiler inertiafromgeom="false" meshdir="assets" autolimits="true" />

<asset>
<material name="black" rgba="0.102 0.102 0.102 1"/>
<material name="carbon" rgba="0.16 0.16 0.17 1"/>
<material name="gray" rgba="0.3 0.3 0.3 1"/>
<material name="dark-gray" rgba="0.2 0.2 0.22 1"/>
<material name="white" rgba="0.93 0.93 0.93 1"/>
<material name="green" rgba="0.13 0.62 0.28 1"/>
<material name="blue" rgba="0.13 0.33 0.64 1"/>

<!-- Holybro X500 V2 (PX4 Development Kit). Meshes come from the official STEP
(x500v2-frame.step, 2022-07-19): https://holybro.com/products/px4-development-kit-x500-v2
STLs are binary and in millimetres. The STEP is Y-up with the camera bracket on -X, so
parts are rotated (x, y, z) = (-x_step, z_step, y_step). The body origin is on the
underside of the bottom plate, roughly the CoM with a battery fitted.
x points forward (camera bracket), y left, z up. -->
<mesh name="frame" file="hb_x500/hb_x500_frame.stl" scale="1e-3 1e-3 1e-3"/>
<mesh name="arm_plastics" file="hb_x500/hb_x500_arm_plastics.stl" scale="1e-3 1e-3 1e-3"/>
<mesh name="motors" file="hb_x500/hb_x500_motors.stl" scale="1e-3 1e-3 1e-3"/>
<mesh name="tubes" file="hb_x500/hb_x500_tubes.stl" scale="1e-3 1e-3 1e-3"/>
<!-- Every screw and nut on the frame and the GPS mounts -->
<mesh name="screws" file="hb_x500/hb_x500_screws.stl" scale="1e-3 1e-3 1e-3"/>
<!-- Own design -->
<mesh name="battery_holder" file="hb_x500/hb_x500_battery_holder.stl" scale="1e-3 1e-3 1e-3"/>
<!-- Own design -->
<mesh name="leg" file="hb_x500/hb_x500_leg.stl" scale="1e-3 1e-3 1e-3"/>
<!-- Own design -->
<mesh name="propguard_center" file="hb_x500/hb_x500_propguard_center.stl" scale="1e-3 1e-3 1e-3"/>
<mesh name="propguard_left" file="hb_x500/hb_x500_propguard_left.stl" scale="1e-3 1e-3 1e-3"/>
<mesh name="propguard_right" file="hb_x500/hb_x500_propguard_right.stl" scale="1e-3 1e-3 1e-3"/>
<mesh name="propguard_arm" file="hb_x500/hb_x500_propguard_arm.stl" scale="1e-3 1e-3 1e-3"/>
<!-- Reconstructed from product images of the 1045 (Holybro 530084):
https://www.premium-modellbau.de/holybro-s500-v2-1045-ersatzpropeller-2x-cw-2x-ccw
https://holybro.com/products/spare-parts-s500-v2-kit -->
<mesh name="propL" file="hb_x500/hb_x500_PropL.stl" scale="1e-3 1e-3 1e-3" smoothnormal="true"/>
<mesh name="propR" file="hb_x500/hb_x500_PropR.stl" scale="1e-3 1e-3 1e-3" smoothnormal="true"/>
<mesh name="propHub" file="hb_x500/hb_x500_PropHub.stl" scale="1e-3 1e-3 1e-3" smoothnormal="true"/>
<!-- Reconstructed from vendor drawing of the Holybro 30 degree H-RTK mount:
https://www.unmannedtechshop.co.uk/products/holybro-30-gps-antenna-mount-h-rtk-helical
https://cdn.shopify.com/s/files/1/0914/9972/5181/files/30_AntennaMount_Dimensions_1800x1800_47d5d653-a047-444d-a3a7-cb5a3b054260.webp -->
<mesh name="gps_mount" file="hb_x500/hb_x500_gps_mount.stl" scale="1e-3 1e-3 1e-3"/>
<mesh name="gps_tube" file="hb_x500/hb_x500_gps_tube.stl" scale="1e-3 1e-3 1e-3" smoothnormal="true"/>
<!-- Reconstructed SMA adapter collar between mount and antenna -->
<mesh name="gps_sma" file="hb_x500/hb_x500_gps_sma.stl" scale="1e-3 1e-3 1e-3"/>
<!-- Reconstructed from the dimension drawing of the ArduSimple helical tripleband L-band IP67:
https://www.ardusimple.de/product/lightweight-helical-tripleband-l-band-antenna-ip67/
https://www.ardusimple.com/wp-content/uploads/2021/02/helical3b_dimensions.jpg -->
<mesh name="gps_antenna" file="hb_x500/hb_x500_gps_antenna.stl" scale="1e-3 1e-3 1e-3" smoothnormal="true"/>
<!-- The whole `drone` body fused into one mesh with transforms baked in (123408 faces) -->
<mesh name="hb_x500_fused" file="hb_x500/hb_x500_fused.stl" scale="1e-3 1e-3 1e-3"/>
</asset>

<default>
<default class="hb_x500">
<default class="visual">
<geom group="2" type="mesh" contype="0" conaffinity="0" />
</default>
<default class="collision">
<geom group="3" condim="1" />
</default>
<site group="5" />
</default>
</default>

<worldbody>
<body name="drone" pos="0 0 0.25" childclass="hb_x500">
<site name="CoM" />
<inertial pos="0.0 0.0 0.0" mass="2.28" diaginertia="0.024 0.024 0.044" />

<!-- Meshes -->
<geom mesh="frame" material="black" class="visual" />
<geom mesh="arm_plastics" material="blue" class="visual" />
<geom mesh="battery_holder" material="black" class="visual" pos="0.029 0 -0.013" quat="0 0.70710678 0.70710678 0"/>
<geom mesh="battery_holder" material="black" class="visual" pos="-0.041 0 -0.013" quat="0 0.70710678 0.70710678 0"/>
<!-- LemonRC 4300 mAh 14.8 V 35C, 136 x 43 x 33 mm, 422 g:
https://www.reichelt.de/de/de/shop/produkt/lipo_akku_lemonrc_4300_-_14_8v_35c_-385695 -->
<geom name="battery" type="box" size="0.068 0.0215 0.0165" pos="0 0 -0.0435" material="white" class="visual" />
<geom mesh="tubes" material="carbon" class="visual" />
<geom mesh="screws" material="gray" class="visual" />
<geom mesh="motors" material="black" class="visual" pos="0 0 0.0065" />

<!-- Collision geometry is estimated based on the visual mesh. We use a sphere for maximum
computational efficiency with larger swarms. Used by default-->
<geom name="col_sphere" type="sphere" size="0.41" pos="0 0 0.071" class="collision" contype="1" conaffinity="1" />
<!-- For higher accuracy with lower performance, you can use a box. By default off. -->
<geom name="col_box" type="box" size="0.327 0.327 0.1675" pos="0 0 0.0875" class="collision" rgba="0.5 0.5 0.5 0" contype="0" conaffinity="0" />

<!-- Motors and Propellers. Motor centres: 176.78 mm on both axes (500 mm wheelbase).
Hub underside is 4.5 mm below its origin and seats on the shaft shoulder at 64.5 mm. -->
<site name="motor0" pos="0.17678 -0.17678 0.069" />
<site name="motor1" pos="-0.17678 -0.17678 0.069" />
<site name="motor2" pos="-0.17678 0.17678 0.069" />
<site name="motor3" pos="0.17678 0.17678 0.069" />
<body name="prop0" pos="0.17678 -0.17678 0.069" euler="0 0 45">
<geom mesh="propL" material="black" class="visual"/>
<geom mesh="propHub" material="gray" class="visual"/>
</body>
<body name="prop1" pos="-0.17678 -0.17678 0.069" euler="0 0 135">
<geom mesh="propR" material="black" class="visual"/>
<geom mesh="propHub" material="gray" class="visual"/>
</body>
<body name="prop2" pos="-0.17678 0.17678 0.069" euler="0 0 225">
<geom mesh="propL" material="black" class="visual"/>
<geom mesh="propHub" material="gray" class="visual"/>
</body>
<body name="prop3" pos="0.17678 0.17678 0.069" euler="0 0 315">
<geom mesh="propR" material="black" class="visual"/>
<geom mesh="propHub" material="gray" class="visual"/>
</body>

<body name="propguard0" pos="0.17678 -0.17678 0.0245" euler="0 0 -135">
<geom mesh="propguard_center" material="white" class="visual" quat="0 0 0.70710678 0.70710678"/>
<geom mesh="propguard_left" material="white" class="visual" quat="0 0 0.70710678 0.70710678"/>
<geom mesh="propguard_right" material="white" class="visual" quat="0 0 0.70710678 0.70710678"/>
<geom mesh="propguard_arm" material="black" class="visual" quat="0 0 0.70710678 0.70710678"/>
<geom mesh="propguard_arm" material="black" class="visual" quat="0.27059805 0.27059805 -0.65328148 -0.65328148"/>
<geom mesh="propguard_arm" material="black" class="visual" quat="0.27059805 0.27059805 0.65328148 0.65328148"/>
</body>
<body name="propguard1" pos="-0.17678 -0.17678 0.0245" euler="0 0 -225">
<geom mesh="propguard_center" material="green" class="visual" quat="0 0 0.70710678 0.70710678"/>
<geom mesh="propguard_left" material="green" class="visual" quat="0 0 0.70710678 0.70710678"/>
<geom mesh="propguard_right" material="green" class="visual" quat="0 0 0.70710678 0.70710678"/>
<geom mesh="propguard_arm" material="black" class="visual" quat="0 0 0.70710678 0.70710678"/>
<geom mesh="propguard_arm" material="black" class="visual" quat="0.27059805 0.27059805 -0.65328148 -0.65328148"/>
<geom mesh="propguard_arm" material="black" class="visual" quat="0.27059805 0.27059805 0.65328148 0.65328148"/>
</body>
<body name="propguard2" pos="-0.17678 0.17678 0.0245" euler="0 0 45">
<geom mesh="propguard_center" material="green" class="visual" quat="0 0 0.70710678 0.70710678"/>
<geom mesh="propguard_left" material="green" class="visual" quat="0 0 0.70710678 0.70710678"/>
<geom mesh="propguard_right" material="green" class="visual" quat="0 0 0.70710678 0.70710678"/>
<geom mesh="propguard_arm" material="black" class="visual" quat="0 0 0.70710678 0.70710678"/>
<geom mesh="propguard_arm" material="black" class="visual" quat="0.27059805 0.27059805 -0.65328148 -0.65328148"/>
<geom mesh="propguard_arm" material="black" class="visual" quat="0.27059805 0.27059805 0.65328148 0.65328148"/>
</body>
<body name="propguard3" pos="0.17678 0.17678 0.0245" euler="0 0 -45">
<geom mesh="propguard_center" material="white" class="visual" quat="0 0 0.70710678 0.70710678"/>
<geom mesh="propguard_left" material="white" class="visual" quat="0 0 0.70710678 0.70710678"/>
<geom mesh="propguard_right" material="white" class="visual" quat="0 0 0.70710678 0.70710678"/>
<geom mesh="propguard_arm" material="black" class="visual" quat="0 0 0.70710678 0.70710678"/>
<geom mesh="propguard_arm" material="black" class="visual" quat="0.27059805 0.27059805 -0.65328148 -0.65328148"/>
<geom mesh="propguard_arm" material="black" class="visual" quat="0.27059805 0.27059805 0.65328148 0.65328148"/>
</body>
<body name="leg0" pos="0.17678 -0.17678 0.0245" euler="0 0 -135">
<geom mesh="leg" material="black" class="visual" quat="0 0 0.70710678 0.70710678"/>
</body>
<body name="leg1" pos="-0.17678 -0.17678 0.0245" euler="0 0 -225">
<geom mesh="leg" material="black" class="visual" quat="0 0 0.70710678 0.70710678"/>
</body>
<body name="leg2" pos="-0.17678 0.17678 0.0245" euler="0 0 45">
<geom mesh="leg" material="black" class="visual" quat="0 0 0.70710678 0.70710678"/>
</body>
<body name="leg3" pos="0.17678 0.17678 0.0245" euler="0 0 -45">
<geom mesh="leg" material="black" class="visual" quat="0 0 0.70710678 0.70710678"/>
</body>

<!-- Left/right GPS arms on the top plate: 164 mm between clamp pins,
12 mm tube diameter, 135.6 mm platform height, 436.2 mm antenna baseline. -->
<body name="gps_left" pos="0 0.05 0.032" euler="0 0 90">
<geom mesh="gps_mount" material="black" class="visual"/>
<geom mesh="gps_tube" material="carbon" class="visual"/>
<geom mesh="gps_sma" material="gray" class="visual"/>
<geom mesh="gps_antenna" material="black" class="visual" pos="0.1681 0 0.1396"/>
</body>
<body name="gps_right" pos="0 -0.05 0.032" euler="0 0 -90">
<geom mesh="gps_mount" material="black" class="visual"/>
<geom mesh="gps_tube" material="carbon" class="visual"/>
<geom mesh="gps_sma" material="gray" class="visual"/>
<geom mesh="gps_antenna" material="black" class="visual" pos="0.1681 0 0.1396"/>
</body>

<!-- Cameras -->
<camera name="track_cam" pos="-2.5 0 1.25" xyaxes="0 -1 0 1 0 2" mode="trackcom" />
<camera name="fpv_cam" pos="0.115 0 -0.03" euler="0 -90 -90" fovy="70" resolution="640 480" />
</body>

<body name="drone_fused" pos="0 0 0.25" childclass="hb_x500">
<inertial pos="0.0 0.0 0.0" mass="2.28" diaginertia="0.024 0.024 0.044" />
<geom mesh="hb_x500_fused" material="dark-gray" class="visual" />
<geom name="col_sphere_fused" type="sphere" size="0.41" pos="0 0 0.071" class="collision" contype="1" conaffinity="1" />
<geom name="col_box_fused" type="box" size="0.327 0.327 0.1675" pos="0 0 0.0875" class="collision" rgba="0.5 0.5 0.5 0" contype="0" conaffinity="0" />
</body>
</worldbody>

</mujoco>
15 changes: 15 additions & 0 deletions crazyflow/dynamics/so_rpy/params.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,18 @@ cmd_f_coef = 0.96836458
rpy_coef = [-188.9910, -188.9910, -138.3109]
rpy_rates_coef = [-12.7803, -12.7803, -16.8485]
cmd_rpy_coef = [138.0834, 138.0834, 198.5161]

[hb_x500]
mass = 2.28
J = [ # approximated
[24e-3, 0.0, 0.0],
[0.0, 24e-3, 0.0],
[0.0, 0.0, 44e-3]
]
thrust_min = 1.0 # in N per motor
thrust_max = 12.13 # in N per motor
acc_coef = 0.0
cmd_f_coef = 0.9121643489648786
rpy_coef = [-51.42302192586755, -51.42302192586755, -26.929070173696157]
rpy_rates_coef = [-8.93635377240008, -8.93635377240008, -8.646484332625702]
cmd_rpy_coef = [47.3447720777806, 47.3447720777806, 25.310886504404653]
16 changes: 16 additions & 0 deletions crazyflow/dynamics/so_rpy_rotor/params.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,19 @@ thrust_time_coef = 0.02055366
rpy_coef = [-188.9910, -188.9910, -138.3109]
rpy_rates_coef = [-12.7803, -12.7803, -16.8485]
cmd_rpy_coef = [138.0834, 138.0834, 198.5161]

[hb_x500]
mass = 2.28
J = [ # approximated
[24e-3, 0.0, 0.0],
[0.0, 24e-3, 0.0],
[0.0, 0.0, 44e-3]
]
thrust_min = 1.0 # in N per motor
thrust_max = 12.13 # in N per motor
acc_coef = 0.0
cmd_f_coef = 0.9122876298664497
thrust_time_coef = 0.04493428195421334
rpy_coef = [-51.42302192586755, -51.42302192586755, -26.929070173696157]
rpy_rates_coef = [-8.93635377240008, -8.93635377240008, -8.646484332625702]
cmd_rpy_coef = [47.3447720777806, 47.3447720777806, 25.310886504404653]
21 changes: 21 additions & 0 deletions crazyflow/dynamics/so_rpy_rotor_drag/params.toml
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,24 @@ drag_matrix = [
rpy_coef = [-188.9910, -188.9910, -138.3109]
rpy_rates_coef = [-12.7803, -12.7803, -16.8485]
cmd_rpy_coef = [138.0834, 138.0834, 198.5161]

[hb_x500]
mass = 2.28
J = [ # approximated
[24e-3, 0.0, 0.0],
[0.0, 24e-3, 0.0],
[0.0, 0.0, 44e-3]
]
thrust_min = 1.0 # in N per motor
thrust_max = 12.13 # in N per motor
acc_coef = 0.0
cmd_f_coef = 0.9234799918739313
thrust_time_coef = 0.07111262651857447
drag_matrix = [
[-0.8031707417931839, 0.0, 0.0 ],
[0.0, -0.8031707417931839, 0.0 ],
[0.0, 0.0, -1.013867567938818 ]
]
rpy_coef = [-51.423019722268464, -51.423019722268464, -26.92907102709692]
rpy_rates_coef = [-8.9363626451314, -8.9363626451314, -8.646483972362423]
cmd_rpy_coef = [47.34477305534468, 47.34477305534468, 25.310887633982862]
1 change: 1 addition & 0 deletions docs/user-guide/control/parametrize.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ The following configurations ship with pre-fitted parameters:
| `"cf2x_P250"` | Crazyflie 2.x, plus propellers |
| `"cf2x_T350"` | Crazyflie 2.x, thrust upgrade kit |
| `"cf21B_500"` | Crazyflie 2.1 Brushless |
| `"hb_x500"` | Holybro X500 V2 |

Pass the drone name as a plain string:

Expand Down
Loading