Skip to content
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

underwater robot/uuv extension #402

Merged
merged 17 commits into from
Feb 5, 2020
Merged

Conversation

DanielDuecker
Copy link
Contributor

This PR corresponds to PX4/PX4-Autopilot#14079

It extends the underwater robot capabilities and provides an uuv_motor_model allows to model the esc-deadzone which is important for vehicle actuators which can spin in both directions.

The old hippocampus model is kept for the moment as part of the px4-firmware tutorial depends on it. However it likely makes sense to have the tutorial depending on the new model at some point.

Copy link
Member

@Jaeyoung-Lim Jaeyoung-Lim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! I have a few general comments as the following.

  • The name of the plugin is gazebo_uuv_motor_model. However, what the plugin is actually doing is simulating the uuv dynamics. It includes the combined dynamics of 4 motors and the damping dynamics of the body. I think this is confusing, since the gazebo_motor_model for all the rest of the models only include the dynamics for the motor itself. For plane / multirotos there are separate plugins for the motor model and the fuselarge interaction with aerodynamics, and multiple motor elements are added depending on how many actuators there are in the system.

  • This is more out of curiousity, as the thrust is modeled linear to the rotational velocity. Could you point us to any reason / literature that this was modeled this way? I am not an expert of UUVs, but I would expect that in a newtonian fluid (such as water) the thrust will increase quadratically compared to the rotational velocity of the srews. Does the linear model better fit in low thrust scenarios for the hippocampus?

<plugin name="gps_plugin" filename="libgazebo_gps_plugin.so">
<robotNamespace/>
<gpsNoise>true</gpsNoise>
</plugin>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the hippocampus have GPS?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our real world version does not have GPS since GPS does not work/is attenuated almost immediately underwater. Underwater localization is some kind of a night mare which I would prefer for the moment to keep out of the simulation
Hence we implemented "GPS" as a well integrated work around with fairly similar characteristics. However, this can be of course extended at some point but it will be quite a chunk of work to model the real world localization characteristics.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough. I don't think we need to "fix" this, but still be aware the state estimation is using GPS data

* updates on the new uuv_hippocampus model
	- add nicely spinning propeller
	- add red/green coloring to propellers -> port/starboard side

* Merge the new uuv_motor_model into the UUV_plugin, which now

  - computes the hydrodynamic effects (according to FOSSEN 2011 - Handbook of Marine Craft Hydrodynamics and Motion Control)
  - applies the Hydro effects  as forces/moments and are than applied to the vehicle
  - computes the forces/moments based on the motor commands
@DanielDuecker
Copy link
Contributor Author

DanielDuecker commented Feb 4, 2020

Thanks for the contribution! I have a few general comments as the following.

  1. The name of the plugin is gazebo_uuv_motor_model. However, what the plugin is actually doing is simulating the uuv dynamics. It includes the combined dynamics of 4 motors and the damping dynamics of the body. I think this is confusing, since the gazebo_motor_model for all the rest of the models only include the dynamics for the motor itself. For plane / multirotos there are separate plugins for the motor model and the fuselarge interaction with aerodynamics, and multiple motor elements are added depending on how many actuators there are in the system.

  2. This is more out of curiousity, as the thrust is modeled linear to the rotational velocity. Could you point us to any reason / literature that this was modeled this way? I am not an expert of UUVs, but I would expect that in a newtonian fluid (such as water) the thrust will increase quadratically compared to the rotational velocity of the srews. Does the linear model better fit in low thrust scenarios for the hippocampus?

@Jaeyoung-Lim

  1. with the last commit I merged the uuv_motor_model back into the uuv_plugin (I agree this makes much more sense than keeping them separate)

  2. You are right with the thrust modelling. However, it is actually modeled quadratically, see uuv_plugin.cpp , ca line 155:
    forces[i] = motor_force_constant_ * motor_commands_[i] * std::abs(motor_commands_[i]);

@Jaeyoung-Lim
Copy link
Member

@DanielDuecker For 1. and 2, Ah, but if the thrust is quadratic, why do we need an additional plugin to model the dynamics of the thrusters? I understand that the lift / drag would be very different since their is the effect of added mass since the fluid is incompressible.

What are the fundamental differences between the underwater thrusters and rotors in the air? If the differences are not that big, Wouldn't it make sense that we use the existing motor plugin? This would make a much cleaner and scalable solution where you can add arbitrarily many thrusters.

@DanielDuecker
Copy link
Contributor Author

@Jaeyoung-Lim
so far we just use quadcopter motors underwater which works surprisingly well.
A more detailed analysys of the single motor dynamics would be definitely helpful. Unfortunately, I cannot provide detailed parameters on this for the moment.

Therefore, it is currently easier to model the overall vehicle. Moreover, currently the main point of the uuv_plugin is the extension to added mass and added damping of the overall vehicle. Hereby, we made the experience that even the mounting of the motors (outside the vehicle, see photo) does have quite some effect on the added mass/damping - I think it would be great, but quite tough, to have this in a fully modular concept.

photo_new_hippoc-min

@Jaeyoung-Lim
Copy link
Member

@DanielDuecker That's fair. Just wanted to make sure that it is necessary to include the motor models in the plugins

@DanielDuecker
Copy link
Contributor Author

@dagar @Jaeyoung-Lim
what else do you think should be done here before merging?
It would be great to have this merged soon, as the tutorial's command make px4_sitl gazebo_uuv_hippocampus otherwise throws an error due to the missing sitl_gazebo connection

@dagar dagar merged commit 045156d into PX4:master Feb 5, 2020
Copy link
Member

@Jaeyoung-Lim Jaeyoung-Lim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not really happy with the fact that the thrusters are included in the plugin and that you are not able to add more thrusters.

However, since this is specific to the hippocampus and @DanielDuecker is developing it, I think this is good to go on myside.

RyosukeMatsushima pushed a commit to RyosukeMatsushima/PX4-SITL_gazebo that referenced this pull request Jun 21, 2022
 - major renaming from uuv2 -> uuv_hippocampus
 - added uuv_hippocampus model carrying a camera
 - added uuv_hippocampus_cam.world
 - updates on the new uuv_hippocampus model
   - add nicely spinning propeller
   - add red/green coloring to propellers -> port/starboard side
   - computes the hydrodynamic effects (according to FOSSEN 2011 - Handbook of Marine Craft Hydrodynamics and Motion Control)
   - applies the Hydro effects  as forces/moments and are than applied to the vehicle
   - computes the forces/moments based on the motor commands

Co-authored-by: PhilippHastedt <34442705+PhilippHastedt@users.noreply.github.com>
Co-authored-by: Tim <t.hansen@tu-harburg.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants