75 throw std::runtime_error(
"PlanarDubins3D: msg dimension is incorrect: " +
76 std::to_string(msg.x.size()));
90 throw std::runtime_error(
"PlanarDubins3D: incorrect input dimension: " +
91 std::to_string(x.size()));
98 throw std::runtime_error(
"PlanarDubins3D: invalid configuration_dot dim: " +
99 std::to_string(configuration_dot.size()));
101 v_ = configuration_dot.norm();
102 theta_ = std::atan2(configuration_dot(1), configuration_dot(0));
109 const size_t kConfigurationSpaceDimension = 2;
112 std::uniform_real_distribution<double> unif(0.0, 1.0);
119 VectorXd sample(kConfigurationSpaceDimension);
120 for (
size_t ii = 0; ii < kConfigurationSpaceDimension; ii++)
122 lower_config(ii) + (upper_config(ii) - lower_config(ii)) * unif(
rng_);
131 std::uniform_real_distribution<double> unif(0.0, 1.0);
147 return std::vector<Vector3d>({
Position()});
160 const std::vector<double>& upper) {
162 if (lower.size() != 3 || upper.size() != 3)
163 throw std::runtime_error(
"PlanarDubins3D: bad bound dimension.");
183 ROS_ERROR(
"PlanarDubins3D: vector is of the wrong size.");
199 if (msg.x.size() == 3) {
204 }
else if (msg.x.size() == 4) {
210 }
else if (msg.x.size() == 3) {
215 throw std::runtime_error(
216 "PlanarDubins3D: msg is neither state nor configuration.");
221 fastrack_msgs::State msg;
void SetConfigurationDot(const VectorXd &configuration_dot)
PlanarDubins3D & operator*=(double s)
fastrack_msgs::State ToRos() const
friend PlanarDubins3D operator+(PlanarDubins3D lhs, const PlanarDubins3D &rhs)
VectorXd ToVector() const
Vector3d Position() const
static constexpr double kDefaultHeight
static PlanarDubins3D upper_
PlanarDubins3D & operator/=(double s)
static VectorXd SampleConfiguration()
friend PlanarDubins3D operator/(PlanarDubins3D lhs, double s)
friend PlanarDubins3D operator-(PlanarDubins3D lhs, const PlanarDubins3D &rhs)
void FromVector(const VectorXd &x)
PlanarDubins3D & operator-=(const PlanarDubins3D &rhs)
static VectorXd GetConfigurationUpper()
VectorXd Configuration() const
static const PlanarDubins3D & GetLower()
static constexpr size_t StateDimension()
friend PlanarDubins3D operator*(PlanarDubins3D lhs, double s)
PlanarDubins3D & operator+=(const PlanarDubins3D &rhs)
static constexpr size_t ConfigurationDimension()
static std::default_random_engine rng_
static const PlanarDubins3D & GetUpper()
static VectorXd GetConfigurationLower()
static PlanarDubins3D Sample()
void FromRos(const fastrack_msgs::State &msg)
static void SetBounds(const PlanarDubins3D &lower, const PlanarDubins3D &upper)
static PlanarDubins3D lower_
std::vector< Vector3d > OccupiedPositions() const