Skip to content

Commit e073e1a

Browse files
committed
Move all physical parameters into toml
1 parent 21d93d4 commit e073e1a

5 files changed

Lines changed: 71 additions & 201 deletions

File tree

drone_models/data/cf21B_500.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
<material name="gray" rgba="0.3 0.3 0.3 1"/>
77
<material name="light-gray" rgba="0.7 0.7 0.7 1"/>
88
<material name="silver" rgba="0.898 0.898 0.898 1"/>
9-
<!-- <material name="white" rgba="1 1 1 1"/> -->
109
<material name="gold" rgba="0.969 0.878 0.6 1"/>
1110
<material name="green" rgba="0.522 0.902 0.145 1"/>
1211

drone_models/data/cf2x_L250.xml

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@
6565
<body name="prop3" pos="0.0325 0.0325 0.012" euler="0 0 315">
6666
<geom mesh="propR" material="black" class="visual"/>
6767
</body>
68-
6968
</body>
7069
</worldbody>
7170

@@ -85,48 +84,4 @@
8584
<motor gear="0 0 0 0 0 1" site="motor3" name="motor3_torque" />
8685
</actuator>
8786

88-
<!-- Model Parameters
89-
Below are all the parameters unique to the drone setup
90-
Base is the Crazyflie 2.X, file name encodes the specific setup
91-
- Propellers/Motors options: L(egacy), P(lus), T(hrust upgrade kit), B(rushless)
92-
- Battery (250mAh / 350mAh)
93-
-->
94-
<custom>
95-
<!-- Physical Parameters-->
96-
<numeric name="gravity" data="9.807" /> <!-- Munich, Germany-->
97-
<!-- From IROS 2022 -->
98-
<numeric name="mass" data="0.03454" />
99-
<!-- <numeric name="J" data="1.4e-5 0.0 0.0
100-
0.0 1.4e-5 0.0
101-
0.0 0.0 2.17e-5"/> -->
102-
<!-- From Förster B.S. thesis -->
103-
<numeric name="J" data="1.68e-5 0.0 0.0
104-
0.0 1.68e-5 0.0
105-
0.0 0.0 2.98e-5" />
106-
<!-- Distance of motor from axis
107-
in x configuration, it's 1/sqrt(2) smaller
108-
arm "+" = 0.046 (from CAD); arm "x" = 0.03253 (rounded)-->
109-
<numeric name="arm" data="0.03253" />
110-
<!-- Matrix on how to mix the forces into torques, different for "x" and "+" config-->
111-
<numeric name="sign_matrix" data="-1 -1 -1
112-
-1 1 1
113-
1 1 -1
114-
1 -1 1" />
115-
<numeric name="prop_radius" data="2.31348e-2" />
116-
117-
<!-- Motors and Thrust-->
118-
<numeric name="PWM_MIN" data="20000.0" />
119-
<numeric name="PWM_MAX" data="65535.0" />
120-
<numeric name="THRUST_MIN" data="0.02" /> <!-- in N, per motor-->
121-
<numeric name="THRUST_MAX" data="0.1125" /> <!-- in N, per motor-->
122-
<numeric name="THRUST_TAU" data="6.9235846332510365" />
123-
<numeric name="VMOTOR_MIN" data="1.003506695043662" /> <!-- in V-->
124-
<numeric name="VMOTOR_MAX" data="2.903351097106251" /> <!-- in V-->
125-
<numeric name="p_vmotor2thrust" data="-0.014830744918356092 0.04724465241828281 -0.01847364358025878 0.005960923942142" /> <!--Index is order-->
126-
<numeric name="p_vmotor2rpm" data="2828.6593993157803 6686.5508078905705" /> <!--Index is order-->
127-
<numeric name="kf" data="8.701227710666256e-10" />
128-
<numeric name="km" data="7.94e-12" /> <!-- From old identification! TODO: Replace if possible-->
129-
130-
</custom>
131-
13287
</mujoco>

drone_models/data/cf2x_P250.xml

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
<mesh name="battery-holder" file="cf2x/cf2x_battery-holder.stl" scale="0.001 0.001 0.001"/>
2121
</asset>
2222

