Set_desired_turn_rate_and_speed requires Guided Mode?

this example script ardupilot/libraries/AP_Scripting/examples/rover-set-turn-rate.lua at master · ArduPilot/ardupilot · GitHub sets the mode to guided before using the set_desired_turn_rate_and_speed binding.

I am writing a LUA script that is invoked via NAV_SCRIPT_TIME to do a custom maneuver for my rover.

Right now it seems that our calls to vehicle:set_desired_turn_rate_and_speed aren’t quite working correctly. So my question is, do I need to put the vehicle into GUIDED mode in order for that call to work?

Thank you,

Have a look at Plane’s scripted aerobatics:

If that doesn’t help enough to get you going, ping me this weekend.

Hi @Christopher_Milner,

Yes, the vehicle needs to be in Guided mode or Guided-within-Auto in order to accept the set-desired-turn-rate-and-speed binding.

Guided-within-Auto is done using the GUIDED_ENABLE command which I see is missing from the Rover mission list so I’ve created a wiki PR to add it.

@rmackay9, I don’t think that’s quite true. I just tested the attached script with the mission depicted below, and it works fine without explicitly commanding GUIDED mode as you suggest. As I understand, NAV_SCRIPT_TIME was designed to accept targets just as GUIDED mode would.

script_time.lua (923 Bytes)

@Christopher_Milner your issue may have been failing to send target rate/speed updates at a high enough rate. The vehicle needs to see updated (or repeated) targets fairly often, or it will appear to be unresponsive.

2 Likes

Hi @Yuri_Rage,

Yes, you’re right of course, thanks very much for the correction!

1 Like