ControlSpace.cpp
45 static void computeControlSpaceSignatureHelper(const ControlSpace *space, std::vector<int> &signature)
54 computeControlSpaceSignatureHelper(space->as<CompoundControlSpace>()->getSubspace(i).get(), signature);
61 ompl::control::ControlSpace::ControlSpace(const base::StateSpacePtr &stateSpace) : stateSpace_(stateSpace)
103 double* ompl::control::ControlSpace::getValueAddressAtIndex(Control* /*control*/, const unsigned int /*index*/) const
123 void ompl::control::ControlSpace::serialize(void* /*serialization*/, const Control* /*ctrl*/) const
127 void ompl::control::ControlSpace::deserialize(Control* /*ctrl*/, const void* /*serialization*/) const
157 const ompl::control::ControlSpacePtr& ompl::control::CompoundControlSpace::getSubspace(const unsigned int index) const
165 const ompl::control::ControlSpacePtr& ompl::control::CompoundControlSpace::getSubspace(const std::string &name) const
199 void ompl::control::CompoundControlSpace::copyControl(Control *destination, const Control *source) const
207 bool ompl::control::CompoundControlSpace::equalControls(const Control *control1, const Control *control2) const
224 ompl::control::ControlSamplerPtr ompl::control::CompoundControlSpace::allocDefaultControlSampler() const
237 double* ompl::control::CompoundControlSpace::getValueAddressAtIndex(Control *control, const unsigned int index) const
259 void ompl::control::CompoundControlSpace::printControl(const Control *control, std::ostream &out) const
291 void ompl::control::CompoundControlSpace::serialize(void *serialization, const Control *ctrl) const
302 void ompl::control::CompoundControlSpace::deserialize(Control *ctrl, const void *serialization) const
308 components_[i]->deserialize(compctrl->components[i], reinterpret_cast<const char*>(serialization) + l);
Unset type; this is the default type.
Definition: ControlSpaceTypes.h:50
unsigned int getSubspaceCount() const
Get the number of control spaces that make up the compound control space.
Definition: ControlSpace.cpp:152
virtual void serialize(void *serialization, const Control *ctrl) const
Serializes the given control into the serialization buffer.
Definition: ControlSpace.cpp:123
base::StateSpacePtr stateSpace_
The state space controls can be applied to.
Definition: ControlSpace.h:184
const std::string & getName() const
Get the name of the control space.
Definition: ControlSpace.cpp:71
Definition of a compound control sampler. This is useful to construct samplers for compound controls...
Definition: ControlSampler.h:129
virtual void addSubspace(const ControlSpacePtr &component)
Adds a control space as a component of the compound control space.
Definition: ControlSpace.cpp:143
virtual void addSampler(const ControlSamplerPtr &sampler)
Add a sampler as part of the new compound sampler. This sampler is used to sample part of the compoun...
Definition: ControlSampler.cpp:60
A boost shared pointer wrapper for ompl::base::StateSpace.
A boost shared pointer wrapper for ompl::control::ControlSampler.
virtual void deserialize(Control *ctrl, const void *serialization) const
Deserializes a control from the serialization buffer.
Definition: ControlSpace.cpp:127
virtual void serialize(void *serialization, const Control *ctrl) const
Serializes the given control into the serialization buffer.
Definition: ControlSpace.cpp:291
void lock()
Lock this control space. This means no further control spaces can be added as components. This function can be for instance called from the constructor of a state space that inherits from CompoundControlSpace to prevent the user to add further components.
Definition: ControlSpace.cpp:232
const ControlSpacePtr & getSubspace(const unsigned int index) const
Get a specific subspace from the compound control space.
Definition: ControlSpace.cpp:157
void setName(const std::string &name)
Set the name of the control space.
Definition: ControlSpace.cpp:76
void clearControlSamplerAllocator()
Clear the control sampler allocator (reset to default)
Definition: ControlSpace.cpp:98
virtual unsigned int getDimension() const
Get the dimension of this control space.
Definition: ControlSpace.cpp:173
virtual void printControl(const Control *control, std::ostream &out=std::cout) const
Print a control to a stream.
Definition: ControlSpace.cpp:259
virtual void printSettings(std::ostream &out) const
Print the settings for this control space to a stream.
Definition: ControlSpace.cpp:113
virtual double * getValueAddressAtIndex(Control *control, const unsigned int index) const
Many controls contain a number of double values. This function provides a means to get the memory add...
Definition: ControlSpace.cpp:103
A boost shared pointer wrapper for ompl::control::ControlSpace.
virtual bool isCompound() const
Check if the control space is compound.
Definition: ControlSpace.cpp:313
virtual void setup()
Perform final setup steps. This function is automatically called by the SpaceInformation.
Definition: ControlSpace.cpp:81
virtual void copyControl(Control *destination, const Control *source) const
Copy a control to another.
Definition: ControlSpace.cpp:199
virtual unsigned int getSerializationLength() const
Returns the serialization size for a single control in this space.
Definition: ControlSpace.cpp:283
virtual double * getValueAddressAtIndex(Control *control, const unsigned int index) const
Many controls contain a number of double values. This function provides a means to get the memory add...
Definition: ControlSpace.cpp:237
virtual ControlSamplerPtr allocDefaultControlSampler() const
Allocate the default control sampler.
Definition: ControlSpace.cpp:224
ControlSpace(const base::StateSpacePtr &stateSpace)
Construct a control space, given the state space.
Definition: ControlSpace.cpp:61
virtual bool equalControls(const Control *control1, const Control *control2) const
Check if two controls are the same.
Definition: ControlSpace.cpp:207
virtual unsigned int getSerializationLength() const
Returns the serialization size for a single control in this space.
Definition: ControlSpace.cpp:118
virtual void printControl(const Control *control, std::ostream &out) const
Print a control to a stream.
Definition: ControlSpace.cpp:108
void computeSignature(std::vector< int > &signature) const
Compute an array of ints that uniquely identifies the structure of the control space. The first element of the signature is the number of integers that follow.
Definition: ControlSpace.cpp:131
void setControlSamplerAllocator(const ControlSamplerAllocator &csa)
Set the sampler allocator to use.
Definition: ControlSpace.cpp:93
virtual bool isCompound() const
Check if the control space is compound.
Definition: ControlSpace.cpp:138
virtual void setup()
Perform final setup steps. This function is automatically called by the SpaceInformation.
Definition: ControlSpace.cpp:276
virtual ControlSamplerPtr allocControlSampler() const
Allocate an instance of the control sampler for this space. This sampler will be allocated with the s...
Definition: ControlSpace.cpp:85
virtual void deserialize(Control *ctrl, const void *serialization) const
Deserializes a control from the serialization buffer.
Definition: ControlSpace.cpp:302
virtual void nullControl(Control *control) const
Make the control have no effect if it were to be applied to a state for any amount of time...
Definition: ControlSpace.cpp:217
virtual Control * allocControl() const
Allocate memory for a control.
Definition: ControlSpace.cpp:181
virtual void printSettings(std::ostream &out) const
Print the settings for this control space to a stream.
Definition: ControlSpace.cpp:268
virtual void freeControl(Control *control) const
Free the memory of a control.
Definition: ControlSpace.cpp:190
boost::function< ControlSamplerPtr(const ControlSpace *)> ControlSamplerAllocator
Definition of a function that can allocate a control sampler.
Definition: ControlSampler.h:167