All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
MorseStateSpace.h
1 /*********************************************************************
2 * Software License Agreement (BSD License)
3 *
4 * Copyright (c) 2010, Rice University
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 *
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above
14 * copyright notice, this list of conditions and the following
15 * disclaimer in the documentation and/or other materials provided
16 * with the distribution.
17 * * Neither the name of the Rice University nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.
33 *********************************************************************/
34 
35 /* Authors: Caleb Voss */
36 
37 #ifndef OMPL_EXTENSION_MORSE_STATE_SPACE_
38 #define OMPL_EXTENSION_MORSE_STATE_SPACE_
39 
40 #include "ompl/base/StateSpace.h"
41 #include "ompl/extensions/morse/MorseEnvironment.h"
42 
43 namespace ompl
44 {
45  namespace base
46  {
47 
50  {
51  public:
52 
55  {
56  public:
58  {
59  }
60  };
61 
78  double positionWeight = 1.0, double linVelWeight = 0.5,
79  double angVelWeight = 0.5, double orientationWeight = 1.0);
80 
81  virtual ~MorseStateSpace(void)
82  {
83  }
84 
87  {
88  return env_;
89  }
90 
92  unsigned int getNrBodies(void) const
93  {
94  return env_->rigidBodies_;
95  }
96 
98  void setBounds(void);
99 
101  void setPositionBounds(const RealVectorBounds &bounds);
102 
104  void setLinearVelocityBounds(const RealVectorBounds &bounds);
105 
107  void setAngularVelocityBounds(const RealVectorBounds &bounds);
108 
111  void readState(State *state) const;
112 
115  void writeState(const State *state) const;
116 
118  bool satisfiesBounds(const State *state) const;
119 
120  State* allocState(void) const;
121  void freeState(State *state) const;
122  void copyState(State *destination, const State *source) const;
123  void interpolate(const State *from, const State *to, const double t, State *state) const;
124 
127 
128  protected:
129 
132  };
133  }
134 }
135 
136 
137 #endif
MORSE State. This is a compound state that allows accessing the properties of the bodies the state sp...
Definition of a compound state.
Definition: State.h:95
State space representing MORSE states.
A boost shared pointer wrapper for ompl::base::StateSampler.
void interpolate(const State *from, const State *to, const double t, State *state) const
Computes the state that lies at time t in [0, 1] on the segment that connects from state to to state...
void readState(State *state) const
Read the parameters of the MORSE bodies and store them in state.
State * allocState(void) const
Allocate a state that can store a point in the described space.
CompoundState StateType
Define the type of state allocated by this state space.
Definition: StateSpace.h:543
void freeState(State *state) const
Free the memory of the allocated state.
unsigned int getNrBodies(void) const
Get the number of bodies this state space represents.
A space to allow the composition of state spaces.
Definition: StateSpace.h:538
StateSamplerPtr allocStateSampler(void) const
Allocate an instance of the state sampler for this space. This sampler will be allocated with the sam...
Definition of an abstract state.
Definition: State.h:50
void writeState(const State *state) const
Set the parameters of the MORSE bodies to be the ones read from state.
MorseEnvironmentPtr env_
Representation of the MORSE parameters OMPL needs to plan.
bool satisfiesBounds(const State *state) const
This function checks whether a state satisfies its bounds.
The lower and upper bounds for an Rn space.
StateSamplerPtr allocDefaultStateSampler(void) const
Allocate an instance of the default uniform state sampler for this space.
void setBounds(void)
Set the bounds given by the MorseEnvironment.
void setLinearVelocityBounds(const RealVectorBounds &bounds)
Set the bounds for each of the linear velocity subspaces.
void setPositionBounds(const RealVectorBounds &bounds)
Set the bounds for each of the position subspaces.
A boost shared pointer wrapper for ompl::base::MorseEnvironment.
void copyState(State *destination, const State *source) const
Copy a state to another. The memory of source and destination should NOT overlap. ...
void setAngularVelocityBounds(const RealVectorBounds &bounds)
Set the bounds for each of the angular velocity subspaces.
MorseStateSpace(const MorseEnvironmentPtr &env, double positionWeight=1.0, double linVelWeight=0.5, double angVelWeight=0.5, double orientationWeight=1.0)
Construct a state space representing MORSE states.
const MorseEnvironmentPtr & getEnvironment(void) const
Get the MORSE environment this state space corresponds to.