23-
2423
<default>
2524
<default class="cf2">
2625
<default class="visual">
@@ -66,7 +65,6 @@
6665
<body name="prop3" pos="0.0325 0.0325 0.012" euler="0 0 315">
6766
<geom mesh="propR" material="black" class="visual"/>
6867
</body>
69-
7068
</body>
7169
</worldbody>
7270

@@ -86,70 +84,4 @@
8684
<motor gear="0 0 0 0 0 1" site="motor3" name="motor3_torque" />
8785
</actuator>
8886

89-
<!-- Model Parameters
90-
Below are all the parameters unique to the drone setup
91-
Base is the Crazyflie 2.X, file name encodes the specific setup
92-
- Propellers/Motors options: L(egacy), P(lus), T(hrust upgrade kit), B(rushless)
93-
- Battery (250mAh / 350mAh)
94-
-->
95-
<custom>
96-
<!-- Physical Parameters-->
97-
<numeric name="gravity" data="9.807" /> <!-- Munich, Germany-->
98-
<numeric name="mass" data="0.03454" />
99-
<numeric name="J" data="1.4e-5 0.0 0.0
100-
0.0 1.4e-5 0.0
101-
0.0 0.0 2.17e-5"/> <!-- From IROS 2022 -->
102-
<!-- <numeric name="J" data="1.68e-5 0.0 0.0
103-
0.0 1.68e-5 0.0
104-
0.0 0.0 2.98e-5" /> --> <!-- From Förster B.S. thesis -->
105-
<!-- Distance of motor from axis
106-
in x configuration, it's 1/sqrt(2) smaller
107-
arm "+" = 0.046 (from CAD); arm "x" = 0.03253 (rounded)-->
108-
<numeric name="arm" data="0.03253" />
109-
<!-- Matrix on how to mix the forces into torques, different for "x" and "+" config-->
110-
<numeric name="sign_matrix" data="-1 -1 -1
111-
-1 1 1
112-
1 1 -1
113-
1 -1 1" />
114-
<numeric name="prop_radius" data="2.31348e-2" />
115-
116-
<!-- Motors and Thrust-->
117-
<numeric name="PWM_MIN" data="20000.0" />
118-
<numeric name="PWM_MAX" data="65535.0" />
119-
<numeric name="THRUST_MIN" data="0.02" /> <!-- in N, per motor-->
120-
<numeric name="THRUST_MAX" data="0.1125" /> <!-- in N, per motor-->
121-
<numeric name="THRUST_TAU" data="7.2333515424212695" />
122-
<numeric name="VMOTOR_MIN" data="0.9857578735524497" /> <!-- in V-->
123-
<numeric name="VMOTOR_MAX" data="2.9966889966322077" /> <!-- in V-->
124-
<numeric name="p_vmotor2thrust" data="-0.02427920377129026 0.06433042290821364 -0.026401054210489865 0.006731877887386432" /> <!--Index is order-->
125-
<numeric name="p_vmotor2rpm" data="4741.994550959416 7472.9374014021605" /> <!--Index is order-->
126-
<numeric name="kf" data="5.792654323957372e-10" />
127-
<numeric name="km" data="7.94e-12" /> <!-- From old identification! TODO: Replace if possible-->
128-
129-
<!-- System Idenfication: Simple Model-->
130-
<numeric name="SI_roll" data="-3.96 4.08" /> <!-- From identification for L250! TODO: Redo -->
131-
<numeric name="SI_pitch" data="-6.00 6.21" /> <!-- From identification for L250! TODO: Redo -->
132-
<numeric name="SI_yaw" data="0.0 0.0" /> <!-- Not Identified!-->
133-
<numeric name="SI_acc" data="20.907574256269616 3.653687545690674" /> <!-- From identification for L250! TODO: Redo -->
134-
135-
<!-- System Identification: Double Integrator Model-->
136-
<numeric name="DI_roll" data="-99.94 -13.3 84.73" /> <!-- From identification for L250! TODO: Redo -->
137-
<numeric name="DI_pitch" data="-130.3 -16.33 119.3" /> <!-- From identification for L250! TODO: Redo -->
138-
<numeric name="DI_yaw" data="0.0 0.0 0.0" /> <!-- Not Identified!-->
139-
<numeric name="DI_acc" data="20.907574256269616 3.653687545690674" /> <!-- From identification for L250! TODO: Redo -->
140-
141-
<!-- System Identification: Double Integrator Model with delay-->
142-
<numeric name="DI_D_roll" data="-286.2 -23.03 225.6" /><!-- From identification for L250! TODO: Redo -->
143-
<numeric name="DI_D_pitch" data="-286.2 -23.03 225.6" /><!-- From identification for L250! TODO: Redo -->
144-
<numeric name="DI_D_yaw" data="-192.9 -22.22 323.5" /> <!-- From identification for L250! TODO: Redo -->
145-
<numeric name="DI_D_acc" data="0.1670 0.5615 0.0654" /> <!--Index is order, tau is last-->
146-
147-
<!-- System Identification: Double Integrator Model with drag and delay-->
148-
<numeric name="DI_DD_roll" data="-257.2 -20.2 207.1" /> <!-- From identification for L250! TODO: Redo -->
149-
<numeric name="DI_DD_pitch" data="-257.2 -20.2 207.1" /> <!-- From identification for L250! TODO: Redo -->
150-
<numeric name="DI_DD_yaw" data="-225.3 -28.61 392.7" /> <!-- From identification for L250! TODO: Redo -->
151-
<numeric name="DI_DD_acc" data="1.0627 0.1891 -0.0177 0.0010" /> <!--c1, tau, c2, c3--> <!-- From identification for L250! TODO: Redo -->
152-
153-
</custom>
154-
15587
</mujoco>

drone_models/data/cf2x_T350.xml

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
<mesh name="battery-holder" file="cf2x/cf2x_battery-holder.stl" scale="0.001 0.001 0.001"/>
2121
</asset>
2222

23-
2423
<default>
2524
<default class="cf2">
2625
<default class="visual">
@@ -66,7 +65,6 @@
6665
<body name="prop3" pos="0.0325 0.0325 0.012" euler="0 0 315">
6766
<geom mesh="propR" material="black" class="visual"/>
6867
</body>
69-
7068
</body>
7169
</worldbody>
7270

@@ -86,70 +84,4 @@
8684
<motor gear="0 0 0 0 0 1" site="motor3" name="motor3_torque" />
8785
</actuator>
8886

89-
<!-- Model Parameters
90-
Below are all the parameters unique to the drone setup
91-
Base is the Crazyflie 2.X, file name encodes the specific setup
92-
- Propellers/Motors options: L(egacy), P(lus), T(hrust upgrade kit), B(rushless)
93-
- Battery (250mAh / 350mAh)
94-
-->
95-
<custom>
96-
<!-- Physical Parameters-->
97-
<numeric name="gravity" data="9.807" /> <!-- Munich, Germany-->
98-
<numeric name="mass" data="0.03454" /> <!-- From identification for L250! TODO: Redo -->
99-
<numeric name="J" data="1.4e-5 0.0 0.0
100-
0.0 1.4e-5 0.0
101-
0.0 0.0 2.17e-5"/> <!-- From IROS 2022 -->
102-
<!-- <numeric name="J" data="1.68e-5 0.0 0.0
103-
0.0 1.68e-5 0.0
104-
0.0 0.0 2.98e-5" /> --> <!-- From Förster B.S. thesis -->
105-
<!-- Distance of motor from axis
106-
in x configuration, it's 1/sqrt(2) smaller
107-
arm "+" = 0.046 (from CAD); arm "x" = 0.03253 (rounded)-->
108-
<numeric name="arm" data="0.03253" />
109-
<!-- Matrix on how to mix the forces into torques, different for "x" and "+" config-->
110-
<numeric name="sign_matrix" data="-1 -1 -1
111-
-1 1 1
112-
1 1 -1
113-
1 -1 1" />
114-
<numeric name="prop_radius" data="2.31348e-2" />
115-
116-
<!-- Motors and Thrust-->
117-
<numeric name="PWM_MIN" data="20000.0" />
118-
<numeric name="PWM_MAX" data="65535.0" />
119-
<numeric name="THRUST_MIN" data="0.03" /> <!-- in N, per motor-->
120-
<numeric name="THRUST_MAX" data="0.1625" /> <!-- in N, per motor-->
121-
<numeric name="THRUST_TAU" data="8.719306881898989" />
122-
<numeric name="VMOTOR_MIN" data="0.983691398141343" /> <!-- in V-->
123-
<numeric name="VMOTOR_MAX" data="2.643523702759344" /> <!-- in V-->
124-
<numeric name="p_vmotor2thrust" data="-0.03978221591250353 0.10979738851226176 -0.05545304285403245 0.016215002062640885" /> <!--Index is order-->
125-
<numeric name="p_vmotor2rpm" data="2738.439005850152 8054.983767001532" /> <!--Index is order-->
126-
<numeric name="kf" data="1.068340683985525e-09" />
127-
<numeric name="km" data="7.94e-12" /> <!-- From old identification! TODO: Replace if possible-->
128-
129-
<!-- System Idenfication: Simple Model-->
130-
<numeric name="SI_roll" data="-3.96 4.08" /> <!-- From identification for L250! TODO: Redo -->
131-
<numeric name="SI_pitch" data="-6.00 6.21" /> <!-- From identification for L250! TODO: Redo -->
132-
<numeric name="SI_yaw" data="0.0 0.0" /> <!-- Not Identified!-->
133-
<numeric name="SI_acc" data="20.907574256269616 3.653687545690674" /> <!-- From identification for L250! TODO: Redo -->
134-
135-
<!-- System Identification: Double Integrator Model-->
136-
<numeric name="DI_roll" data="-99.94 -13.3 84.73" /> <!-- From identification for L250! TODO: Redo -->
137-
<numeric name="DI_pitch" data="-130.3 -16.33 119.3" /> <!-- From identification for L250! TODO: Redo -->
138-
<numeric name="DI_yaw" data="0.0 0.0 0.0" /> <!-- Not Identified!-->
139-
<numeric name="DI_acc" data="20.907574256269616 3.653687545690674" /> <!-- From identification for L250! TODO: Redo -->
140-
141-
<!-- System Identification: Double Integrator Model with delay-->
142-
<numeric name="DI_D_roll" data="-286.2 -23.03 225.6" /> <!-- From identification for L250! TODO: Redo -->
143-
<numeric name="DI_D_pitch" data="-286.2 -23.03 225.6" /><!-- From identification for L250! TODO: Redo -->
144-
<numeric name="DI_D_yaw" data="-192.9 -22.22 323.5" /> <!-- From identification for L250! TODO: Redo -->
145-
<numeric name="DI_D_acc" data="0.1670 0.5615 0.0654" /> <!--Index is order, tau is last-->
146-
147-
<!-- System Identification: Double Integrator Model with drag and delay-->
148-
<numeric name="DI_DD_roll" data="-257.2 -20.2 207.1" /> <!-- From identification for L250! TODO: Redo -->
149-
<numeric name="DI_DD_pitch" data="-257.2 -20.2 207.1" /> <!-- From identification for L250! TODO: Redo -->
150-
<numeric name="DI_DD_yaw" data="-225.3 -28.61 392.7" /> <!-- From identification for L250! TODO: Redo -->
151-
<numeric name="DI_DD_acc" data="1.0627 0.1891 -0.0177 0.0010" /> <!--c1, tau, c2, c3--> <!-- From identification for L250! TODO: Redo -->
152-
153-
</custom>
154-
15587
</mujoco>

