Skip to content

Why rpm is negated? #9

@aravindSolteq

Description

@aravindSolteq

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions