f1tenth/vesc

Why rpm is negated?

Opened this issue · 0 comments

Why is this in vesc_packet.cpp

double VescPacketValues::rpm() const
{
int32_t v = static_cast<int32_t>((static_cast<uint32_t>((payload_.first + 23)) << 24) +
(static_cast<uint32_t>(
(payload_.first + 24)) << 16) +
(static_cast<uint32_t>((payload_.first + 25)) << 8) +
static_cast<uint32_t>(
(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?