Boat - Loiter vs Hold modes

Our setup:
BlueOS V1.4.0-beta.17
ArduRover V4.5.7
FlightController Navigator
Frame Boat

LOITER vs HOLD mode.
My question is, are these two modes the same? If I attempt to put our boat into LOITER mode using ground control, I get this behavior:

  • set to loiter mode
  • physically move position of boat
  • motors kick off (my guess to attempt to go back to original position)

If I try to do the same but instead use HOLD mode, I do not get the same behavior. I do not see the motors get triggered even when I move the boat to a different location.

What would be the difference, am I missing something in the steps?

Thanks for the help.

Hi @rtcsl -
The behavior you see is expected!
Loiter mode keeps the boat at a (parameter adjustable) distance from the location it is at when the mode is triggered.

Hold mode is a holdover from ArduRover, when used with wheeled rovers. It just disables the motors, because on a car, that’s how you “hold”! It’s not really useful in the context of the BlueBoat.

Thanks Tony.

A follow up questions is how do I trigger LOITER mode programmatically? We are planning on using a companion computer to control our boat. Is there a way to set the boat to LOITER mode by using either mavlink2rest or the MavSDK classes?

I don’t think I saw an example of how to trigger LOITER mode in the MavSDK C++ examples.

Thank you!

Hi @rtcsl -
BlueOS was designed from the ground up to not require an additional computer for programatic control! I’d highly suggest you explore controlling the vehicle in your application from code running within BlueOS!

Setting ArduRover to loiter mode should be easy - with pymavlink, or a lua script, or the MacSDK you referenced (search loiter on this page)

Thank you Tony.

To make sure I understand your comments. Running from within BlueOS means using pymavlink or Lua Scripts? Or is there some C/C++ API we can use?

As for the MavSDK, the only reference I see to loiter is this:


… basically the hold Action command. I think this is where some of my confusion came from. I am guessing HOLD mode is basically no-op’ed in our setup?(if I understood your earlier comments correctly) Or should this question go to a MavSDK forum?

Thanks again!

Hi @rtcsl -
Apologies- by “within BlueOS” I meant on the existing onboard Raspberry Pi 4 hardware, rather than doubling (or more) the “hotel load” power consumption of the system. By packaging your code as an extension, you’ll be able to deploy it to other vehicles with just a few clicks!
The base CPU load, especially on the BlueBoat / ArduRover, is very low, and by using Docker containers the resources can be shared intelligently between your process and the vehicle system.

That screenshot didn’t come thru, but yes, that method can be used to set vehicle modes, such as Acro (holds compass heading against external forces), manual (direct joystick to vehicle control) and Auto mode (follows waypoint mission). You can set a BlueBoat to HOLD mode - this is a choice for failsafe mode actions (under vehicle setup) as it is effectively disarming the motors, which is better than having them carry on with the last sent command in some (most?) circumstances.

I see what you meant now (as far as the inside BlueOS), thank you for the clarification.

As for the MavSDK questions. We are using C++ for our application hence the inclination to try to use MavSDK.

What I am still confused about is based on what I saw with GroundControl, when I set it to HOLD vs LOITER mode.

In the MavSDK documentation, (specifically mavsdk::Action using function hold), it seems to imply hold will “loiter”, but my question is, wouldn’t the hold function behave like the HOLD mode that I saw in Ground Control?

This is the reason I am looking specifically for some MavSDK function/class that would trigger LOITER mode, as the implication is that LOITER would attempt to keep its current position vs HOLD mode is just shutting off the motors (in our configuration as a boat).

Btw, I am starting to look at pyMavLink idea, as well, but did not want to “drop” the MavSDK thought process just yet.

Thanks again!

Hi @rtcsl -
Once again, apologies. I believe it should be as simple as replacing HOLD with LOITER to trigger the mode in your C++ code, in the example provided by that documentation. Hold is behaving as expected - it disables the motors. Loiter will work to maintain position!

That documentation mentions it is relevant to the PX4 autopilot stack specifically, which is not the same as the ArduPilot stack - both speak MavLink though! This is likely the cause for confusion with hold being equated to loiter in that documentation

Send command to hold position (a.k.a. “Loiter”).