SE2RigidBodyPlanning.h
1 /*********************************************************************
2 * Rice University Software Distribution License
3 *
4 * Copyright (c) 2010, Rice University
5 * All Rights Reserved.
6 *
7 * For a full description see the file named LICENSE.
8 *
9 *********************************************************************/
10 
11 /* Author: Ioan Sucan */
12 
13 #ifndef OMPLAPP_SE2_RIGID_BODY_PLANNING_
14 #define OMPLAPP_SE2_RIGID_BODY_PLANNING_
15 
16 #include <ompl/base/spaces/SE2StateSpace.h>
17 
18 #include "omplapp/apps/AppBase.h"
19 
20 namespace ompl
21 {
22  namespace app
23  {
24 
27  class SE2RigidBodyPlanning : public AppBase<AppType::GEOMETRIC>
28  {
29  public:
30  SE2RigidBodyPlanning() : AppBase<AppType::GEOMETRIC>(std::make_shared<base::SE2StateSpace>(), Motion_2D)
31  {
32  name_ = "Rigid body planning (2D)";
33  }
34  template <typename CarStateSpacePtr>
35  explicit SE2RigidBodyPlanning(CarStateSpacePtr carstatespace)
36  : AppBase<AppType::GEOMETRIC>(carstatespace, Motion_2D)
37  {
38  name_ = "Geometric car-like planning (2D)";
39  }
40 
41  ~SE2RigidBodyPlanning() override = default;
42 
43  bool isSelfCollisionEnabled() const override
44  {
45  return false;
46  }
47 
48  base::ScopedState<> getDefaultStartState() const override;
49 
50  base::ScopedState<> getFullStateFromGeometricComponent(const base::ScopedState<> &state) const override
51  {
52  return state;
53  }
54 
55  const base::StateSpacePtr& getGeometricComponentStateSpace() const override
56  {
57  return getStateSpace();
58  }
59 
60  unsigned int getRobotCount() const override
61  {
62  return 1;
63  }
64 
65  protected:
66 
67  const base::State* getGeometricComponentStateInternal(const base::State* state, unsigned int /*index*/) const override
68  {
69  return state;
70  }
71 
72  };
73 
74  }
75 }
76 
77 #endif
const base::StateSpacePtr & getStateSpace() const
Get the current instance of the state space.
Definition: SimpleSetup.h:156
Definition of a scoped state.
Definition: ScopedState.h:120
Main namespace. Contains everything in this library.
Definition: AppBase.h:21