37 #ifndef OMPL_CONTROL_PLANNER_DATA_STORAGE_
38 #define OMPL_CONTROL_PLANNER_DATA_STORAGE_
41 #include <boost/version.hpp>
42 #if BOOST_VERSION < 104400
43 #warning Boost version >= 1.44 is required for PlannerDataStorage classes
46 #include "ompl/base/PlannerDataStorage.h"
47 #include "ompl/control/PlannerData.h"
48 #include "ompl/control/SpaceInformation.h"
89 std::vector<int> control_signature;
92 template<
typename Archive>
93 void serialize(Archive & ar,
const unsigned int version)
95 ar & boost::serialization::base_object<base::PlannerDataStorage::Header>(*this);
96 ar & control_signature;
103 template<
typename Archive>
104 void serialize(Archive & ar,
const unsigned int version)
106 ar & boost::serialization::base_object<base::PlannerDataStorage::PlannerDataEdgeData>(*this);
110 std::vector<unsigned char> control_;
118 OMPL_DEBUG(
"Loading %d PlannerDataEdgeControl objects", numEdges);
121 std::vector<Control*> controls;
123 for (
unsigned int i = 0; i < numEdges; ++i)
125 PlannerDataEdgeControlData edgeData;
128 std::vector<unsigned char> ctrlBuf (space->getSerializationLength());
129 Control *ctrl = space->allocControl();
130 controls.push_back(ctrl);
131 space->deserialize(ctrl, &edgeData.control_[0]);
134 pd.
addEdge(edgeData.endpoints_.first, edgeData.endpoints_.second, *edgeData.e_, edgeData.weight_);
148 for (
size_t i = 0; i < controls.size(); ++i)
149 space->freeControl(controls[i]);
159 std::vector<unsigned char> ctrl (space->getSerializationLength());
161 for (
unsigned int i = 0; i < pd.
numVertices(); ++i)
162 for (
unsigned int j = 0; j < pd.
numVertices(); ++j)
166 PlannerDataEdgeControlData edgeData;
167 edgeData.e_ = &pd.
getEdge(i, j);
168 edgeData.endpoints_.first = i;
169 edgeData.endpoints_.second = j;
172 space->serialize(&ctrl[0], static_cast<const PlannerDataEdgeControl*>(edgeData.e_)->getControl());
173 edgeData.control_ = ctrl;