drone_models/data/params.toml

Lines changed: 71 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,29 @@ J = [
99
[0.0, 1.68e-5, 0.0],
1010
[0.0, 0.0, 2.98e-5]
1111
]
12-
rpm2thrust = [0.0, 0.0, 3.16e-10] # TODO
13-
rpm2torque = [0.0, 0.0, 7.94e-12] # TODO
12+
rpm2thrust = [0.0, 0.0, 3.16e-10] # TODO, Index is order
13+
rpm2torque = [0.0, 0.0, 7.94e-12] # TODO, Index is order
1414
# TODO: This is an arbitrary number that leads to a working simulation. It MUST be fitted and
1515
# updated as soon as possible.
1616
thrust_tau = 0.03 # TODO value? TODO rename to rotor_tau
1717
mixing_matrix = [
18-
[-1.0, -1.0, 1.0, 1.0],
18+
[-1.0, -1.0, 1.0, 1.0],
1919
[-1.0, 1.0, 1.0, -1.0],
20-
[-1.0, 1.0, -1.0, 1.0]
20+
[-1.0, 1.0, -1.0, 1.0]
2121
]
22+
# The following parameters are for the platform, but are maybe not actually used by the models. However,
23+
# we still keep them here in one place, since some other things (sim, estimator, firmware) might need them.
24+
pwm_min = 20000
25+
pwm_max = 65535
26+
thrust_min = 0.02 # in N per motor
27+
thrust_max = 0.1125 # in N per motor
28+
vmotor_min = 1.003506695043662 # in V
29+
vmotor_max = 2.903351097106251 # in V
30+
vmotor2thrust = [-0.014830744918356092, 0.04724465241828281, -0.01847364358025878, 0.005960923942142] # Index is order
31+
vmotor2torque = [-0.014830744918356092, 0.04724465241828281, -0.01847364358025878, 0.005960923942142] # TODO, Index is order
32+
vmotor2rpm = [2828.6593993157803, 6686.5508078905705] # Index is order
33+
prop_radius = 23.55e-3 # TODO check
34+
prop_inertia = 34.52e-9 # TODO seems off
2235

