onboardsdk
Loading...
Searching...
No Matches
PioneerThrustersSetpoint.hpp
1#pragma once
2#include <fmt/format.h>
3
4#include <cstdint>
5#include <iostream>
6
7namespace blunux::pmu {
16 int16_t right = 0;
17 int16_t left = 0;
18 int16_t lat = 0;
19 int16_t vert = 0;
20};
21
22} // namespace blunux::pmu
23
28template <>
29struct fmt::formatter<blunux::pmu::PioneerThrustersSetpoint> {
36 template <typename ParseContext>
37 // NOLINTNEXTLINE(runtime/references)
38 constexpr auto parse(ParseContext& ctx) {
39 return ctx.begin();
40 }
41
49 template <typename FormatContext>
51 FormatContext& ctx) const { // NOLINT(runtime/references)
52 return fmt::format_to(ctx.out(), "right: {} left: {} lat: {} vert: {}",
53 data.right, data.left, data.lat, data.vert);
54 }
55};
56
64inline std::ostream& operator<<(std::ostream& os,
66 return os << fmt::format("{}", data);
67}
Structure representing setpoint values for thrusters.
Definition PioneerThrustersSetpoint.hpp:15
int16_t vert
Set point for the vertical thruster [-1000..1000].
Definition PioneerThrustersSetpoint.hpp:19
int16_t right
Set point for the right thruster [-1000..1000].
Definition PioneerThrustersSetpoint.hpp:16
int16_t left
Set point for the left thruster [-1000..1000].
Definition PioneerThrustersSetpoint.hpp:17
int16_t lat
Set point for the lateral thruster [-1000..1000].
Definition PioneerThrustersSetpoint.hpp:18
auto format(blunux::pmu::PioneerThrustersSetpoint const &data, FormatContext &ctx) const
Formats the PioneerThrustersSetpoint object.
Definition PioneerThrustersSetpoint.hpp:50
constexpr auto parse(ParseContext &ctx)
Parses the format string.
Definition PioneerThrustersSetpoint.hpp:38