PX4-Autopilot icon indicating copy to clipboard operation
PX4-Autopilot copied to clipboard

BlueROV2: updated control (attitude and position), model

Open Pedro-Roque opened this issue 6 months ago • 1 comments

Solved Problem

Adds support for BlueROV2 Heavy and cleans the control stack for UUVs.

Solution

  • Refactor UUV_ modules
  • Refactor BlueROV2 model

Changelog Entry

For release notes:

Feature: bluerov2 support

Alternatives

None I can think of?

Test coverage

SITL testing. Will provide logs once I clean this.

https://github.com/user-attachments/assets/ded12d71-22e1-4af4-a4e1-a2f69aab93a7

Pedro-Roque avatar Jun 16 '25 12:06 Pedro-Roque

@Pedro-Roque I'm not sure what users need to know about this, but if there is anything it would probably go here https://docs.px4.io/main/en/frames_sub/bluerov2.html

hamishwillee avatar Jun 18 '25 03:06 hamishwillee

@Pedro-Roque I'm not sure what users need to know about this, but if there is anything it would probably go here https://docs.px4.io/main/en/frames_sub/bluerov2.html

I think it's mostly correct there,

Pedro-Roque avatar Jun 18 '25 09:06 Pedro-Roque

Two Points:

  • The current implementation has no way of controlling roll/pitch in stabilization mode, with the controller. It is set to 0, when in stabilization mode. Which is, when using the BlueROV2, not always desired. Maybe we can add a system, so that xy and ab(on a classical Logitech controller) can control roll/pitch in some way, so that a constant Roll/pitch is set. Are there reasons not to do that?(can be added later)

  • The Buoyancy system currently counterweights each link. This behavior is very often not the case on an underwater vehicle. There is mostly some kind of payload on the robot. Therefore, when adding a small weight under the base_link to simulate that, the behavior of the BlueROV doesn't change. I coded a small change to the two files, which would apply the force only on the first link. Then everyone can use a weight link, to have the behavior the way they want. Additionally, I would disable the buoyancy force, when the main link is at z>0. This can be a parameter that is set. I can add that later.

But in my opinion, we could also just use the standard buoyancy plugin, and make a circular collision based on the weight of the BlueROV2, around the basic_link, and once compute the radius for that sphere. This would be the same behavior as using this plugin, except for the random factor. I don't fully see the benefit, and for me the gazebo plugin worked.

timzarhansen avatar Jun 18 '25 11:06 timzarhansen

Two Points:

  • The current implementation has no way of controlling roll/pitch in stabilization mode, with the controller. It is set to 0, when in stabilization mode. Which is, when using the BlueROV2, not always desired. Maybe we can add a system, so that xy and ab(on a classical Logitech controller) can control roll/pitch in some way, so that a constant Roll/pitch is set. Are there reasons not to do that?(can be added later)
  • The Buoyancy system currently counterweights each link. This behavior is very often not the case on an underwater vehicle. There is mostly some kind of payload on the robot. Therefore, when adding a small weight under the base_link to simulate that, the behavior of the BlueROV doesn't change. I coded a small change to the two files, which would apply the force only on the first link. Then everyone can use a weight link, to have the behavior the way they want. Additionally, I would disable the buoyancy force, when the main link is at z>0. This can be a parameter that is set. I can add that later.

But in my opinion, we could also just use the standard buoyancy plugin, and make a circular collision based on the weight of the BlueROV2, around the basic_link, and once compute the radius for that sphere. This would be the same behavior as using this plugin, except for the random factor. I don't fully see the benefit, and for me the gazebo plugin worked.