2336

2437
[cf2x_P250]
@@ -31,33 +44,59 @@ J = [
3144
[0.0, 1.4e-5, 0.0],
3245
[0.0, 0.0, 2.17e-5]
3346
]
34-
rpm2thrust = [0.0, 0.0, 5.792654323957372e-10] # TODO
35-
rpm2torque = [0.0, 0.0, 7.94e-12] # TODO
36-
thrust_tau = 7.2333515424212695 # TODO value? TODO rename to rotor_tau
47+
rpm2thrust = [0.0, 0.0, 5.792654323957372e-10] # TODO, Index is order
48+
rpm2torque = [0.0, 0.0, 7.94e-12] # TODO, Index is order
49+
thrust_tau = 0.138 # TODO value? TODO rename to rotor_tau
3750
mixing_matrix = [
38-
[-1.0, -1.0, 1.0, 1.0],
51+
[-1.0, -1.0, 1.0, 1.0],
3952
[-1.0, 1.0, 1.0, -1.0],
40-
[-1.0, 1.0, -1.0, 1.0]
53+
[-1.0, 1.0, -1.0, 1.0]
4154
]
55+
# The following parameters are for the platform, but are maybe not actually used by the models. However,
56+
# we still keep them here in one place, since some other things (sim, estimator, firmware) might need them.
57+
pwm_min = 20000
58+
pwm_max = 65535
59+
thrust_min = 0.02 # in N per motor
60+
thrust_max = 0.1125 # in N per motor
61+
vmotor_min = 0.9857578735524497 # in V
62+
vmotor_max = 2.9966889966322077 # in V
63+
vmotor2thrust = [-0.02427920377129026, 0.06433042290821364, -0.026401054210489865, 0.006731877887386432] # Index is order
64+
vmotor2torque = [-0.02427920377129026, 0.06433042290821364, -0.026401054210489865, 0.006731877887386432] # TODO, Index is order
65+
vmotor2rpm = [4741.994550959416, 7472.9374014021605] # Index is order
66+
prop_radius = 23.4e-3 # TODO check
67+
prop_inertia = 26.97e-9
4268

4369

4470
[cf2x_T350]
4571
gravity_vec = [0.0, 0.0, -9.81]
46-
mass = 0.03454
72+
mass = 0.03454 # TODO
4773
L = 0.03253
48-
J = [
74+
J = [ # TODO
4975
[1.4e-5, 0.0, 0.0],
5076
[0.0, 1.4e-5, 0.0],
5177
[0.0, 0.0, 2.17e-5]
5278
]
53-
rpm2thrust = [0.0, 0.0, 1.068340683985525e-09] # TODO
54-
rpm2torque = [0.0, 0.0, 7.94e-12] # TODO
55-
thrust_tau = 8.719306881898989 # TODO value? TODO rename to rotor_tau
79+
rpm2thrust = [0.0, 0.0, 1.068340683985525e-09] # TODO, Index is order
80+
rpm2torque = [0.0, 0.0, 7.94e-12] # TODO, Index is order
81+
thrust_tau = 0.115 # TODO value? TODO rename to rotor_tau
5682
mixing_matrix = [
57-
[-1.0, -1.0, 1.0, 1.0],
83+
[-1.0, -1.0, 1.0, 1.0],
5884
[-1.0, 1.0, 1.0, -1.0],
59-
[-1.0, 1.0, -1.0, 1.0]
85+
[-1.0, 1.0, -1.0, 1.0]
6086
]
87+
# The following parameters are for the platform, but are maybe not actually used by the models. However,
88+
# we still keep them here in one place, since some other things (sim, estimator, firmware) might need them.
89+
pwm_min = 20000
90+
pwm_max = 65535
91+
thrust_min = 0.03 # in N per motor
92+
thrust_max = 0.1625 # in N per motor
93+
vmotor_min = 0.983691398141343 # in V
94+
vmotor_max = 2.643523702759344 # in V
95+
vmotor2thrust = [-0.03978221591250353, 0.10979738851226176, -0.05545304285403245, 0.016215002062640885] # Index is order
96+
vmotor2torque = [-0.03978221591250353, 0.10979738851226176, -0.05545304285403245, 0.016215002062640885] # TODO, Index is order
97+
vmotor2rpm = [2738.439005850152, 8054.983767001532] # Index is order
98+
prop_radius = 25.4e-3 # TODO check
99+
prop_inertia = 38.93e-9 # TODO value from B500, currenty unknown
61100

62101

63102
[cf21B_500]
@@ -69,12 +108,25 @@ J = [
69108
[0.0, 2.8e-5, 0.0],
70109
[0.0, 0.0, 4.9e-5]
71110
]
72-
rpm2thrust = [0.0, -8.357406697944084e-07, 4.716909960828207e-10]
73-
rpm2torque = [0.0, 2.435151264350409e-09, 2.424629050055297e-12]
111+
rpm2thrust = [0.0, 2.6713375766104237e-06, 2.9910560258944037e-10] # TODO , Index is order
112+
rpm2torque = [0.0, 2.435151264350409e-09, 2.424629050055297e-12] # TODO , Index is order
74113
thrust2torque = 0.00593893393599368
75114
thrust_tau = 0.08 # TODO value? TODO rename to rotor_tau
76115
mixing_matrix = [
77116
[-1.0, -1.0, 1.0, 1.0],
78117
[-1.0, 1.0, 1.0, -1.0],
79118
[-1.0, 1.0, -1.0, 1.0]
80-
]
119+
]
120+
# The following parameters are for the platform, but are maybe not actually used by the models. However,
121+
# we still keep them here in one place, since some other things (sim, estimator, firmware) might need them.
122+
pwm_min = 20000
123+
pwm_max = 65535
124+
thrust_min = 0.03 # in N per motor
125+
thrust_max = 0.18 # in N per motor
126+
vmotor_min = 0.983691398141343 # in V
127+
vmotor_max = 2.643523702759344 # in V
128+
vmotor2thrust = [-0.023218159473266192, 0.057892237383960946, -0.005372315709548128, 0.003180315209941464] # Index is order
129+
vmotor2torque = [-0.023218159473266192, 0.057892237383960946, -0.005372315709548128, 0.003180315209941464] # TODO, Index is order
130+
vmotor2rpm = [4304.90684659941, 3948.957007115487] # Index is order
131+
prop_radius = 27.5e-3 # TODO check
132+
prop_inertia = 38.93e-9

0 commit comments

Comments
 (0)