rand/srand were probably already deprecated by the time this code was written...
I took the error on MoveIt's CI as an incentive to migrate to std::random:
As example code referred to a seeding step, I added an explicit setRandomSeed to the API.
<<<
rviz_visual_tools.cpp:2810:42: error: implicit conversion from 'int' to 'float' changes value from 2147483647 to 2147483648 [-Werror,-Wimplicit-int-float-conversion]
float d = static_cast(rand()) / RAND_MAX;
~ ^~~~
/usr/include/stdlib.h:86:18: note: expanded from macro 'RAND_MAX'
^~~~~~
<<<
rand/srand were probably already deprecated by the time this code was written... I took the error on MoveIt's CI as an incentive to migrate to std::random:
As example code referred to a seeding step, I added an explicit setRandomSeed to the API.
This is required to fix MoveIt's CI: https://github.com/ros-planning/moveit/pull/2792/commits/2989f44e50ea10a1bc1ef833d39bac766daf61f5
<<< rviz_visual_tools.cpp:2810:42: error: implicit conversion from 'int' to 'float' changes value from 2147483647 to 2147483648 [-Werror,-Wimplicit-int-float-conversion] float d = static_cast(rand()) / RAND_MAX;
~ ^
~~~ /usr/include/stdlib.h:86:18: note: expanded from macro 'RAND_MAX' ^~~~~~ <<<Please review @nbbrooks @tylerjw @JafarAbdi