Hi @timzarhansen ! Thanks for the inputs! Here go my comments:

  1. In stabilized mode, we can control the target roll and pitch with the right joystick, yaw and thrust in X direction with the left one. Did you mean in position mode? If yes, I think we could try to use the D-pad for that, what do you think?
  2. I agree. I think enutral buoyancy like this is difficult to completely achieve in underwater, but in the other hand, that is what the neutral-buoyancy state should be (after careful calibration). I'm happy to have it using the buoyancy system from gazebo once we have parameters that somewhat match the vehicle (and this should be a simple fix on the model.sdf in PX4-gazebo-models ).

Let me know what you think of option 1.

Pedro-Roque avatar Jun 18 '25 12:06 Pedro-Roque

Two Points:

  • The current implementation has no way of controlling roll/pitch in stabilization mode, with the controller. It is set to 0, when in stabilization mode. Which is, when using the BlueROV2, not always desired. Maybe we can add a system, so that xy and ab(on a classical Logitech controller) can control roll/pitch in some way, so that a constant Roll/pitch is set. Are there reasons not to do that?(can be added later)
  • The Buoyancy system currently counterweights each link. This behavior is very often not the case on an underwater vehicle. There is mostly some kind of payload on the robot. Therefore, when adding a small weight under the base_link to simulate that, the behavior of the BlueROV doesn't change. I coded a small change to the two files, which would apply the force only on the first link. Then everyone can use a weight link, to have the behavior the way they want. Additionally, I would disable the buoyancy force, when the main link is at z>0. This can be a parameter that is set. I can add that later.

But in my opinion, we could also just use the standard buoyancy plugin, and make a circular collision based on the weight of the BlueROV2, around the basic_link, and once compute the radius for that sphere. This would be the same behavior as using this plugin, except for the random factor. I don't fully see the benefit, and for me the gazebo plugin worked.

Hi @timzarhansen ! Thanks for the inputs! Here go my comments:

  1. In stabilized mode, we can control the target roll and pitch with the right joystick, yaw and thrust in X direction with the left one. Did you mean in position mode? If yes, I think we could try to use the D-pad for that, what do you think?
  2. I agree. I think enutral buoyancy like this is difficult to completely achieve in underwater, but in the other hand, that is what the neutral-buoyancy state should be (after careful calibration). I'm happy to have it using the buoyancy system from gazebo once we have parameters that somewhat match the vehicle (and this should be a simple fix on the model.sdf in PX4-gazebo-models ).

Let me know what you think of option 1.

  1. Yea that's an option. Should be easy.
  2. lets keep it like that, if others agree. Can be changed later again, if it's not necessary anymore.

timzarhansen avatar Jun 18 '25 13:06 timzarhansen

Some hardware testing:

https://github.com/user-attachments/assets/f5535c41-af73-4046-b419-02f3b5da21a9

Pedro-Roque avatar Jun 25 '25 15:06 Pedro-Roque

This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there:

https://discuss.px4.io/t/px4-dev-call-june-25-2025-team-sync-and-community-q-a/46161/3

DronecodeBot avatar Jun 25 '25 15:06 DronecodeBot

This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there:

https://discuss.px4.io/t/px4-dev-call-june-25-2025-team-sync-and-community-q-a/46161/1

DronecodeBot avatar Jun 25 '25 15:06 DronecodeBot

https://github.com/user-attachments/assets/362423d9-d22e-41f2-8437-a61f8d977075

Some additional testing on BlueROV. We needed to change a few parameters gains in the controller to make it work smoothly, since our Robot is heavier and the center of mass is lower due to the extension on the bottom. Manual and stabilization are working properly, position I couldn't test yet. Will do that soon.

timzarhansen avatar Jun 30 '25 20:06 timzarhansen

This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there:

https://discuss.px4.io/t/px4-dev-call-july-2-2025-team-sync-and-community-q-a/46266/3

DronecodeBot avatar Jul 02 '25 14:07 DronecodeBot

This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there:

https://discuss.px4.io/t/px4-dev-call-july-16-2025-team-sync-and-community-q-a/46513/3

DronecodeBot avatar Jul 16 '25 14:07 DronecodeBot