Robowflex  v0.1
Making MoveIt Easy
robowflex::TrajectoryPlanDataSetOutputter Class Reference

Benchmark outputter that saves each trajectory from each run to a rosbag file. More...

#include <benchmarking.h>

+ Inheritance diagram for robowflex::TrajectoryPlanDataSetOutputter:

Public Member Functions

 TrajectoryPlanDataSetOutputter (const std::string &file)
 Constructor. More...
 
void dump (const PlanDataSet &results) override
 Dumps all trajectories in results to rosbag file file_. The topic the trajectories are saved under is the name_ in results, or the name of the request. More...
 
- Public Member Functions inherited from robowflex::PlanDataSetOutputter
virtual ~PlanDataSetOutputter ()=default
 Virtual destructor for cleaning up resources. More...
 

Private Attributes

const std::string file_
 Filename. More...
 
IO::Bag bag_
 Rosbag handler. More...
 

Detailed Description

Benchmark outputter that saves each trajectory from each run to a rosbag file.

Definition at line 547 of file benchmarking.h.

Constructor & Destructor Documentation

◆ TrajectoryPlanDataSetOutputter()

TrajectoryPlanDataSetOutputter::TrajectoryPlanDataSetOutputter ( const std::string file)

Constructor.

Parameters
[in]fileFilename for rosbag.

TrajectoryPlanDataSetOutputter

Definition at line 585 of file benchmarking.cpp.

586  : file_(file), bag_(file_)
587 {
588 }
const std::string file_
Filename.
Definition: benchmarking.h:563

Member Function Documentation

◆ dump()

void TrajectoryPlanDataSetOutputter::dump ( const PlanDataSet results)
overridevirtual

Dumps all trajectories in results to rosbag file file_. The topic the trajectories are saved under is the name_ in results, or the name of the request.

Parameters
[in]resultsResults to dump to file.

Implements robowflex::PlanDataSetOutputter.

Definition at line 590 of file benchmarking.cpp.

591 {
592  const std::string &name = results.name;
593 
594  for (const auto &data : results.getFlatData())
595  if (data->trajectory)
596  bag_.addMessage(name, data->trajectory->getMessage());
597 }
bool addMessage(const std::string &topic, const T &msg)
Adds a message to the bag under topic.
Definition: bag.h:50
std::vector< PlanDataPtr > getFlatData() const
Get the full data set as a flat vector.
std::string name
Name of this dataset.
Definition: benchmarking.h:167

Member Data Documentation

◆ bag_

IO::Bag robowflex::TrajectoryPlanDataSetOutputter::bag_
private

Rosbag handler.

Definition at line 564 of file benchmarking.h.

◆ file_

const std::string robowflex::TrajectoryPlanDataSetOutputter::file_
private

Filename.

Definition at line 563 of file benchmarking.h.


The documentation for this class was generated from the following files: