-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
add support for unmanned underwater vehicles: #14079
Conversation
* airframe uuv_generic + uuv_hippocammpus including mav_type = 12 for submarines * mixer for UUVs with X-shaped thruster setup similar to quadcopter * add module uuv_att_control for underwater robot attitude control * add rc.uuv_defaults/apps for autostarting e.g. ekf2 and uuv_att_control app
.gitmodules
Outdated
@@ -12,8 +12,8 @@ | |||
branch = master | |||
[submodule "Tools/sitl_gazebo"] | |||
path = Tools/sitl_gazebo | |||
url = https://github.com/PX4/sitl_gazebo.git | |||
branch = master | |||
url = https://github.com/DanielDuecker/sitl_gazebo.git |
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 you open a corresponding PX4/sitl_gazebo PR and change this url back?
https://github.com/PX4/sitl_gazebo
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.
For sure, I will update the url
Here is the PR in sitl_gazebo PX4/PX4-SITL_gazebo-classic#402
@DanielDuecker Do you have any logs / videos that show that this is working? Also, please link the corresponding sitl_gazebo PR on this PR |
|
||
uORB::Subscription _parameter_update_sub{ORB_ID(parameter_update)}; | ||
|
||
int _vehicle_attitude_sp_sub{-1}; /**< vehicle attitude setpoint */ |
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 fine to merge if it's working for you, but you might want to update to the newer uORB c++ api at some point.
Example https://github.com/PX4/Firmware/blob/cfa74b91063251b6d88ac7f65bbe1044ff67ffe6/src/modules/mc_rate_control/MulticopterRateControl.hpp#L96-L104
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! I think for the moment that's fine but I will update this in an upcoming revision
@@ -64,7 +64,8 @@ set(models none shell | |||
if750a iris iris_opt_flow iris_opt_flow_mockup iris_vision iris_rplidar iris_irlock iris_obs_avoid iris_rtps solo typhoon_h480 | |||
plane | |||
standard_vtol tailsitter tiltrotor | |||
hippocampus rover) | |||
hippocampus rover | |||
uuv_hippocampus) |
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.
What is the difference between the hippocampus and the uuv_hippocampus?
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.
hippocampus is the old implementation (which is still based on the MC-airframe) which is still used in the tutorial with an example app.
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.
@hamishwillee Would it make sense to deprecate the previous tutorial and switch to the new one? I believe the previous module was not really well maintianed
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 would completely delete the old support. The fact that you've "done this right" in this version is awesome, and what we want people to learn from.
Daniel, as far as I know the only docs for this is the launch command in http://dev.px4.io/master/en/simulation/gazebo.html#uuv
- Can you update that with the new launch command?
It would be great to have some documentation to help others extend this work. Our docs currently make it pretty easy to set up an MC, VTOL and FW. However it is hard to set up a rover, boat or helicopter because there isn't much supporting material. I'd hate for that to be the case for this.
Generally we need "whatever you think would make it possible for someone to learn from and extend your work". Some ideas:
- Dev: Explain the mixer and how it might be extended: http://dev.px4.io/master/en/concept/mixing.html
- Dev: If there is a geometry file, explain how that works.
- Explain the controller. E.g. like these diagrams: http://dev.px4.io/master/en/flight_stack/controller_diagrams.html
- User: Explain any general considerations for assembly: http://docs.px4.io/master/en/assembly/
- User: Explain how to set up a real vehicle http://docs.px4.io/master/en/airframes/
- Explain special configuration: http://docs.px4.io/master/en/config/
Does that make sense?
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.
okay, I will remove the the old uuv-files.
@hamishwillee are you referring to the stil_gazebo part with "geometry file"?
We have quite some docs (so far internal) for assembly etc, I will see which parts would be helpful to others and add the to the docs.
It absolutely makes sense to pave to way to others who are interested in extending the framework with their own ideas.
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.
Hi Daniel,
Re geometry file I am referring to an undocumented part of the definition of PX4. Unfortunately I can't say anything else because I haven't ever been able to get any useful information on it. I was being opportunistic - and hoping you might :-)
We have quite some docs (so far internal) for assembly etc, I will see which parts would be helpful to others and add the to the docs.
Thank you. That will be excellent!
* updated copyright year in cmakelist 2017->2020
According to: PX4/PX4-Autopilot#14079 make px4_sitl gazebo_hippocampus should be changed to make px4_sitl gazebo_uuv_hippocampus
@Jaeyoung-Lim |
…k thrust commands * removed old hippocampus version from sitl_target.cmake + old uuv_quad_x mixer * commenting in uuv mixers
# | ||
# Start UUV Land Detector. | ||
# | ||
land_detector start rover |
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.
Sounds like we need another vehicle 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.
agree!
afaik rover landdetector is basically just a dummy, right?
what do you recommend?
|
||
if [ $AUTOCNF = yes ] | ||
then | ||
param set PWM_MAX 1950 |
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 don't think these PWM params make sense as UUV defaults.
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.
Well, I agree with you on min/max - but doesn't it make sense to have the disarmed pwm at 1500? Better ways of doing this are welcomed =)
According to: PX4/PX4-Autopilot#14079 make px4_sitl gazebo_hippocampus should be changed to make px4_sitl gazebo_uuv_hippocampus
Hi, |
Hi Hanyang, |
Hi Daniel, Since I'm quite new to the PX4 and Gazebo, I have tried some basic examples provided in the PX4 mavros folder and also the old uuv_example_app(didn't see the circle trajectory stated in the example). I have tried the mavros_offboard_attctl_test.py and mavros_offboard_posctl_test.py to send attitude and position control topics to the uuv_att_control. I noticed that the uuv_att_control module was turned on once the hippocampus uuv was made. However, I only found attitude change from the log review but no position change in the mavros_offboard_attctl_test.py(apart from the returning home process) and no reaction in the mavros_offboard_posctl_test.py. I have some confusions on this problem:
Thanks a lot! |
Hi Hanyang, Maybe we should finally remove the old(2017) uuv_example_app. Unfortunately, it is not well maintained and outdated. The idea of the new uuv_att_control app is to fully replace the old approach which was (too) tightly coupled with the MC airframes, which doesn't make sense anymore. For the moment, there is no position control module for UUVs. On our side, we use the system almost exclusively in OFFBOARD mode for attitude control with the setpoints coming via mavros. The position control etc is done in ROS and computes the required attitude setpoints. For the youtube video we used a simple ROS path tracking controller which generated the corresponding attitude setpoints. What exactly do you mean with "is doesn't work in offboard like the fw-module"? Maybe we should move this discussion to a new thread on discuss.px4.io? Cheers |
Hi Daniel, Thanks for your quick response. I have started a new thread on discuss.px4.io. I think we could go there for further discussion since I'm still quite confused at some points. For "it doesn't work in offboard like the fw-module", I just meant that before your explanation I thought the uuv can't work in the OFFBOARD mode just like the fixed wing models, because I saw it on the PX4 website that some functions in the OFFBOARD mode can't be applied to the fixed wing models. But your explanation has dispelled my guess. Cheers |
Hi, |
@hanyang2013212 Could you make a pull request so that we can also have it fixed in upstream? |
Describe problem solved by this pull request
As by now PX4 lacks (convenient/full) support for underwater robots. The currently integrated HippoCampus Underwater Robot implementation originated from a student project in my group. Its main drawback is that it is still based on the MC airframe which comes with high integration effort and several workarounds. Moreover, it lacks a proper attitude controller which makes it easy to use for other.
Please find the corresponding PR in the sitl_gazebo repo PX4/PX4-SITL_gazebo-classic#402
Describe your solution
This PR provides
Airframes/Mixer for unmanned underwater vehicle (UUV) using the correct MAV_Type (=12) etc.... Namely, a generic and a HippoCampus specific airframe. Moreover, I added rc.uuv_defaults/apps for uuv specific parameter and autostarting e.g. ekf2 and uuv_att_control app
mixer for UUVs with X-shaped thruster setup similar to quadcopter
control module "uuv_att_control" for underwater robot attitude control
sitl_gazebo integration (please find the PR in the sitl_gazebo repo)
...leaves the current uuv controller as an tutorial example
Describe possible alternatives
Update the current hippocampus/uuv implementation. However, as the existing version is a very hard to use (drive in a circle) and still based on MC, I am wondering whether it would be worth the effort in comparison of taking the proposed fresh approach.
Test data / coverage
So far testing took place in Gazebo for simple attitude control tasks / and manual control. Moreover, we tested the on our physical UUV HippoCampus robot (PixRacer+ Companion/RPi) in offboard mode.
https://youtu.be/2w-hT2NBIyE ( UUV Attitude Controller receiving attitude setpoints via mavros)