Ardurover overshoot with mavros/setpoint_position/local

Hi There

We successfully setup a rover - skid steering configuration - which is able to map its environment with a SLAM and move with setpoint_position/local mavros messages. However what I noticed is that the rover overshoots the target by 0.40 to 0.80 meters.

Our interpretation is the following:
As soon as the L1 controler reached the target (WP_RADIUS, WP_OVERSHOOT), looks like that the pwm output are set to 1500 for each motor and thus due to inertia, the rover continues to move until it finally stops. May be I am wrong but once the target is reached, the L1 controler is still active and does it try to keep the rover - such as moving backward for instance - on target or not ? If so, what are the most relevant parameters?

Thank you very much for your help/suggestion

Please find attached the parameters
June_8.param (16.0 KB)

This message to update the information regarding my request, looks like it is not due to the inertia of the rover, but the L1 controller which is still sending very low values… Therefore my question is why and how can I prevent it?
Thabk you for considering this message

I think that the behaviour that you are describing results from the stop_vehicle() function which I believe is called at the end of operations in all modes. This function ramps down velocity over time based on various parameters. We have certain operations that require a more precise stop and have bypassed this function in some cases.

@jimovonz Thank you very much for your answer. Do you know if I can bypass this function or if by tuning some parameters I have a chance to have a clear stop - parameters like ATC_ACCEL_MAX or ATC_STOP_SPEED? I would like to avoid to put some physical/mechanical brakes just because of this…

@fabono Tracing the code you can see that stop_vehicle() calls get_throttle_out_stop() which calls get_desired_speed_accel_limited() which uses _throttle_decel_max which is the parameter ATC_DECEL_MAX. This parameter defaults to 0 which means in this case, that it becomes the same as ATC_ACCEL_MAX - which defaults to 2.0m/s. You can try setting this to zero to disable it but the result may be quite harsh. In my case I altered the code to immediately set the motor output to zero when we wanted to stop at a specific location. You could also try a DO_CHANGE SPEED before the location you want to stop at to reduce your speed

@jimovonz thank you very much for your advices, i will do some tests and see what works the best.

@jimovonz Finally I am doing like you and modify the code. What I did is set stopped = true; in the method AR_AttitudeControl::get_throttle_out_stop. Just wanted to know if I am correct or did you do something different?

Thank you for your support

Wish a nice week-end

It looks like that will work but will produce a sudden stop every time the vehicle intends to stop. In our case, we request that the vehicle stops during a mission (in mode (AUTO) by sending MAV_CMD_DO_CHANGE_SPEED with a request of zero m/s. The code that we changed to achieve this is in mode_auto.cpp:

void ModeAuto::update()
{
    switch (_submode) {
        case Auto_WP:
        {
            if (!g2.wp_nav.reached_destination()) {
              if (g2.wp_nav.get_desired_speed() < 0.11) {
                // stop the vehicle imediately (similar to mode HOLD) at ~zero requested velocity
                g2.motors.set_throttle(0.f);
                g2.motors.set_steering(0.f);
              } else {
                // update navigation controller
                navigate_to_waypoint();

@jimovonz thank you very much for your message, your method will lead to a “smother” stop because you wait until the velocity reached a certain value, then you stop. We are working in Guided mode and I saw that there is mode_guided.cpp as well. If our first try is too “brutal” I will follow you! Thanks again for your kindness.