Terrain follow in Guided Mode

I am not sure if this is a ArduCopter question or a Mission Planner question.

I am wanting my copter to terrain follow when in Guided Mode.

Does anyone know whether it’s the GCS software or the Flight Controller Firmware / Parameters that would control this?

Kind Regards,

Perry

3 Likes

Hi Perry,

It is the flight controller that has to be set up to enable terrain following.

You need to set TERRAIN_ENABLE and TERRAIN_FOLLOW to “1” to enable terrain following.
This can be done with any GCS.

Furthermore, the terrain data has to be loaded in the SD card of the flight controller, and this is done live with Mission Planner or MAVProxy connected to the drone and internet, although it can be done offline before the flight.

I have a slight doubt about the terrain follow feature in Guided Mode with ArduCopter as I didn’t used it yet, but since this mode is based on an automatic flight mode I would say that terrain follow also works in Guided Mode.

Please refer to the following documentation :
https://ardupilot.org/copter/docs/terrain-following.html

JP

1 Like

JP,

Thanks for your reply.

Yes, I am aware of the terrain follow parameters and we currently use it during out survey missions. But when we use the Guided mode it does not follow terrain - only uses relative height from your takeoff location.

If you know how or if we would be able to enable it that would be great.

Kind Regards,

Perry

Perry,

I just checked in the code and the terrain follow is also featured in guided mode, as seen here.

Did terrain follow worked for you in other modes during the flight where you tried Guided Mode ?

JP

What version of ArduCopter do you use ?

JeanPhilippeHell

I think we are on version 4.1.7. It’s our production drone so we don’t update it unless there is a reason to. (If it ain’t broke, then don’t fix it model). Do you know if the code has changed since this version? The way we enter guided mode is to right click on the Mission Planner map and select Fly To Here. Then the console asks for an altitude, which we provide. The copter does then go into guided mode and fly’s toward the target but it does not follow terrain. And this is just after AUTO mode where it was following terrain.

Kind Regards,

Perry

I have just tried software in the loop (SiTL) with copter and it does the same. It follows terrain fine in Auto mode but when you switch to guided mode and click “Fly to hear” on the map - it asks you for an altitude and then switches to relative. Very strange. I can’t get it working.

Kind Regards,

Perry

1 Like

Hi Perry,

Sorry I didn’t see your message. That’s what I wanted to do but I didn’t had time to test SiTL.

So it seems that by default Guided Mode works with a relative altitude instead of terrain follow.

JeanPhilippeHell,

Any idea how to get it to terrain follow?

Is this a mission planner thing or something else?

It seems as if the code is there, and the documentation says that it works, so what am I missing?

Kind Regards,

Perry

Hi Perry,

I tried a quick SiTL mission but the terrain follow does not work at all for me, neither in auto nor in guided.
I tried with Copter from Master, Copter-4.2.3, Copter-4.0.7 and Plane-4.2.3.
I used Mission Planner and QGroundcontrol.
Terrain is enabled and the blocks are downloaded, so there must be something wrong in my configuration.

Sorry I cannot help you further, hopefully someone more knowledgeable will pass by !

JP

JP,

Thanks for your help. Much appreciated.

Kind Regards,

Perry

Perry,

It is the GCS that has to send the correct command.

From what I learned the terrain follow depends on the altitude reference sent by the GCS.
There are several options for this, but mostly we have :

  • Relative to Home
  • Global (AMSL)
  • Relative to Terrain

On Mission Planner and APMPlanner2 this setting is shown in the list of waypoints.
In QGroundcontrol, I had to tick “show all values” to see the reference frame of a waypoint.

This is for Auto mode.

For Guided Mode in Copter the command used is SET_POSITION_TARGET_GLOBAL_INT
It does accept Global, Relative and Terrain frames, which is explained here.
For Arduplane the command is slightly different but the principle is the same.

So the GCS has to be set up to send the desired reference frame in Guided Mode.

It seems that by default the frame of the Guided command “Go to here” is Relative to Home.

Unfortunately I haven’t found a setting to change that in Mission Planner / APMPlanner / QGC.

JP

JP,

Thanks so much for looking into this for me. I will contact the Mission Planner team and see what I can sort out.

Kind Regards,

Perry

1 Like