-
Notifications
You must be signed in to change notification settings - Fork 13.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding tiltrotor airframe for gazebo simulation #24028
Open
Perrrewi
wants to merge
9
commits into
main
Choose a base branch
from
pr-gz-sim-tiltrotor
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+160
−17
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
e923be8
Adding tiltrotor model
Perrrewi 07d22f2
Adjust to gz, and quick tuning
Perrrewi 2a02d0a
Adding min-max angles on controlsurface to use for normalized servo o…
Perrrewi 8989bca
Add function descriptions
Perrrewi 62be974
Set parameters in GZBridge to avoid flash memory issues
Perrrewi 1e21952
Set airframe number in falling order
Perrrewi 7791522
Add todo
Perrrewi 6a3d9db
Make a cleaner explanation
Perrrewi 3b7122e
Update to 20 as 19 is occupied
Perrrewi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
112 changes: 112 additions & 0 deletions
112
ROMFS/px4fmu_common/init.d-posix/airframes/4020_gz_tiltrotor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
#!/bin/sh | ||
# | ||
# @name VTOL Tiltrotor | ||
# | ||
# @type VTOL Tiltrotor | ||
# | ||
|
||
. ${R}etc/init.d/rc.vtol_defaults | ||
|
||
PX4_SIMULATOR=${PX4_SIMULATOR:=gz} | ||
PX4_GZ_WORLD=${PX4_GZ_WORLD:=default} | ||
PX4_SIM_MODEL=${PX4_SIM_MODEL:=tiltrotor} | ||
|
||
param set-default SIM_GZ_EN 1 # Gazebo bridge | ||
|
||
param set-default SENS_EN_GPSSIM 1 | ||
param set-default SENS_EN_BAROSIM 0 | ||
param set-default SENS_EN_MAGSIM 1 | ||
param set-default SENS_EN_ARSPDSIM 0 | ||
|
||
param set-default MAV_TYPE 21 | ||
|
||
param set-default CA_AIRFRAME 3 | ||
|
||
param set-default CA_ROTOR_COUNT 4 | ||
param set-default CA_ROTOR0_PX 0.1515 | ||
param set-default CA_ROTOR0_PY 0.245 | ||
param set-default CA_ROTOR0_KM 0.05 | ||
param set-default CA_ROTOR1_PX -0.1515 | ||
param set-default CA_ROTOR1_PY -0.1875 | ||
param set-default CA_ROTOR1_KM 0.05 | ||
param set-default CA_ROTOR2_PX 0.1515 | ||
param set-default CA_ROTOR2_PY -0.245 | ||
param set-default CA_ROTOR2_KM -0.05 | ||
param set-default CA_ROTOR3_PX -0.1515 | ||
param set-default CA_ROTOR3_PY 0.1875 | ||
param set-default CA_ROTOR3_KM -0.05 | ||
|
||
param set-default CA_ROTOR0_TILT 1 | ||
param set-default CA_ROTOR2_TILT 2 | ||
param set-default CA_SV_TL0_MAXA 90 | ||
param set-default CA_SV_TL0_MINA 0 | ||
param set-default CA_SV_TL0_TD 0 | ||
param set-default CA_SV_TL0_CT 1 | ||
param set-default CA_SV_TL1_MAXA 90 | ||
param set-default CA_SV_TL1_MINA 0 | ||
param set-default CA_SV_TL1_TD 0 | ||
param set-default CA_SV_TL1_CT 1 | ||
|
||
param set-default CA_SV_CS0_TRQ_R -0.5 | ||
param set-default CA_SV_CS0_TYPE 1 | ||
param set-default CA_SV_CS1_TRQ_R 0.5 | ||
param set-default CA_SV_CS1_TYPE 2 | ||
param set-default CA_SV_CS2_TRQ_P 1 | ||
param set-default CA_SV_CS2_TYPE 3 | ||
param set-default CA_SV_CS_COUNT 3 | ||
param set-default CA_SV_TL_COUNT 2 | ||
|
||
param set-default SIM_GZ_EC_FUNC1 101 | ||
param set-default SIM_GZ_EC_FUNC2 102 | ||
param set-default SIM_GZ_EC_FUNC3 103 | ||
param set-default SIM_GZ_EC_FUNC4 104 | ||
|
||
param set-default SIM_GZ_EC_MIN1 10 | ||
param set-default SIM_GZ_EC_MIN2 10 | ||
param set-default SIM_GZ_EC_MIN3 10 | ||
param set-default SIM_GZ_EC_MIN4 10 | ||
|
||
param set-default SIM_GZ_EC_MAX1 1500 | ||
param set-default SIM_GZ_EC_MAX2 1500 | ||
param set-default SIM_GZ_EC_MAX3 1500 | ||
param set-default SIM_GZ_EC_MAX4 1500 | ||
|
||
param set-default SIM_GZ_SV_FUNC1 201 | ||
param set-default SIM_GZ_SV_FUNC2 202 | ||
param set-default SIM_GZ_SV_FUNC3 203 | ||
param set-default SIM_GZ_SV_FUNC4 204 | ||
param set-default SIM_GZ_SV_FUNC5 205 | ||
|
||
param set-default SIM_GZ_SV_MAX4 2700 | ||
param set-default SIM_GZ_SV_MIN4 1800 | ||
param set-default SIM_GZ_SV_MAX5 2700 | ||
param set-default SIM_GZ_SV_MIN5 1800 | ||
|
||
param set-default NPFG_PERIOD 12 | ||
param set-default FW_PR_FF 0.2 | ||
param set-default FW_PR_P 0.9 | ||
param set-default FW_PSP_OFF 2 | ||
param set-default FW_P_LIM_MIN -15 | ||
param set-default FW_RR_FF 0.1 | ||
param set-default FW_RR_P 0.3 | ||
param set-default FW_THR_TRIM 0.38 | ||
param set-default FW_THR_MAX 0.6 | ||
param set-default FW_THR_MIN 0.05 | ||
param set-default FW_T_CLMB_MAX 8 | ||
param set-default FW_T_SINK_MAX 2.7 | ||
param set-default FW_T_SINK_MIN 2.2 | ||
|
||
param set-default MC_AIRMODE 1 | ||
param set-default MC_YAWRATE_P 0.4 | ||
param set-default MC_YAWRATE_I 0.1 | ||
|
||
param set-default MPC_XY_VEL_P_ACC 3 | ||
param set-default MPC_XY_VEL_I_ACC 4 | ||
param set-default MPC_XY_VEL_D_ACC 0.1 | ||
|
||
param set-default MIS_TAKEOFF_ALT 10 | ||
|
||
param set-default VT_FWD_THRUST_EN 4 | ||
param set-default VT_FWD_THRUST_SC 0.6 | ||
param set-default VT_TILT_TRANS 0.6 | ||
param set-default VT_TYPE 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule gz
updated
6 files
+12 −18 | models/advanced_plane/model.sdf | |
+2 −4 | models/lawnmower/model.sdf | |
+12 −13 | models/rc_cessna/model.sdf | |
+6 −7 | models/standard_vtol/model.sdf | |
+15 −0 | models/tiltrotor/model.config | |
+942 −0 | models/tiltrotor/model.sdf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where do these numbers come from? Can we normalize it for simulation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The goal is to map the full rotation of -180° to 180° (probably the most you could ever want) as a uint16 range of 0 to 3600 because we (still) don't have float mixing which was drafted in #22488
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, thanks! so this was what I was wondering. I guess it is fine for now, but would wish if we can remove the arbitrary scaling which a lot of people having stumbling over (including myself repeatedly many times).