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

Implement a boat position controller for a bi-motor catamaran #22915

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

r0n4n
Copy link

@r0n4n r0n4n commented Mar 21, 2024

Solved Problem

There is no position controller for boat

Solution

Create a new boat configuration and implement a position controller.
The controller is mostly implemented for a bi-motor catamaran but is designed to handle several boat configurations.
This configuration has two bi-directionnal motors located under the floats of the catamaran.
The direction of the boat is controlled using the differential speed of motors.
This feature is closely linked to the rover differentialdrive guidance

Changelog Entry

For release notes:

Boat position controller for a bi-motor catamaran

Alternatives

Any ideas ?

Test coverage

Context

Bi-motor catamaran prototype
PXL_20231126_114806860 - Copie

@DronecodeBot
Copy link

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/rc-speed-boat-with-px4-episode-1-using-px4-to-control-the-boat/28429/11

@bresch bresch requested a review from PerFrivik April 3, 2024 12:31
@PerFrivik
Copy link
Contributor

Hey @r0n4n awesome job! I'll take a look at it, I am currently also working on a boat module, but the boat type is a bit different. You are using a sort of differential control and our boat is controlled using thrust vectoring. Not sure if we will share a module yet, so we will probably have to adjust the naming a bit from just boat. Maybe boat_vector_thrust & boat_differential 🤔 not sure yet.

@@ -239,6 +239,7 @@ ControlAllocator::update_effectiveness_source()
break;

case EffectivenessSource::ROVER_DIFFERENTIAL:
tmp = new ActuatorEffectivenessRoverDifferential();
Copy link
Member

Choose a reason for hiding this comment

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

I would not bring back the differential rover control allocation but rather have a differential boat CA_AIRFRAME and directly publish to the actuator functions like it's done for differential rovers here:

actuator_motors_s actuator_motors{};
actuator_motors.reversible_flags = _param_r_rev.get(); // should be 3 see rc.rover_differential_defaults
wheel_speeds.copyTo(actuator_motors.control);
actuator_motors.timestamp = now;
_actuator_motors_pub.publish(actuator_motors);

Copy link
Author

Choose a reason for hiding this comment

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

Thank you for your comment @MaEtUgR ! I used the differential rover control allocation because the control allocation is exactly the same for my boat and it's pretty convenient to only deal with thrust and torque.
Why the control allocation is not used for the differential rover ? Is it to ensure an accurate posisitionning ?

I can reuse the differential rover control allocation and create a new CA_AIRFRAME for the differential boat if it's fine for you.

@r0n4n
Copy link
Author

r0n4n commented Apr 5, 2024

Hey @r0n4n awesome job! I'll take a look at it, I am currently also working on a boat module, but the boat type is a bit different. You are using a sort of differential control and our boat is controlled using thrust vectoring. Not sure if we will share a module yet, so we will probably have to adjust the naming a bit from just boat. Maybe boat_vector_thrust & boat_differential 🤔 not sure yet.

Yes actually I was not sure about the naming convention. I was wondering if we could have a common module for boats in general like for multicopters. But as the control looks significantly different between architectures I'm not sure if it's possible.
What do you think ? Should we consider our boats as completely different configurations ?

However, while I was coding the controller for this boat I realized that the positionning strategy was closed to the differential rover :

  • First we look for the direction
  • Once the direction is correct we start moving at desired speed and direction is controlled.

I'm not sure if the requirements are exactly the same for the rover and the boat during the position change. But maybe we can use a common function for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants