-
Notifications
You must be signed in to change notification settings - Fork 110
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
Contributing Weight-Shift Control Aircraft Model #116
Conversation
Hello @srmainwaring, here is my attempt at the PR to contribute the weight-shift control aircraft model. The primary contributions can be found in the models and world folders. I also drafted a doc file that I left at the top level of the repo instead of the doc directory like it probably should be. If these were to merge, I think you would want to move the doc file to the correct directory and delete the readme file I have for my fork (which is a copy of the doc file). |
Hi @NDevDrone - great addition! I'm looking forward to running this. A couple of quick change requests:
|
Hi @srmainwaring, just did that! Let me know if there is anything else to get it right. Cheers. |
I've got the simulation running and it's working well - I really like the model. I'll go through the model file in detail, but the major question I have is about the model orientation. It seems that the model axis is rotated 90 deg about z (so y is forward rather than x). There are offsets in the IMU sensor pose and ardupilot plugin poses to correct for this, but was there a reason for not aligning the model so that x-forward, y-left, z-up (this is the ROS REP 105 frame orientation convention)? Unfortunately the If it's a major re-work to change the model to standard orientation we can do it in a follow up, but it would make integration with ROS 2 easier if the REP 105 conventions were applied from the outset (if that's something you have in mind for later). I needed to set the pitch to an adjusted trim ( |
You happen to be our first external collaborator to try it out, so that's a relief! Thank you! As far as I know this is the first weight-shift aircraft of its kind implemented within Gazebo.
You're correct. This is a leftover quirk from how we started with the zephyr model as the starting reference, otherwise not an intentional choice.
I would like to get the model out there, and fix this issue in a follow-up PR. At this present moment on my team's end, there won't be time to spare for a little while to fix it, I am afraid. It is certainly something we intend to do when we can, as we will be looking to develop using the ArduPilot-ROS2 integration in the future. All that to be said, I'll fix up the doc to add the note like you had asked for arming rc 2 1552. Was there anything else? Or after that do you belief its ready to be merged? |
Hey @srmainwaring , I added two additional tweaks to the doc file to call out the orientation quirk, and the pitch midpoint arm issue you had mentioned. Let me know if you identify any other problems. Otherwise, I'd be happy to merge this in its present state. When time allows it we'll try to fix the orientation issue with a revised model, but that might take a little bit of work. |
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.
Very nice model, thanks for the PR. There's a few changes to schedule for follow-up but this will be a great addition to the models configured for ArduPilot.
Gazebo/models/wsc_aircraft/model.sdf
Outdated
<collision name="wing_root_left_collision"> | ||
<geometry> | ||
<mesh> | ||
<uri>model://wsc_aircraft/meshes/wing_root_left.dae</uri> |
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.
This and other review comments are 'would be nice to fix' for future PRs but aren't blockers for this one.
May get better physics performance using custom collision meshes. These can either be primitives, or mesh files created by applying a decimation modifier to the original collada mesh. STL format for collisions result in smaller file sizes as it does not carry texture details.
Gazebo/models/wsc_aircraft/model.sdf
Outdated
</axis> | ||
</joint> | ||
|
||
<joint name="hang_block_joint" type="fixed"> |
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.
Depending on the physics solver, you may find instabilities with fixed joints. If this is the case replacing fixed joints with revolute joints with limits constrained to [0, 0] can yield better results. Was the case the Gazebo 11 ODE solver - DART may be better. This is why in the ardupilot_gazebo examples a revolute joint is used for the IMU link.
Gazebo/models/wsc_aircraft/model.sdf
Outdated
</axis> | ||
</joint> | ||
|
||
<!-- Gimbal camera links and joints --> |
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.
There is a gimbal_3d_small
model available in ardupilot_gazebo
that could be used here with an <include>
block.
Gazebo/models/wsc_aircraft/model.sdf
Outdated
|
||
<!-- plugins --> | ||
|
||
<plugin filename="libgz-sim-joint-state-publisher-system.so" |
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.
Can use a short form for the filename: gz-sim-joint-state-publisher-system
.
Gazebo/models/wsc_aircraft/model.sdf
Outdated
</plugin> | ||
|
||
<plugin | ||
filename="ignition-gazebo-forcetorque-system" |
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.
Prefer filename="gz-sim-forcetorque-system"
Gazebo/models/wsc_aircraft/model.sdf
Outdated
<link_name>fuselage</link_name> | ||
</plugin> | ||
|
||
<plugin filename="libgz-sim-apply-joint-force-system.so" |
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.
Use short form for filename.
Gazebo/models/wsc_aircraft/model.sdf
Outdated
<connectionTimeoutMaxCount>5</connectionTimeoutMaxCount> | ||
<lock_step>1</lock_step> | ||
|
||
<!-- Frame conventions |
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.
Note vehicle orientation is not REP 105 standard.
Gazebo/models/wsc_aircraft/model.sdf
Outdated
</plugin> | ||
|
||
</model> | ||
</sdf> |
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.
Add newline at end of files (VScode has a habit of stripping these...).
@NDevDrone - would you mind squashing the commits into a single commit and force push the update. ArduPilot repos only permit Signed-off-by: FirstName LastName <your.email@yourmailserver.com> Some details from the ArduPilot wiki here: |
@NDevDrone - problem with a force push from me to squash your changes. Don't panic all the changes are here:
I've been reminded the hard way why you never use I'll submit the PR from the squashed copy above - and reference this issue for details. My apologies for the error. Merged in #117. |
Weight-Shift Aircraft
Model for the Romaeris unmanned weight-shift control (uWSC) electric aircraft.
Usage
Gazebo and the plugins should be installed as per the ArduPilot Gazebo Plugin instructions.
Update the
GZ_SIM_RESOURCE_PATH
to include these models:Run Gazebo
Run ArduPilot SITL
sim_vehicle.py -v ArduPlane --model JSON --add-param-file=$HOME/SITL_Models/Gazebo/config/wsc_aircraft.param --console --map
The provided parameter configuration modifies the default plane parameter set to provide automatic flight control mode for the weight-shift aircraft model, as follows:
Included camera gimbal demo
The model includes a 3-axis camera gimbal implementation that makes use of the Ardupilot 3-axis gimbal controls.
Notes
Modelling and comparison to real weight-shift flight
Information on the aircraft model's body dynamics, aerodynamics, and comparison of the model fidelity with real weight-shift flight data can be found in the forthcoming conference paper titled "uWSC Aircraft Simulator: A Gazebo-based model for uncrewed weight-shift control aircraft flight simulation" that may be cited as follows:
Credits