Skip to content
This repository was archived by the owner on Jan 23, 2024. It is now read-only.

Logging

Marija Popovic edited this page Nov 6, 2017 · 2 revisions

We provide logging structs in both planning packages that can be used to print data variables to files for visualization and debugging. By default, the logged outputs are saved to a debug sub-folder in the respective packages. The relevant outputs from the mapping/planning modules are saved in formats so that they can be loaded directly in MATLAB.

For details about logging functionalities, please refer to the logging header, logger.h, in the respective packages. Each header contains a MappingLogger and PlanningLogger struct, which can be used in grid_map.cpp and tmplanner.cpp, respectively. Note that the interfaces are unique to discrete and continuous variable monitoring due to differences between the algorithms.


Examples

For example, you can use the functions below to record some relevant outputs from the planning frameworks.

  • To record a pose where a single measurement is taken:

void PlanningLogger::writeMeasurementPose(const geometry_msgs::Pose& measurement_pose)

→ The pose data is appended to debug/measurement_poses.dat and debug/measurement_poses_matlab.dat (MATLAB format: ROS time stamp + positions).

  • To record a list of control poses defining a finite-horizon plan:

void PlanningLogger::writeControlPoses(const std::deque<geometry_msgs::Pose>& control_poses)

→ The pose data is appended to debug/control_poses_matlab.dat (MATLAB format: positions).

  • To record the map entropy and classification rate (informative metrics for tmplanner_discrete):
void PlanningLogger::writeMapMetrics(const double& entropy, const double& classifiction_rate)

→ The data is appended to debug/map_metrics.dat (MATLAB format: ROS time stamp + entropy + classification rate).

  • To record the trace of the covariance matrix (informative metric for tmplanner_continuous):
void PlanningLogger::writeCovarianceTrace(const double& trace)

→ The data is appended to debug/cov_traces.dat (MATLAB format: ROS time stamp + covariance trace).


Example tmplanner_continuous/debug folder:

Clone this wiki locally