Open aravindSolteq opened 3 years ago
Why is this in vesc_packet.cpp
double VescPacketValues::rpm() const { int32_t v = static_cast((static_cast((payload_.first + 23)) << 24) + (static_cast((payload_.first + 24)) << 16) + (static_cast((payload_.first + 25)) << 8) + static_cast((payload_.first + 26))); return static_cast(-1 * v); }
why is it returning -(1*v) instead of v directly? Is there any specific reason for negating the rpm value?
Why is this in vesc_packet.cpp
double VescPacketValues::rpm() const { int32_t v = static_cast((static_cast((payload_.first + 23)) << 24) +
(static_cast( (payload_.first + 24)) << 16) +
(static_cast((payload_.first + 25)) << 8) +
static_cast( (payload_.first + 26)));
return static_cast(-1 * v);
}
why is it returning -(1*v) instead of v directly? Is there any specific reason for negating the rpm value?