otherwise, when dir=-1 and the velocity value is negative, the output from velocity is in the opposite direction than the intended one
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>