Thunderbots Project
Loading...
Searching...
No Matches
plotjuggler_sink.h
1#pragma once
2#include <g3log/logmessage.hpp>
3#include <string>
4
5#include "proto/visualization.pb.h"
6#include "software/logger/custom_logging_levels.h"
7#include "software/networking/udp/threaded_udp_sender.h"
8
9
15{
16 public:
22 PlotJugglerSink(const std::string& interface = "lo");
23
24 ~PlotJugglerSink() = default;
25
32 void sendToPlotJuggler(g3::LogMessageMover log_entry);
33
34 private:
35 // Any error that occurs during the creation of the UDP sender will be stored here
36 std::optional<std::string> error;
37
38 ThreadedUdpSender udp_sender;
39};
40
41/*
42 * Convert the protobuf map to a JSON string
43 * This is done to allow minimal required setup to start plotting with Plot Juggler
44 *
45 * @param os The output stream
46 * @param message The PlotJugglerValue message to serialize
47 * @return The output stream containing the serialized message
48 */
49std::ostream& operator<<(std::ostream& os,
50 const TbotsProto::PlotJugglerValue& plotjuggler_value);
Definition plotjuggler_sink.h:15
void sendToPlotJuggler(g3::LogMessageMover log_entry)
Definition plotjuggler_sink.cpp:13
Definition threaded_udp_sender.h:10