21 #include <Eigen/Geometry>
40 const Eigen::Vector3d& pose,
41 double dynamicsCounter,
44 uint64_t actuatorsMsgCounter;
45 uint64_t actuatorsMaxDelayUsec;
55 arm_str =
"[Disarmed]";
59 logStream << arm_str <<
", ";
63 double dynamicsCompleteness = (double)dynamicsCounter *
_dt_secs / (
_clockScale * periodSec);
64 uint8_t dynamicsPercent = 100 * dynamicsCompleteness;
65 std::string dyn_str =
"dyn=" + std::to_string(dynamicsPercent) +
"%";
66 addErrColor(logStream, dynamicsPercent >= 95, dyn_str);
70 uint8_t rosPubPercent = 100 * rosPubCompleteness;
71 std::string ros_pub_str =
"ros_pub=" + std::to_string(rosPubPercent) +
"%";
72 addErrColor(logStream, rosPubPercent >= 99, ros_pub_str);
75 std::string setpoint_name;
76 if (actuatorsSize > 1) {
77 setpoint_name =
"Vector" + std::to_string(actuatorsSize);
78 }
else if (actuatorsSize == 1) {
79 setpoint_name =
"Scalar";
81 setpoint_name =
"Setpoint";
83 std::string actuator_str = setpoint_name +
"=" + std::to_string(actuatorsMsgCounter) +\
84 " hz (" + std::to_string(actuatorsMaxDelayUsec / 1000) +
" ms)";
85 if (actuatorsMsgCounter < 150 || actuatorsMaxDelayUsec > 30000 || actuatorsMaxDelayUsec == 0) {
87 }
else if (actuatorsMsgCounter < 175 || actuatorsMaxDelayUsec > 15000) {
90 logStream << actuator_str;
96 logStream << std::setprecision(2) << std::fixed <<
" ["
97 << actuators[0] <<
", "
98 << actuators[1] <<
", "
99 << actuators[2] <<
", "
100 << actuators[3] <<
"] ";
102 logStream << std::setprecision(2) << std::fixed <<
" ["
103 << actuators[0] <<
", "
104 << actuators[1] <<
", "
105 << actuators[2] <<
", "
106 << actuators[3] <<
", "
107 << actuators[4] <<
", "
108 << actuators[5] <<
", "
109 << actuators[6] <<
", "
110 << actuators[7] <<
"] ";
115 logStream <<
" [" << actuators[5] <<
", "
116 << actuators[6] <<
", "
117 << actuators[7] <<
"]";
118 addBold(logStream,
" throttle");
119 logStream <<
" [" << actuators[4] <<
"] ";
122 logStream <<
" [" << actuators[9] <<
", "
123 << actuators[10] <<
", "
124 << actuators[11] <<
"]";
125 addBold(logStream,
" throttle");
126 logStream <<
" [" << actuators[8] <<
"] ";
130 addBold(logStream,
"enu pose");
131 logStream << std::setprecision(1) << std::fixed <<
" ["
132 << enuPosition[0] <<
", "
133 << enuPosition[1] <<
", "
134 << enuPosition[2] <<
"].";
141 logStream << newData;