f1tenth / vesc

Repository for the VESC Controller (ROS1 and ROS2)
BSD 3-Clause "New" or "Revised" License
53 stars 77 forks source link

Why rpm is negated? #9

Open aravindSolteq opened 3 years ago

aravindSolteq commented 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?