# Planning path problems

**URL:** <https://discuss.bluerobotics.com/t/planning-path-problems/13184>\
**Category:** General Discussion\
**Tags:** ardusub\
**Created:** [November 10, 2022, 3:38am UTC](https://discuss.bluerobotics.com/t/planning-path-problems/13184 "2022-11-10T03:38:29Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![suitangxiaoyi](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@suitangxiaoyi](https://discuss.bluerobotics.com/u/suitangxiaoyi)\
**Post date:** [November 10, 2022, 3:38am UTC](https://discuss.bluerobotics.com/t/planning-path-problems/13184/1 "2022-11-10T03:38:29Z")

</div>

How can I specify a path in the code, say a circle with a diameter of two meters, so that the ROV can follow the specified path? Does anyone know where this part of the code is in that file, or how I should go about writing this code?

---

<div class="post-metadata">

**Author:** ![EliotBR](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/eliotbr/32/6937_2.png) [@EliotBR](https://discuss.bluerobotics.com/u/EliotBR)\
**Post date:** [November 10, 2022, 4:17am UTC](https://discuss.bluerobotics.com/t/planning-path-problems/13184/2 "2022-11-10T04:17:24Z")

</div>

Hi @suitangxiaoyi,

> [@suitangxiaoyi](#):
>
> How can I specify a path in the code, say a circle with a diameter of two meters, so that the ROV can follow the specified path?

Which code are you talking about?

ArduSub is the firmware that runs on the autopilot, and it receives control instructions from an external controller - ArduSub should not need to be modified in order to control the vehicle.

If you have a positioning sensor you should be able to set up missions using [QGroundControl’s Plan View](https://docs.qgroundcontrol.com/master/en/PlanView/PlanView.html).

Controlling the path with your own external program should also be possible, but the possibilities depend on what you have available. [This post](https://discuss.bluerobotics.com/t/i-want-the-rov-to-rotate-uniformly-around-a-central-point/12127) (and the posts it links to) may be of interest 🙂

---

<div class="post-metadata">

**Author:** ![suitangxiaoyi](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@suitangxiaoyi](https://discuss.bluerobotics.com/u/suitangxiaoyi)\
**Post date:** [November 10, 2022, 4:38am UTC](https://discuss.bluerobotics.com/t/planning-path-problems/13184/3 "2022-11-10T04:38:59Z")

</div>

The action I want to accomplish is similar to an ROV following a predetermined trajectory after powering on, such as a circle, and does not require the involvement of a QGC.

---

<div class="post-metadata">

**Author:** ![Charles](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/charles/32/7214_2.png) [@Charles](https://discuss.bluerobotics.com/u/Charles)\
**Post date:** [November 10, 2022, 1:53pm UTC](https://discuss.bluerobotics.com/t/planning-path-problems/13184/4 "2022-11-10T13:53:13Z")

</div>

I understood that mission planning and route following with waypoint or circle or any shape was not supported with the QGC / ardusub firmware. This reply make me doubt:

> [@EliotBR](#):
>
> If you have a positioning sensor you should be able to set up missions using [QGroundControl’s Plan View](https://docs.qgroundcontrol.com/master/en/PlanView/PlanView.html).

Should I understand that if I have a GPS on my ardusub ROV, I should be able to do waypoint following in QGC without using arduboat, ardurov or else?

thanks

---

<div class="post-metadata">

**Author:** ![EliotBR](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/eliotbr/32/6937_2.png) [@EliotBR](https://discuss.bluerobotics.com/u/EliotBR)\
**Post date:** [November 11, 2022, 4:04am UTC](https://discuss.bluerobotics.com/t/planning-path-problems/13184/5 "2022-11-11T04:04:26Z")

</div>

> [@suitangxiaoyi](#):
>
> The action I want to accomplish is similar to an ROV following a predetermined trajectory after powering on, such as a circle, and does not require the involvement of a QGC.

A circle relative to what? Following a path in physical space requires live positioning estimates, or at minimum some form of positional error estimation.

1. If your path is defined by known GPS coordinates then it should be specifiable before launch as a mission.
2. If your path is defined relative to the launch location then
  - if you have a positioning system you should be able to programatically define a circle to follow when the vehicle starts, using either
    - [pymavlink](https://www.ardusub.com/developers/pymavlink.html) (or similar) running on the onboard computer (to send [MAVLink mission commands](https://ardupilot.org/dev/docs/mavlink-commands.html#autonomous-mission-commands), or an orbit command), or
    - a [lua script](https://ardupilot.org/dev/docs/common-lua-scripts.html) running on the autopilot

  - if you have no positioning system, and are wanting to move relative to a known object in view of the camera then see the post I linked to in my previous comment

Note that ArduSub’s positional control features are developmental, and many related features may currently be poorly documented (if at all), and the features that are implemented may be buggy. If you’re interested in something in particular I can try to find or ask about more detailed information on it, but much of the existing knowledge is in the general ArduPilot side, so for non sub-specific things it may be best to ask in the [ArduPilot developer communication channels](https://ardupilot.org/dev/index.html#getting-involved).

It may be worth looking at the [ArduCopter Missions documentation](https://ardupilot.org/copter/docs/common-mission-planning.html). Not all of the information will be applicable, but it should hopefully at least provide an overview of the general missions structure and what kind of functionality may be available (in which case you can search for and/or ask about it in the context of ArduSub).

> [@Charles](#):
>
> Should I understand that if I have a GPS on my ardusub ROV, I should be able to do waypoint following in QGC without using arduboat, ardurov or else?

As I understand it,

1. All ArduPilot firmwares have access to the [mission library](https://github.com/ArduPilot/ardupilot/blob/master/libraries/AP_Mission/AP_Mission.cpp)
2. ArduSub has some positional control modes (see [`control_*.cpp`](https://github.com/ArduPilot/ardupilot/tree/master/ArduSub)) and [commands](https://github.com/ArduPilot/ardupilot/blob/master/ArduSub/commands_logic.cpp) implemented (including things like mission following and the circle control mode), but they haven’t been extensively validated on our end so we present them as developmental rather than stable and fully supported.

So basically, yes, you _should_ be able to do waypoint following in QGC, but there may be unexpected issues or buggy behaviour that occur when trying to do so (in which case please report them and we can try to work together to fix them - as with any other issues).

---

<div class="post-metadata">

**Author:** ![suitangxiaoyi](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@suitangxiaoyi](https://discuss.bluerobotics.com/u/suitangxiaoyi)\
**Post date:** [November 12, 2022, 3:20am UTC](https://discuss.bluerobotics.com/t/planning-path-problems/13184/6 "2022-11-12T03:20:28Z")

</div>

In the [ROV manual](https://www.ardusub.com/quick-start/first-dive.html), there are several modes, and in the official manual there are a dozen or so.But it doesn’t say how to switch, if I am interested in circular mode, how do I access it?

---

<div class="post-metadata">

**Author:** ![EliotBR](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/eliotbr/32/6937_2.png) [@EliotBR](https://discuss.bluerobotics.com/u/EliotBR)\
**Post date:** [November 15, 2022, 8:00am UTC](https://discuss.bluerobotics.com/t/planning-path-problems/13184/7 "2022-11-15T08:00:50Z")

</div>

I spoke with our lead ArduSub developer today to get a better understanding of this.

Circle mode can be switched into like a standard flight mode (via a set mode MAVLink message, from QGroundControl or [code using a library like Pymavlink](https://www.ardusub.com/developers/pymavlink.html#change-flight-mode)), assuming you have an active position estimate. When switching into circle mode, the [`CIRCLE_*`](https://ardupilot.org/copter/docs/parameters.html#circle-parameters) parameters determine the radius and vehicle behaviour while circling. That’s a link to the ArduCopter parameters, because at the moment the CIRCLE parameters aren’t included in the ArduSub documentation, but the parameters are available and work the same way.

Be aware that the latest beta release of ArduSub has a bug that means the vehicle may not correctly face the center of the circle (or the direction of travel, if that’s configured), and instead may continue facing close to the direction it started the circle in. That bug is not present in the latest stable or development releases.

---

<div class="post-metadata">

**Author:** ![suitangxiaoyi](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@suitangxiaoyi](https://discuss.bluerobotics.com/u/suitangxiaoyi)\
**Post date:** [November 30, 2022, 9:14am UTC](https://discuss.bluerobotics.com/t/planning-path-problems/13184/8 "2022-11-30T09:14:51Z")

</div>

I tried to use model\_circle on the ROV, and after I configured the parameters and the handle, I still couldn’t start the circle mode properly

 ![shoubing](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/2X/b/b12596017e37bad5801f6ebc538b15c62b3d087e.png)  
 ![ver](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/2X/4/4515229e74a2811d2152b06a5794623ca4194c05.png)

---

<div class="post-metadata">

**Author:** ![williangalvani](https://avatars.discourse-cdn.com/v4/letter/w/6f9a4e/32.png) [@williangalvani](https://discuss.bluerobotics.com/u/williangalvani)\
**Post date:** [November 30, 2022, 12:17pm UTC](https://discuss.bluerobotics.com/t/planning-path-problems/13184/9 "2022-11-30T12:17:54Z")

</div>

Hi, CIRLE is a “position-enabled” mode, do you have a gps or similar attached to your ROV?  
Are you able to enter Position Hold mode?

---

<div class="post-metadata">

**Author:** ![suitangxiaoyi](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@suitangxiaoyi](https://discuss.bluerobotics.com/u/suitangxiaoyi)\
**Post date:** [November 30, 2022, 3:02pm UTC](https://discuss.bluerobotics.com/t/planning-path-problems/13184/10 "2022-11-30T15:02:19Z")

</div>

I tried to do that, but QGC reported an error after I configured the pose hold model for the gamepad button, the error is :  
PreARM: Must assign a disarm or arm\_toggle button.  
 ![error](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/2X/6/64b37d9608d4855e8cee9d5287a17931515d41b6.png)

befor that, the ROV works well.  
I don’t know if this has something to do with the circle mode not working.

---

<div class="post-metadata">

**Author:** ![williangalvani](https://avatars.discourse-cdn.com/v4/letter/w/6f9a4e/32.png) [@williangalvani](https://discuss.bluerobotics.com/u/williangalvani)\
**Post date:** [November 30, 2022, 3:05pm UTC](https://discuss.bluerobotics.com/t/planning-path-problems/13184/11 "2022-11-30T15:05:56Z")

</div>

That means you don’t have a button for arming or a button for disarming the ROV set up in the joystick. You probably reassigned one of them for the POSHOLD mode.

---

<div class="post-metadata">

**Author:** ![suitangxiaoyi](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@suitangxiaoyi](https://discuss.bluerobotics.com/u/suitangxiaoyi)\
**Post date:** [November 30, 2022, 3:21pm UTC](https://discuss.bluerobotics.com/t/planning-path-problems/13184/12 "2022-11-30T15:21:54Z")

</div>

![button](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/2X/7/78b381621d401a083c6d9a165c1aa08187daed1d.png)  
I really reassigned one of them for the POSHOLD mode.  
Thanks, I will test the POSHOLD mode. 😀

---

<div class="post-metadata">

**Author:** ![suitangxiaoyi](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@suitangxiaoyi](https://discuss.bluerobotics.com/u/suitangxiaoyi)\
**Post date:** [December 1, 2022, 2:39am UTC](https://discuss.bluerobotics.com/t/planning-path-problems/13184/13 "2022-12-01T02:39:35Z")

</div>

Here is my joystick setup

 ![button](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/2X/8/80443ce9179320530179159d19fb38af3dfc77c4.png)  
When I press the button 0, the ROV didn’t respond, so, is that means I can’t enter the Position Hold mode?

---

<div class="post-metadata">

**Author:** ![williangalvani](https://avatars.discourse-cdn.com/v4/letter/w/6f9a4e/32.png) [@williangalvani](https://discuss.bluerobotics.com/u/williangalvani)\
**Post date:** [December 1, 2022, 6:31pm UTC](https://discuss.bluerobotics.com/t/planning-path-problems/13184/14 "2022-12-01T18:31:19Z")

</div>

Do you have a positioning sensor? Eitehr GPS, DVL, or UGPS?  
One of these is required for entering position-enabled modes.
