mm_utils.hpp 1.19 KB
Newer Older
1
2
3
4
5
#ifndef __MM_UTILS_HPP_
#define __MM_UTILS_HPP_

#include <string.h>
#include <rclcpp_lifecycle/lifecycle_node.hpp>
levi's avatar
levi committed
6
#include "mm_controller_interfaces/msg/mm_controller_status.hpp"
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <iomanip>
extern "C"
{
#include <mm_controller/mm_api.h>
}

namespace mm
{
    enum MMDeviceType
    {
        modem,
        beacon,
        hedgehog,
        unknown
    };
    std::string GetDeviceModelFromDeviceID(const uint8_t dev);
    std::string ComputeFirmwareString(const uint8_t major, const uint8_t minor, const uint8_t minor2);
    void PrintDeviceInformation(const rclcpp::Logger logger, const MarvelmindDeviceVersion dev);
levi's avatar
levi committed
25
26
    void PrintDeviceDistances(const rclcpp::Logger logger, const std::vector<mm_controller_interfaces::msg::DeviceDistance> distances);
    void PrintDeviceLocation(const rclcpp::Logger logger, const std::vector<mm_controller_interfaces::msg::DeviceStatus> devices);
27
28
29
    template <typename T>
    std::string int_to_hex(T i);
    std::string GenerateExecutionResult(bool executionSucces, std::string msg);
levi's avatar
levi committed
30
    std::vector<mm_controller_interfaces::msg::DeviceDistance> FilterDistances(const std::vector<mm_controller_interfaces::msg::DeviceDistance> distances);
31
32
}
#endif // __MM_UTILS_HPP_