Skip to content

Commit f2dcbcc

Browse files
authored
add octorotor dynamics (#32)
- add octorotor dynamics - add ariframe printer - add --force option to force upload firmware and update params - update docker.sh commands - update cyphal configs
1 parent 136d1a3 commit f2dcbcc

14 files changed

Lines changed: 395 additions & 241 deletions

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ The following modes are supported as well, but they are not well-tested:
4444

4545
|| Autopilot | Communicator | dynamics | Airframe |
4646
| - | -------- | --------- | ------------ | -------- |
47-
| 1 | PX4 v1.12| DroneCAN HITL | flightgoggles_multicopter | iris [(10016)](https://github.com/PonomarevDA/Firmware/blob/px4_v1.12.1_inno_vtol_dynamics/ROMFS/px4fmu_common/init.d-posix/airframes/10016_iris) |
47+
| 1 | PX4 v1.12| DroneCAN HITL | quadcopter | iris [(10016)](https://github.com/PonomarevDA/Firmware/blob/px4_v1.12.1_inno_vtol_dynamics/ROMFS/px4fmu_common/init.d-posix/airframes/10016_iris) |
4848
| 2 | PX4 v1.12 | MAVLink SITL | inno_vtol | innopolis_vtol [(1050)](https://github.com/PonomarevDA/Firmware/blob/px4_v1.12.1_inno_vtol_dynamics/ROMFS/px4fmu_common/init.d-posix/airframes/1050_innopolis_vtol) |
49-
| 3 | PX4 v1.12 | MAVLink SITL | flightgoggles_multicopter | iris [(10016)](https://github.com/PonomarevDA/Firmware/blob/px4_v1.12.1_inno_vtol_dynamics/ROMFS/px4fmu_common/init.d-posix/airframes/10016_iris) |
49+
| 3 | PX4 v1.12 | MAVLink SITL | quadcopter | iris [(10016)](https://github.com/PonomarevDA/Firmware/blob/px4_v1.12.1_inno_vtol_dynamics/ROMFS/px4fmu_common/init.d-posix/airframes/10016_iris) |
5050
| 4 | ArduPilot v4.3/v4.4 | DroneCAN HITL | inno_vtol | copter |
5151
| 5 | ArduPilot v4.3/v4.4 | Cyphal HITL | inno_vtol | copter |
5252

@@ -126,11 +126,11 @@ wget https://github.com/ZilantRobotics/PX4-Autopilot/releases/download/v1.13.0_h
126126

127127
**Step 5. Configure autopilot**
128128

129-
You need to run the [scripts/autopilot_configure.py](scripts/autopilot_configure.py). It will automatically will reset your parameters to default, and then configure exactly the parameters your autopilot needs for the HITL simulation. It will automatically restart the autopilot a few times.
129+
You need to run the [scripts/parameters_configurator.py](scripts/parameters_configurator.py). It will automatically will reset your parameters to default, and then configure exactly the parameters your autopilot needs for the HITL simulation. It will automatically restart the autopilot a few times.
130130

131131
```bash
132132
pip install mavlink_tools
133-
./scripts/autopilot_configure.py <desired_mode>
133+
./scripts/parameters_configurator.py <desired_mode>
134134
```
135135

136136
If your desired mode is not supported, refer to the corresponded section for the details:

communicators/cyphal_communicator

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
SYS_AUTOSTART: 4001
2+
3+
UCAN1_ESC_FUNC1: 101
4+
UCAN1_ESC_FUNC2: 102
5+
UCAN1_ESC_FUNC3: 103
6+
UCAN1_ESC_FUNC4: 104
7+
8+
MC_YAWRATE_P: 0.6
9+
MC_YAWRATE_I: 0.02
10+
MC_YAWRATE_MAX: 40.0
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
SYS_AUTOSTART: 12001
2+
3+
UCAN1_ESC_FUNC1: 101
4+
UCAN1_ESC_FUNC2: 102
5+
UCAN1_ESC_FUNC3: 103
6+
UCAN1_ESC_FUNC4: 104
7+
UCAN1_ESC_FUNC5: 105
8+
UCAN1_ESC_FUNC6: 106
9+
UCAN1_ESC_FUNC7: 107
10+
UCAN1_ESC_FUNC8: 108
11+
12+
MC_YAWRATE_P: 0.2
13+
MC_YAWRATE_I: 0.1
14+
MC_YAWRATE_MAX: 200.0

configs/px4_v1.14_quadcopter_airframe.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ UCAN1_ESC_FUNC2: 102
55
UCAN1_ESC_FUNC3: 103
66
UCAN1_ESC_FUNC4: 104
77

8-
MC_YAWRATE_P: 0.6
9-
MC_YAWRATE_I: 0.02
10-
MC_YAWRATE_MAX: 40.0
8+
MC_YAWRATE_P: 0.2
9+
MC_YAWRATE_I: 0.1
10+
MC_YAWRATE_MAX: 200.0

scripts/airframe_printer.sh

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
#!/bin/bash
2+
3+
PX4_QUADROTOR_X_4001="""
4+
___ ___
5+
/ \ / \
6+
| 3 | | 1 |
7+
\___/\ /\___/
8+
\_____/
9+
| PX4 |
10+
|4001 |
11+
|_____|
12+
___ / \ ___
13+
/ \/ \/ \
14+
| 2 | | 4 |
15+
\___/ \___/
16+
"""
17+
18+
PX4_OCTOROTOR_COAXIAL_12001="""
19+
___ ___
20+
/ \ / \
21+
| 2,5 | | 1,6 |
22+
\___/\ /\___/
23+
\_____/
24+
| PX4 |
25+
|12001|
26+
|_____|
27+
___ / \ ___
28+
/ \/ \/ \
29+
| 3,8 | | 4,7 |
30+
\___/ \___/
31+
"""
32+
33+
PX4_STANDARD_VTOL_13000="""
34+
___ ___
35+
/ \ _ / \
36+
| 3 | / \ | 1 |
37+
\___/ / \ \___/
38+
| | | |
39+
__|___| PX4 |___|__
40+
/ | 13000 | \
41+
/__ |_____________|___\
42+
_|_ | | _|_
43+
/ \ | | / \
44+
| 2 | | | | 4 |
45+
\___/ | | \___/
46+
___| |___
47+
/__________\
48+
"""
49+
50+
PX4_VTOL_OCTOPLANE_13050="""
51+
___ ___
52+
/ \ _ / \
53+
| 2,5 | / \ | 1,6 |
54+
\___/ / \ \___/
55+
| | | |
56+
__|___| PX4 |___|__
57+
/ | 13050 | \
58+
/__ |_____________|___\
59+
_|_ | | _|_
60+
/ \ | | / \
61+
| 3,8 | | | | 4,7 |
62+
\___/ | | \___/
63+
___| |___
64+
/__________\
65+
"""
66+
67+
if [[ $1 == 4001 ]]; then
68+
echo """
69+
PX4 Quadrotor x
70+
(4001)$PX4_QUADROTOR_X_4001"""
71+
72+
elif [[ $1 == 12001 ]]; then
73+
echo """
74+
PX4 Octorotor Coaxial
75+
(12001)$PX4_OCTOROTOR_COAXIAL_12001"""
76+
77+
elif [[ $1 == 13000 ]]; then
78+
echo """
79+
PX4 Standard VTOL
80+
(13000)$PX4_STANDARD_VTOL_13000"""
81+
82+
elif [[ $1 == 13050 ]]; then
83+
echo """
84+
PX4 VTOL Octoplane
85+
(13050)$PX4_VTOL_OCTOPLANE_13050"""
86+
fi

scripts/autopilot_configurator.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
echo ""
4+
echo "Automatical configuration:"
5+
echo "1. Download firmware"
6+
echo "2. Upload firmware to the autopilot"
7+
echo "3. Configure parameters"
8+
9+
wget https://github.com/ZilantRobotics/PX4-Autopilot/releases/download/v1.14.0-0.3.0-beta1/px4_fmu-v5_cyphal.px4
10+
./px4/upload.sh px4_fmu-v5_cyphal.px4
11+
12+
if [[ $1 == 4001 ]]; then
13+
./parameters_configurator.py px4_v1_14_cyphal_quadcopter_configs
14+
elif [[ $1 == 12001 ]]; then
15+
./parameters_configurator.py px4_v1_14_cyphal_octorotor_configs
16+
elif [[ $1 == 13000 ]]; then
17+
./parameters_configurator.py px4_v1_14_cyphal_inno_quadcopter_configs
18+
elif [[ $1 == 13050 ]]; then
19+
echo $1
20+
fi

scripts/cyphal_config_slcan0.sh

Lines changed: 1 addition & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -17,96 +17,4 @@ export UAVCAN__NODE__ID=2
1717

1818
export ALLOCATION_TABLE_PATH=allocation_table.db
1919

20-
21-
# Todo: identifiers should be defined dynamicly in future
22-
23-
# Kotleta mock port id. Common for all ESC:
24-
export UAVCAN__SUB__NOTE_RESPONSE__ID=2341
25-
export UAVCAN__SUB__SETPOINT__ID=2342
26-
export UAVCAN__SUB__READINESS__ID=2343
27-
28-
# Kotleta mock port id. ESC #1:
29-
export UAVCAN__PUB__ESC_HEARTBEAT_1__ID=2374
30-
export UAVCAN__PUB__FEEDBACK_1__ID=2375
31-
export UAVCAN__PUB__POWER_1__ID=2376
32-
export UAVCAN__PUB__STATUS_1__ID=2377
33-
export UAVCAN__PUB__DYNAMICS_1__ID=2378
34-
35-
# Kotleta mock port id. ESC #2:
36-
export UAVCAN__PUB__ESC_HEARTBEAT_2__ID=2354
37-
export UAVCAN__PUB__FEEDBACK_2__ID=2355
38-
export UAVCAN__PUB__POWER_2__ID=2356
39-
export UAVCAN__PUB__STATUS_2__ID=2357
40-
export UAVCAN__PUB__DYNAMICS_2__ID=2358
41-
42-
# Kotleta mock port id. ESC #3:
43-
export UAVCAN__PUB__ESC_HEARTBEAT_3__ID=2364
44-
export UAVCAN__PUB__FEEDBACK_3__ID=2365
45-
export UAVCAN__PUB__POWER_3__ID=2366
46-
export UAVCAN__PUB__STATUS_3__ID=2367
47-
export UAVCAN__PUB__DYNAMICS_3__ID=2368
48-
49-
# Kotleta mock port id. ESC #4:
50-
export UAVCAN__PUB__ESC_HEARTBEAT_4__ID=2344
51-
export UAVCAN__PUB__FEEDBACK_4__ID=2345
52-
export UAVCAN__PUB__POWER_4__ID=2346
53-
export UAVCAN__PUB__STATUS_4__ID=2347
54-
export UAVCAN__PUB__DYNAMICS_4__ID=2348
55-
56-
57-
58-
# Server node port id. Common for all ESC:
59-
export UAVCAN__PUB__NOTE_RESPONSE__ID=$UAVCAN__SUB__NOTE_RESPONSE__ID
60-
export UAVCAN__PUB__SETPOINT__ID=$UAVCAN__SUB__SETPOINT__ID
61-
export UAVCAN__PUB__READINESS__ID=$UAVCAN__SUB__READINESS__ID
62-
63-
# Server node port id. ESC #1:
64-
export UAVCAN__SUB__ESC_HEARTBEAT_1__ID=$UAVCAN__PUB__ESC_HEARTBEAT_1__ID
65-
export UAVCAN__SUB__FEEDBACK_1__ID=$UAVCAN__PUB__FEEDBACK_1__ID
66-
export UAVCAN__SUB__POWER_1__ID=$UAVCAN__PUB__POWER_1__ID
67-
export UAVCAN__SUB__STATUS_1__ID=$UAVCAN__PUB__STATUS_1__ID
68-
export UAVCAN__SUB__DYNAMICS_1__ID=$UAVCAN__PUB__DYNAMICS_1__ID
69-
70-
# Server node port id. ESC #2:
71-
export UAVCAN__SUB__ESC_HEARTBEAT_2__ID=$UAVCAN__PUB__ESC_HEARTBEAT_2__ID
72-
export UAVCAN__SUB__FEEDBACK_2__ID=$UAVCAN__PUB__FEEDBACK_2__ID
73-
export UAVCAN__SUB__POWER_2__ID=$UAVCAN__PUB__POWER_2__ID
74-
export UAVCAN__SUB__STATUS_2__ID=$UAVCAN__PUB__STATUS_2__ID
75-
export UAVCAN__SUB__DYNAMICS_2__ID=$UAVCAN__PUB__DYNAMICS_2__ID
76-
77-
# Server node port id. ESC #3:
78-
export UAVCAN__SUB__ESC_HEARTBEAT_3__ID=$UAVCAN__PUB__ESC_HEARTBEAT_3__ID
79-
export UAVCAN__SUB__FEEDBACK_3__ID=$UAVCAN__PUB__FEEDBACK_3__ID
80-
export UAVCAN__SUB__POWER_3__ID=$UAVCAN__PUB__POWER_3__ID
81-
export UAVCAN__SUB__STATUS_3__ID=$UAVCAN__PUB__STATUS_3__ID
82-
export UAVCAN__SUB__DYNAMICS_3__ID=$UAVCAN__PUB__DYNAMICS_3__ID
83-
84-
# Server node port id. ESC #4:
85-
export UAVCAN__SUB__ESC_HEARTBEAT_4__ID=$UAVCAN__PUB__ESC_HEARTBEAT_4__ID
86-
export UAVCAN__SUB__FEEDBACK_4__ID=$UAVCAN__PUB__FEEDBACK_4__ID
87-
export UAVCAN__SUB__POWER_4__ID=$UAVCAN__PUB__POWER_4__ID
88-
export UAVCAN__SUB__STATUS_4__ID=$UAVCAN__PUB__STATUS_4__ID
89-
export UAVCAN__SUB__DYNAMICS_4__ID=$UAVCAN__PUB__DYNAMICS_4__ID
90-
91-
# HITL sensors
92-
export UAVCAN__PUB__ACCEL__ID=2400
93-
export UAVCAN__PUB__GYRO__ID=2401
94-
export UAVCAN__PUB__MAGNETOMETER__ID=2402
95-
export UAVCAN__PUB__BARO_TEMPERATURE__ID=2403
96-
export UAVCAN__PUB__BARO_PRESSURE__ID=2404
97-
export UAVCAN__PUB__GPS_YAW__ID=2405
98-
export UAVCAN__PUB__GPS_POINT__ID=2406
99-
export UAVCAN__PUB__GPS_SATS__ID=2407
100-
export UAVCAN__PUB__GPS_STATUS__ID=2408
101-
export UAVCAN__PUB__GPS_PDOP__ID=2409
102-
103-
# HITL Actuators
104-
export UAVCAN__PUB__ESC_STATUS_0__ID=2500
105-
export UAVCAN__PUB__ESC_STATUS_1__ID=2501
106-
export UAVCAN__PUB__ESC_STATUS_2__ID=2502
107-
export UAVCAN__PUB__ESC_STATUS_3__ID=2503
108-
109-
export UAVCAN__PUB__ESC_STATUS_4__ID=2504
110-
export UAVCAN__PUB__ESC_STATUS_5__ID=2505
111-
export UAVCAN__PUB__ESC_STATUS_6__ID=2506
112-
export UAVCAN__PUB__ESC_STATUS_7__ID=2507
20+
source $SCRIPT_DIR/cyphal_port_id.sh

scripts/cyphal_config_slcan1.sh

Lines changed: 1 addition & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -17,85 +17,4 @@ export UAVCAN__NODE__ID=2
1717

1818
export ALLOCATION_TABLE_PATH=allocation_table.db
1919

20-
21-
# Todo: identifiers should be defined dynamicly in future
22-
23-
# Kotleta mock port id. Common for all ESC:
24-
export UAVCAN__SUB__NOTE_RESPONSE__ID=2341
25-
export UAVCAN__SUB__SETPOINT__ID=2342
26-
export UAVCAN__SUB__READINESS__ID=2343
27-
28-
# Kotleta mock port id. ESC #1:
29-
export UAVCAN__PUB__ESC_HEARTBEAT_1__ID=2374
30-
export UAVCAN__PUB__FEEDBACK_1__ID=2375
31-
export UAVCAN__PUB__POWER_1__ID=2376
32-
export UAVCAN__PUB__STATUS_1__ID=2377
33-
export UAVCAN__PUB__DYNAMICS_1__ID=2378
34-
35-
# Kotleta mock port id. ESC #2:
36-
export UAVCAN__PUB__ESC_HEARTBEAT_2__ID=2354
37-
export UAVCAN__PUB__FEEDBACK_2__ID=2355
38-
export UAVCAN__PUB__POWER_2__ID=2356
39-
export UAVCAN__PUB__STATUS_2__ID=2357
40-
export UAVCAN__PUB__DYNAMICS_2__ID=2358
41-
42-
# Kotleta mock port id. ESC #3:
43-
export UAVCAN__PUB__ESC_HEARTBEAT_3__ID=2364
44-
export UAVCAN__PUB__FEEDBACK_3__ID=2365
45-
export UAVCAN__PUB__POWER_3__ID=2366
46-
export UAVCAN__PUB__STATUS_3__ID=2367
47-
export UAVCAN__PUB__DYNAMICS_3__ID=2368
48-
49-
# Kotleta mock port id. ESC #4:
50-
export UAVCAN__PUB__ESC_HEARTBEAT_4__ID=2344
51-
export UAVCAN__PUB__FEEDBACK_4__ID=2345
52-
export UAVCAN__PUB__POWER_4__ID=2346
53-
export UAVCAN__PUB__STATUS_4__ID=2347
54-
export UAVCAN__PUB__DYNAMICS_4__ID=2348
55-
56-
57-
58-
# Server node port id. Common for all ESC:
59-
export UAVCAN__PUB__NOTE_RESPONSE__ID=$UAVCAN__SUB__NOTE_RESPONSE__ID
60-
export UAVCAN__PUB__SETPOINT__ID=$UAVCAN__SUB__SETPOINT__ID
61-
export UAVCAN__PUB__READINESS__ID=$UAVCAN__SUB__READINESS__ID
62-
63-
# Server node port id. ESC #1:
64-
export UAVCAN__SUB__ESC_HEARTBEAT_1__ID=$UAVCAN__PUB__ESC_HEARTBEAT_1__ID
65-
export UAVCAN__SUB__FEEDBACK_1__ID=$UAVCAN__PUB__FEEDBACK_1__ID
66-
export UAVCAN__SUB__POWER_1__ID=$UAVCAN__PUB__POWER_1__ID
67-
export UAVCAN__SUB__STATUS_1__ID=$UAVCAN__PUB__STATUS_1__ID
68-
export UAVCAN__SUB__DYNAMICS_1__ID=$UAVCAN__PUB__DYNAMICS_1__ID
69-
70-
# Server node port id. ESC #2:
71-
export UAVCAN__SUB__ESC_HEARTBEAT_2__ID=$UAVCAN__PUB__ESC_HEARTBEAT_2__ID
72-
export UAVCAN__SUB__FEEDBACK_2__ID=$UAVCAN__PUB__FEEDBACK_2__ID
73-
export UAVCAN__SUB__POWER_2__ID=$UAVCAN__PUB__POWER_2__ID
74-
export UAVCAN__SUB__STATUS_2__ID=$UAVCAN__PUB__STATUS_2__ID
75-
export UAVCAN__SUB__DYNAMICS_2__ID=$UAVCAN__PUB__DYNAMICS_2__ID
76-
77-
# Server node port id. ESC #3:
78-
export UAVCAN__SUB__ESC_HEARTBEAT_3__ID=$UAVCAN__PUB__ESC_HEARTBEAT_3__ID
79-
export UAVCAN__SUB__FEEDBACK_3__ID=$UAVCAN__PUB__FEEDBACK_3__ID
80-
export UAVCAN__SUB__POWER_3__ID=$UAVCAN__PUB__POWER_3__ID
81-
export UAVCAN__SUB__STATUS_3__ID=$UAVCAN__PUB__STATUS_3__ID
82-
export UAVCAN__SUB__DYNAMICS_3__ID=$UAVCAN__PUB__DYNAMICS_3__ID
83-
84-
# Server node port id. ESC #4:
85-
export UAVCAN__SUB__ESC_HEARTBEAT_4__ID=$UAVCAN__PUB__ESC_HEARTBEAT_4__ID
86-
export UAVCAN__SUB__FEEDBACK_4__ID=$UAVCAN__PUB__FEEDBACK_4__ID
87-
export UAVCAN__SUB__POWER_4__ID=$UAVCAN__PUB__POWER_4__ID
88-
export UAVCAN__SUB__STATUS_4__ID=$UAVCAN__PUB__STATUS_4__ID
89-
export UAVCAN__SUB__DYNAMICS_4__ID=$UAVCAN__PUB__DYNAMICS_4__ID
90-
91-
# HITL sensors
92-
export UAVCAN__PUB__ACCEL__ID=2400
93-
export UAVCAN__PUB__GYRO__ID=2401
94-
export UAVCAN__PUB__MAGNETOMETER__ID=2402
95-
export UAVCAN__PUB__BARO_TEMPERATURE__ID=2403
96-
export UAVCAN__PUB__BARO_PRESSURE__ID=2404
97-
export UAVCAN__PUB__GPS_YAW__ID=2405
98-
export UAVCAN__PUB__GPS_POINT__ID=2406
99-
export UAVCAN__PUB__GPS_SATS__ID=2407
100-
export UAVCAN__PUB__GPS_STATUS__ID=2408
101-
export UAVCAN__PUB__GPS_PDOP__ID=2409
20+
source $SCRIPT_DIR/cyphal_port_id.sh

0 commit comments

Comments
 (0)