Fang-Robotics-MCB
Fang Robotics Team Codebase
Loading...
Searching...
No Matches
can_serializer.hpp
Go to the documentation of this file.
1/*****************************************************************************/
2/********** !!! WARNING: CODE GENERATED BY TAPROOT. DO NOT EDIT !!! **********/
3/*****************************************************************************/
4
5/*
6 * Copyright (c) 2020-2021 Advanced Robotics at the University of Washington <robomstr@uw.edu>
7 *
8 * This file is part of Taproot.
9 *
10 * Taproot is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * Taproot is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with Taproot. If not, see <https://www.gnu.org/licenses/>.
22 */
23
24#ifndef TAPROOT_CAN_SERIALIZER_HPP_
25#define TAPROOT_CAN_SERIALIZER_HPP_
26
27#ifdef PLATFORM_HOSTED
28
29#include <array>
30#include <cstdint>
31
33
34namespace modm::can
35{
36class Message;
37}
38
39namespace tap::motor::motorsim
40{
41class CanSerializer
42{
43public:
48 static std::array<int16_t, 4> parseMessage(const modm::can::Message* message);
49
53 static modm::can::Message serializeFeedback(
54 int16_t angle,
55 int16_t rpm,
56 int16_t current,
57 MotorId mid);
58
59private:
60 /* Constants */
61 static constexpr uint8_t FEEDBACK_MESSAGE_SEND_LENGTH = 8;
62};
63} // namespace tap::motor::motorsim
64
65#endif // PLATFORM_HOSTED
66
67#endif // TAPROOT_CAN_SERIALIZER_HPP_
Definition can.hpp:32