From d6d86cf8a2016f6d511cc03dbbbaec524561cb3d Mon Sep 17 00:00:00 2001 From: Ivan Hazucha Date: Tue, 30 Mar 2021 23:23:08 +0100 Subject: [PATCH] Fixed maxW selection in createDynamicWindow by changing max() to min() - possible angular velocities were tilted towards positive values --- src/dwa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dwa.c b/src/dwa.c index b65ec79..54d1fd0 100644 --- a/src/dwa.c +++ b/src/dwa.c @@ -9,7 +9,7 @@ createDynamicWindow(Velocity velocity, Config config, DynamicWindow **dynamicWin float minW = max(-config.maxYawrate, velocity.angularVelocity - config.maxdYawrate * config.dt); float maxW = - max(config.maxYawrate, velocity.angularVelocity + config.maxdYawrate * config.dt); + min(config.maxYawrate, velocity.angularVelocity + config.maxdYawrate * config.dt); int nPossibleV = (maxV - minV) / config.velocityResolution; int nPossibleW = (maxW - minW) / config.yawrateResolution;