add checking for NaN when handling velocity

This commit is contained in:
Sem van der Hoeven
2023-05-15 11:28:05 +02:00
parent 1ba1d21487
commit f6873d553e

View File

@@ -160,7 +160,12 @@ private:
{
for (int i = 0; i < 3; i++)
{
velocity[i] += request->values[i];
if (request->values[i] != NAN)
{
velocity[i] += request->values[i];
} else {
velocity[i] = request->values[i];
}
}
RCLCPP_INFO(this->get_logger(), "Got new velocity setpoint. %f %f %f", velocity[0], velocity[1], velocity[2]);
}