-
Notifications
You must be signed in to change notification settings - Fork 804
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
New vehicle type: Airship #490
Conversation
added cloudship model
- aerodynamics - bouyancy - gazebo freezes upon entering
- direct use of -gen.sdf from sdf.jinja
@dan-leo can you put here a screenshot of how it looks? |
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.
Thanks for the great contribution!
Small comments
- It seems like there is some changes regarding the motor_model that is not compatible with multirotors. This seems to be coming from the fact that you want to support bidirectional thrust. Could we maybe make this compatible for also multirotors?
- It is not clear why you need a buoyancy plugin and aerodynamics plugin separately unless it is expected other systems use the plugin as a module. Otherwise I think it should be a single plugin that simulates airship dynamics.
- Maybe not for this PR, but to note: the airship doesn't have any effect with wind currently.
- the
.world.
file is not used unless you want to have vehicle specific physics.
@Jaeyoung-Lim thank you for the informative review, your feedback is much appreciated. On your comments:
|
…date airship model with the addition of wind
@Jaeyoung-Lim I made the necessary changes as you suggested. |
The following command does not work to start the simulation: This is because of the recent changes to split the models and worlds for sitl_gazebo. The models that are auto-generated with jinja have the suffix Any ideas how to fix this? |
include/gazebo_lta_dynamics_plugin.h
Outdated
|
||
double param_hull_volume_; | ||
double param_air_density_; | ||
double param_m11_; |
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.
Could you document what each parameter stands for?
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.
On lines 56-83 I documented what each of the gazebo plugin parameters are. I thought that would be sufficient. Would you rather that I restate that here for each variable as well? Let me know what you think and I'll make the necessary changes
@Jaeyoung-Lim please let me know if there is anything else you would recommend/suggest for the PR? There is one CI check that is failing. It is related to the macOS build, any advice on this? |
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 is really cool and thanks for the contribution. The macOS failure is most likely unrelated to this PR
- I believe the optical fow submodule was unintentionally updated
- I am a bit concerned on how the reversible thrust is handled. I would prefer if we have a turning direction and a separate reversible(true/false) parameter which makes it more explicit. This is actually more inline on what the px4 mixer is doing.
- I also think that you need to explicitly specify
MAV_TYPE
to airship as commented in New vehicle type: Airship PX4-Autopilot#14862 (comment) so that we are sure that the rotor velocity setpoints actually range from -1 ~ + 1 rather than 0 ~ 1 - Since the
MAV_TYPE
is called airship in the mavlink standard, wouldn't it be more straight forward to call the dynamics plugin airship_dynamics_plugin rather than lta_dynamics plugin? LTA doesn't seem to be a term that is used in any of the mavlink standard or the px4 ecosystem. - Regarding New vehicle type: Airship #490 (comment) please do!
src/gazebo_motor_model.cpp
Outdated
force = std::abs(force); | ||
} | ||
|
||
int turning_dir = turning_direction_type_ / std::abs(turning_direction_type_); |
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.
Could we maybe not mix turning_direction_type_
and the turning_direction
? maybe add another boolean sdf element for "reversible"? I think this matches the mixer definitions better and makes it more explicit.
src/gazebo_motor_model.cpp
Outdated
@@ -233,7 +243,7 @@ void GazeboMotorModel::UpdateForcesAndMoments() { | |||
#else | |||
ignition::math::Pose3d pose_difference = ignitionFromGazeboMath(link_->GetWorldCoGPose() - parent_links.at(0)->GetWorldCoGPose()); | |||
#endif | |||
ignition::math::Vector3d drag_torque(0, 0, -turning_direction_ * force * moment_constant_); | |||
ignition::math::Vector3d drag_torque(0, 0, -turning_dir * force * moment_constant_); |
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.
My main concern with making the reversible parameter part of the turning direction, is that the reference rotor velocity range are not explicitly defined. (It can range from 01 or -1+1 depending on the MAV_TYPE
( https://github.com/PX4/Firmware/blob/master/src/modules/simulator/simulator_mavlink.cpp#L133 ). This will add an additional layer of confusion when something is not working as intended.
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.
I've set MAV_TYPE to 7 (Airship, controlled) only and by sticking to -1..1, that should certainly help.
include/gazebo_motor_model.h
Outdated
@@ -42,6 +42,8 @@ | |||
namespace turning_direction { | |||
const static int CCW = 1; | |||
const static int CW = -1; | |||
const static int CCW_REVERSABLE = 2; | |||
const static int CW_REVERSABLE = -2; |
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.
As I commented in the other part of the code, I think reversible should be a separate state (possibly a boolean)
@dan-leo @antonerasm Could we maybe try to conclude this and try to get it in? |
@Jaeyoung-Lim Certainly! My apologies for the delay. I will add the latest requests to get this done. |
@Jaeyoung-Lim I think I have covered everything. I also updated the PR in the Firmware branch to change the MAV_TYPE and the actuator command ranges. Please, let me know if there is anything else. |
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 looks good to me,
Could you maybe resolve the conflict so that we can merge? Thanks!
* added cloudship model * detail edit * added cloudship model from v1.10.1 - aerodynamics - bouyancy - gazebo freezes upon entering * working cloudship in gazebo - direct use of -gen.sdf from sdf.jinja * Update airship hull profile * Update airship dynamics, add reversable thrust to motor_model, and update airship model with the addition of wind * Add parameter descriptions, fix Gazebo7 implementation and update aerodynamic forces * reset pwm input offset * Update reversible motor model * Revert accidental submodule OpticalFlow updates * Update GPS sensor * Update airship model Co-authored-by: Anton Erasmus <[email protected]> Co-authored-by: antonerasm <[email protected]>
This adds the dynamics to simulate a lighter-than-air vehicle such as blimps/airships. The modelling is based on [1] and [2]. Previously we added an airship-dynamics-plugin to Gazebo-Classic for [PX4 Gazebo SITL](PX4/PX4-SITL_gazebo-classic#490) , but we suffered simulation instability similar to that of the underwater-vehicles since Gazebo-Classic could not simulate the Added Mass dynamics. This PR brings that airship-dynamics-plugin to Gazebo which supports the Added Mass dynamics. Furthermore, I have extended, the Link class to provide access to the AddedMassMatrix, to allow the lighter-than-air system to easily access this matrix. The code is somewhat based of the Hydrodynamics system. I have an STL file which I can contribute, which is an envelope from [Wind Reiter](https://www.windreiter.com/shop/sb-324-300/), and the coefficients in the integrations test is for this envelope model. ### Citations [1] Li, Y., & Nahon, M. (2007). Modeling and simulation of airship dynamics. Journal of Guidance, Control, and Dynamics, 30(6), 1691–1700. [2] Li, Y., Nahon, M., & Sharf, I. (2011). Airship dynamics modeling: A literature review. Progress in Aerospace Sciences, 47(3), 217–239. Signed-off-by: henrykotze <[email protected]>
As mentioned in PX4/PX4-Autopilot#14792 and https://discuss.px4.io/t/new-vehicle-type-airship/16514, our team has developed a new vehicle type for the PX4 developer community, and we would like to submit a pull request for review.