21 #include <Eigen/Geometry> 39 const Eigen::Vector3d& pose,
40 double dynamicsCounter,
49 logStream << arm_str <<
", ";
53 double dynamicsCompleteness = (double)dynamicsCounter *
_dt_secs / (
_clockScale * periodSec);
54 std::string dyn_str =
"dyn=" + std::to_string(dynamicsCompleteness);
55 colorize(logStream, dynamicsCompleteness >= 0.9, dyn_str);
59 std::string ros_pub_str =
"ros_pub=" + std::to_string(rosPubCompleteness);
60 colorize(logStream, rosPubCompleteness >= 0.9, ros_pub_str);
63 std::string actuator_str =
"setpoint=" + std::to_string(actuatorsMsgCounter);
64 bool is_actuator_ok = actuatorsMsgCounter > 100 && maxDelayUsec < 20000 && maxDelayUsec != 0;
65 colorize(logStream, is_actuator_ok, actuator_str);
66 logStream <<
" msg/sec.\n";
67 actuatorsMsgCounter = 0;
71 logStream << std::setprecision(2) << std::fixed <<
" [" 72 << actuators[0] <<
", " 73 << actuators[1] <<
", " 74 << actuators[2] <<
", " 75 << actuators[3] <<
"] ";
79 logStream <<
" [" << actuators[4] <<
", " 80 << actuators[5] <<
", " 81 << actuators[6] <<
"]";
82 addBold(logStream,
" throttle");
83 logStream <<
" [" << actuators[7] <<
"] ";
88 logStream << std::setprecision(1) << std::fixed <<
" [" 89 << enuPosition[0] <<
", " 90 << enuPosition[1] <<
", " 91 << enuPosition[2] <<
"].";
uint64_t actuatorsMsgCounter_
Eigen::Vector3d nedToEnu(Eigen::Vector3d ned)
static const std::string COLOR_TAIL
static const std::string COLOR_BOLD
DynamicsNotation_t notation
static const std::string COLOR_GREEN
std::vector< double > _actuators
static void colorize(std::stringstream &logStream, bool is_ok, const std::string &newData)
static const float ROS_PUB_PERIOD_SEC
void init(double clockScale, double dt_secs)
void createStringStream(std::stringstream &logStream, const Eigen::Vector3d &pose, double dynamicsCounter, double rosPubCounter, double periodSec)
static void addBold(std::stringstream &logStream, const char *newData)
static const std::string COLOR_RED