88 j.at(
"ip").get_to(
_ip);
90 if (j.contains(
"port"))
92 j.at(
"port").get_to(
_port);
100 std::string ipString{};
101 for (
size_t i = 0; i < 4; i++)
103 ipString.append(std::to_string(
_ip.at(i)));
104 i < 3 ? ipString.append(
".") : ipString.append(
"");
121 auto posVelAtt = std::make_shared<PosVelAtt>(*std::static_pointer_cast<const PosVelAtt>(queue.
extract_front()));
123 Eigen::Vector3d posLLA = posVelAtt->lla_position();
124 Eigen::Vector3d vel_n = posVelAtt->n_velocity();
125 Eigen::Vector4d n_Quat_b = { posVelAtt->n_Quat_b().x(), posVelAtt->n_Quat_b().y(), posVelAtt->n_Quat_b().z(), posVelAtt->n_Quat_b().w() };
126 auto timeStamp = posVelAtt->insTime.toGPSweekTow();
127 auto gpsC = timeStamp.gpsCycle;
128 auto gpsW = timeStamp.gpsWeek;
129 auto gpsT = timeStamp.tow;
131 std::vector<double> udp_posVelAtt{ posLLA(0), posLLA(1), posLLA(2), vel_n(0), vel_n(1), vel_n(2), n_Quat_b(0), n_Quat_b(1), n_Quat_b(2), n_Quat_b(3),
static_cast<double>(gpsC),
static_cast<double>(gpsW),
static_cast<double>(gpsT) };
nlohmann::json json
json namespace
Text Help Marker (?) with Tooltip.
Utility class for logging to console and file.
#define LOG_TRACE
Detailled info to trace the execution of the program. Should not be called on functions which receive...
ImVec2 _guiConfigDefaultWindowSize
Node(std::string name)
Constructor.
std::string nameId() const
Node name and id.
std::string name
Name of the Node.
bool _hasConfig
Flag if the config window should be shown.
static std::string type()
Returns the type of the data class.
auto extract_front()
Returns a copy of the first element in the container and removes it from the container.
boost::asio::ip::udp::resolver::results_type _endpoints
Boost udp endpoint.
bool initialize() override
Initialize the node.
UdpSend()
Default constructor.
static constexpr std::array< int, 2 > IP_LIMITS
Range an IPv4 address can be in [0, 2^8-1].
boost::asio::ip::udp::resolver _resolver
Boost udp resolver.
bool resetNode() override
Resets the node. Moves the read cursor to the start.
void deinitialize() override
Deinitialize the node.
static std::string category()
String representation of the Class Category.
std::string type() const override
String representation of the Class Type.
boost::asio::io_context _io_context
Asynchronous receive fct.
void restore(const json &j) override
Restores the node from a json object.
void guiConfig() override
ImGui config window which is shown on double click.
static std::string typeStatic()
String representation of the Class Type.
static constexpr std::array< int, 2 > PORT_LIMITS
Range a port can be in [0, 2^16-1].
void receivePosVelAtt(InputPin::NodeDataQueue &queue, size_t pinIdx)
Callback when receiving data on a port.
int _port
UDP port number.
boost::asio::ip::udp::socket _socket
Boost udp socket.
std::array< int, 4 > _ip
IPv4 address.
json save() const override
Saves the node into a json object.
~UdpSend() override
Destructor.
static float windowFontRatio()
Ratio to multiply for GUI window elements.
bool InputIntL(const char *label, int *v, int v_min, int v_max, int step, int step_fast, ImGuiInputTextFlags flags)
Shows a value limited InputText GUI element for 'int'.
bool InputInt4L(const char *label, int v[4], int v_min, int v_max, ImGuiInputTextFlags flags)
Shows a value limited InputText GUI element for an array of 'int[4]'.
InputPin * CreateInputPin(Node *node, const char *name, Pin::Type pinType, const std::vector< std::string > &dataIdentifier={}, InputPin::Callback callback=static_cast< InputPin::FlowFirableCallbackFunc >(nullptr), InputPin::FlowFirableCheckFunc firable=nullptr, int priority=0, int idx=-1)
Create an Input Pin object.
void ApplyChanges()
Signals that there have been changes to the flow.
Asynchronous data link - sender node.