Closed NDevDrone closed 5 months ago
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.
Let me know if there is anything else to get it right.
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 zephr
model in the ardupilot_gazebo repo is similarly aligned. This was inherited from the original model prior to modification to work with ArduPilot. I should change it as it is not a good example for setting up a ROS compliant vehicle.
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 (rc 2 1552
IIRC) in order to arm the model - could you add a note in the model doc to advise on this and additional RC settings needed.
I've got the simulation running and it's working well - I really like the model.
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.
rotated 90 deg about z (so y is forward rather than x).
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.
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.
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.
@NDevDrone - would you mind squashing the commits into a single commit and force push the update. ArduPilot repos only permit Rebase and merge
and squashing keeps master
branch cleaner. Also can you make sure to DCO sign the final commit. This is a line containing your name and email at the end of the commit (preceded by an empty line).
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 master
for PR's...
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
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.![GimbalDemo](https://github.com/NDevDrone/SITL_Models/assets/50757802/9844586d-614e-4028-973f-9e12f8dd68c5)
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