41 _log_window->restoreGeometry(settings.value(
"RosoutPublisher.geometry").toByteArray());
57 settings.setValue(
"RosoutPublisher.geometry",
_log_window->saveGeometry());
76 std::vector<const PlotDataAny*> logs_timeseries;
80 const std::string& topic_name = data_it.first;
85 if (!registered_shapeshifted_msg)
90 if (registered_shapeshifted_msg->
getMD5Sum() !=
96 logs_timeseries.push_back(&data_it.second);
99 return logs_timeseries;
106 std::vector<rosgraph_msgs::LogConstPtr> logs;
110 for (
const PlotDataAny* type_erased_logs : logs_timeseries)
112 const int first_index = type_erased_logs->getIndexFromX(threshold_time);
114 if (first_index != -1)
116 for (
int i = first_index;
i < type_erased_logs->size();
i++)
118 const auto& any_msg = type_erased_logs->at(
i);
119 const std::any& any_value = any_msg.y;
121 const bool isRawBuffer = any_value.type() ==
typeid(std::vector<uint8_t>);
123 std::vector<uint8_t> raw_buffer;
127 raw_buffer = std::any_cast<std::vector<uint8_t>>(any_value);
129 else if (isRosbagMessage)
132 raw_buffer.resize(msg_instance.
size());
134 msg_instance.
write(stream);
141 rosgraph_msgs::LogPtr p(boost::make_shared<rosgraph_msgs::Log>());
145 int64_t usec = p->header.stamp.toNSec() / 1000;
149 if (usec >= threshold_time)
156 std::sort(logs.begin(), logs.end(), [](
const rosgraph_msgs::LogConstPtr& a,
const rosgraph_msgs::LogConstPtr& b) {
157 return a->header.stamp < b->header.stamp;
171 using namespace std::chrono;
const PlotDataMapRef * _datamap
std::vector< const PlotDataAny * > findRosoutTimeseries()
void syncWithTableModel(const std::vector< const PlotDataAny *> &logs_timeseries)
std::chrono::high_resolution_clock::time_point TimePoint
RosoutWindow * _log_window
void timeRangeChanged(TimePoint time_min, TimePoint time_max)
The ShapeShifter class is a type erased container for ROS Messages. It can be used also to create gen...
static RosIntrospectionFactory & get()
virtual void updateState(double current_time) override
int64_t _minimum_time_usec
LogsTableModel * _tablemodel
virtual bool enabled() const override
virtual void setEnabled(bool enabled) override
int64_t _maximum_time_usec
virtual ~RosoutPublisher()
static RosIntrospection::ShapeShifter * getShapeShifter(const std::string &topic_name)
AnySeriesMap user_defined
void push_back(const rosgraph_msgs::Log::ConstPtr &pushed_log)
void write(Stream &stream) const
std::string const & getMD5Sum() const
void deserialize(Stream &stream, T &t)