22void TrafoHelperMarker(
const Eigen::Quaterniond& q)
26 Eigen::Matrix3d dcm = q.toRotationMatrix();
28 ImGui::BeginHorizontal(
"Tooltip Horizontal");
30 ImGui::BeginVertical(
"Tooltip Vertical 1");
32 ImGui::TextUnformatted(
"(X Y Z)_b = ");
38 ImGui::BeginVertical(
"Tooltip Vertical 2");
40 ImGui::TextUnformatted(
" * (X Y Z)_p");
44 ImGui::EndHorizontal();
57 ImGui::SetNextItemOpen(
false, ImGuiCond_Appearing);
58 if (ImGui::TreeNode(fmt::format(
"Imu Position & Rotation##{}",
size_t(
id)).c_str()))
60 ImGui::BeginDisabled();
61 std::array<float, 3> imuPos = {
static_cast<float>(
_imuPos.b_positionIMU_p().x()),
static_cast<float>(
_imuPos.b_positionIMU_p().y()),
static_cast<float>(
_imuPos.b_positionIMU_p().z()) };
62 if (ImGui::InputFloat3(fmt::format(
"Position [m]##{}",
size_t(
id)).c_str(), imuPos.data()))
65 _imuPos._b_positionIMU_p = Eigen::Vector3d(imuPos.at(0), imuPos.at(1), imuPos.at(2));
69 gui::widgets::HelpMarker(
"Position of the IMU sensor relative to the vehicle center of mass in the body coordinate frame.");
72 std::array<float, 3> imuRot = {
static_cast<float>(eulerAngelsIMU.x()),
static_cast<float>(eulerAngelsIMU.y()),
static_cast<float>(eulerAngelsIMU.z()) };
73 if (ImGui::InputFloat3(fmt::format(
"Rotation [deg]##{}",
size_t(
id)).c_str(), imuRot.data()))
76 imuRot.at(0) = std::max(imuRot.at(0), -179.9999F);
77 imuRot.at(0) = std::min(imuRot.at(0), 180.0F);
78 imuRot.at(1) = std::max(imuRot.at(1), -89.9999F);
79 imuRot.at(1) = std::min(imuRot.at(1), 90.0F);
80 imuRot.at(2) = std::max(imuRot.at(2), -179.9999F);
81 imuRot.at(2) = std::min(imuRot.at(2), 180.0F);
87 TrafoHelperMarker(
_imuPos.b_quat_p());
108 if (j.contains(
"imuPos"))
110 j.at(
"imuPos").get_to(
_imuPos);
Transformation collection.
nlohmann::json json
json namespace
Text Help Marker (?) with Tooltip.
#define LOG_TRACE
Detailled info to trace the execution of the program. Should not be called on functions which receive...
Widgets related to Matrices.
@ GuiMatrixViewFlags_None
None.
json save() const override
Saves the node into a json object.
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.
Imu(const Imu &)=delete
Copy constructor.
ImuPos _imuPos
Position and rotation information for conversion from platform to body frame.
Node(std::string name)
Constructor.
std::string nameId() const
Node name and id.
std::string name
Name of the Node.
void ApplyChanges()
Signals that there have been changes to the flow.
Eigen::Quaternion< Scalar > b_Quat_p(Scalar mountingAngleX, Scalar mountingAngleY, Scalar mountingAngleZ)
Quaternion for rotations from platform to body frame.
Eigen::Vector3< typename Derived::Scalar > quat2eulerZYX(const Eigen::QuaternionBase< Derived > &q)
Converts the quaternion to Euler rotation angles with rotation sequence ZYX.
void move(std::vector< T > &v, size_t sourceIdx, size_t targetIdx)
Moves an element within a vector to a new position.
constexpr auto deg2rad(const T °)
Convert Degree to Radians.
constexpr auto rad2deg(const T &rad)
Convert Radians to Degree.