Backing off from obstacles stopped to work and I don't know why

Hello all,
I am setting up with two rovers (RC cars) and after solving a problem with the steerint tunning, I would like to configure the obstacle avoidance.
I have performed many tests and found that the vehicle back off from obstacles, I mean, if I put myself in front of it, it moved in reverse running away from me.
The thing is, today, it does work anymore and I cannot think of a reason.
I have noticed also that the vehicle does not brake, before, speed got reduced fast, I remember seeing the car stopping with a full brake at the last WP in a mission. Now, it just slow down gradually. Before today, the car almost stopped in every waypoint, now, it is not noticeable.
I can only think in two possibilities:

  1. I had a problem with the car not steering properly (see this post ), and as @rmackay9 suggested, updated the firmware from rover 4.1.3 to rover 4.2.0dev. Now, I have downgraded to 4.1.5 official but backing off from obstacle does not work with that version either.
  2. a change in some parameters affecting this functionality. I have performed a text comparision of the parameters today and several days ago, when I am sure it was working, the parameters from datasflash logs of different dates. the only differences I think could be related are: now the PRX_MIN and PRX_MAX are explicitely stored in the logs with a value of zero; before today, dataflash logs did not have these parameters. However, a zero value should not affect. All other changes are just PID values in the steering and a few non-related more. I cannot change them in MP, they are not listed, anyway. Another parameter I changed was the THR_MIN from 0% to 20% as I noticed that motor start rotating at 30% throttle and forgot to tune this parameter. I don’t believe that a

I have configured obstacle avoidance with PRX_TYPE=4 (rangefinder, a tfmini-plus facing forward) , OA_TYPE = 1 (bendy-ruler)

Another interesting thing: while in guided or auto mode, the car detect the obstacles an avoid them, is just the backing off from them when the rover is still.
Also, as it does not brake properly, it detects obstacles like a wall but does not stop in time (I can see the PIDdesired trying to slow down the car).

UPDATE: just after posting this, I thought it would be a good idea to try to set MOT_THR_MIN back to 0%, doing that, the car brake as before. I understand then that this parameter affect at the PWM values that AP send to the ESC to slow down. But backing off from obstacles does not work with this change, so there must be another reason.

So, I will be very grateful if you could help me with this issue.
My first question would be: is backing off from obstacles something you can disable or enable? how?
Thanks all in advance!

Parameters as of today (do not work): sd0 crash into a wall 00000051.BIN.param (15.4 KB)

A today’s dataflash log: Sign in to your account

Parameters from 11 days ago (it was working): 00000038.BIN.param (15.3 KB)

UPDATE: I solved this problem, I had ATC_ACCEL_MAX=0 , meaning that there is no limit in the acceleration for the throttle controller, and @rmackay9 suggested to set a value (1.5), when I did that, backing off from obstacle started to work again.
I have a related param ATC_DECCEL_MAX = 0 , meaning it takes the same limit than ATC_ACCEL_MAX, so there is a connection between going in reverse to avoid obstacles and those parameters. … but … I am wondering if this is the intended behaviour. After all, those parameters are limits to the MAXIMUM accel/deccel, could it be a bug?
Thanks all,

Thanks for the update. This sounds a bit like in the backup code we missing a check of ATC_ACCEL_MAX==0 and are instead setting the acceleration to zero.

FYI @rishabsingh3003

Re ATC_DECEL_MAX, I don’t think I understand the question but maybe what’s not clear is that ATC_DECEL_MAX controls how quickly the vehicle’s speed returns towards zero regardless of whether the vehicle is going forwards or backwards.

1 Like

@rmackay9 Avoidance has its own accel parameter called “AVOID_ACCEL_MAX”. If that is set to zero, we don’t apply any accel limits. I don’t think the Avoidance code uses the ATC_ACCEL_MAX parameter anywhere…

1 Like